Skip to content

Commit

Permalink
[Feat]: 用户人物标题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
why committed Dec 21, 2023
1 parent c948fd3 commit 0f09fdd
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ class UserActivity : BaseViewModelActivity<ActivityUserBinding, UserViewModel>()
}

override fun initView() {
randomX(binding.topLeftTextView, randomOffset)
randomY(binding.topLeftTextView, randomOffset)
randomX(binding.tvJoin, randomOffset)
randomY(binding.tvJoin, randomOffset)

randomX(binding.middleLeftTextView, randomOffset)
randomY(binding.middleLeftTextView, randomOffset)
randomX(binding.tvSync, randomOffset)
randomY(binding.tvSync, randomOffset)

randomX(binding.bottomLeftTextView, randomOffset)
randomY(binding.bottomLeftTextView, randomOffset)
randomX(binding.tvOnline, randomOffset)
randomY(binding.tvOnline, randomOffset)

randomX(binding.topRightTextView, randomOffset)
randomY(binding.topRightTextView, randomOffset)
randomX(binding.tvIndex, randomOffset)
randomY(binding.tvIndex, randomOffset)

randomX(binding.middleRightTextView, randomOffset)
randomY(binding.middleRightTextView, randomOffset)
randomX(binding.tvMono, randomOffset)
randomY(binding.tvMono, randomOffset)

randomX(binding.bottomRightTextView, randomOffset)
randomY(binding.bottomRightTextView, randomOffset)
randomX(binding.tvBlog, randomOffset)
randomY(binding.tvBlog, randomOffset)

binding.toolbar.initNavBack(this)
}
Expand All @@ -83,15 +83,15 @@ class UserActivity : BaseViewModelActivity<ActivityUserBinding, UserViewModel>()
}

override fun initListener() {
binding.bottomRightTextView.setOnFastLimitClickListener {
binding.tvIndex.setOnFastLimitClickListener {
RouteHelper.jumpIndexList(true, viewModel.userId)
}

binding.middleRightTextView.setOnFastLimitClickListener {
binding.tvBlog.setOnFastLimitClickListener {
RouteHelper.jumpUserBlog(viewModel.userId)
}

binding.topRightTextView.setOnFastLimitClickListener {
binding.tvMono.setOnFastLimitClickListener {
RouteHelper.jumpUserMono(viewModel.userId)
}
}
Expand All @@ -104,13 +104,13 @@ class UserActivity : BaseViewModelActivity<ActivityUserBinding, UserViewModel>()
binding.ivBanner.loadImageBlur(it.avatar)
binding.ivAvatar.loadImageAnimate(it.avatar)

binding.topLeftTextView.text = it.createTime
binding.middleLeftTextView.text = it.userSynchronize.rate.ifBlank { "同步率 -%" }
binding.bottomLeftTextView.text =
binding.tvJoin.text = it.createTime
binding.tvSync.text = it.userSynchronize.rate.ifBlank { "同步率 -%" }
binding.tvOnline.text =
String.format("最近活跃 %s", it.lastOnlineTime.ifBlank { "暂无" })
binding.topRightTextView.text = "Ta 的人物"
binding.middleRightTextView.text = "Ta 的日志"
binding.bottomRightTextView.text = "Ta 的目录"
binding.tvMono.text = "Ta 的人物"
binding.tvBlog.text = "Ta 的日志"
binding.tvIndex.text = "Ta 的目录"

invalidateMenu()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class UserBlogActivity : BaseBindingActivity<ActivityUserContainerBinding>() {
}

override fun initView() {
binding.toolbar.title = "TA 的日志"
binding.toolbar.initNavBack(this)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import com.xiaoyv.common.kts.initNavBack
*/
class UserMonoActivity : BaseBindingActivity<ActivityUserContainerBinding>() {
private var userId: String = ""

override fun initIntentData(intent: Intent, bundle: Bundle, isNewIntent: Boolean) {
userId = bundle.getString(NavKey.KEY_STRING).orEmpty()
}

override fun initView() {
binding.toolbar.title = "TA 的人物"
binding.toolbar.initNavBack(this)
}

Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/layout/activity_user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:fitsSystemWindows="true"
android:paddingVertical="@dimen/ui_size_0"
app:expandedTitleGravity="center|bottom"
app:expandedTitleMarginBottom="@dimen/ui_size_60"
app:expandedTitleMarginBottom="@dimen/ui_size_40"
app:expandedTitleTextAppearance="@style/Theme.Bangumi.ExpandTitle"
app:expandedTitleTextColor="?attr/colorOnPrimarySurface"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
Expand Down Expand Up @@ -64,15 +64,15 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5"
app:layout_constraintVertical_bias="0.6"
app:shapeAppearance="@style/ShapeAppearance.Material3.Corner.Full"
app:strokeColor="@android:color/white"
app:strokeWidth="@dimen/ui_size_2"
tools:src="@tools:sample/avatars" />

<!-- 左上文案 -->
<com.xiaoyv.common.widget.text.AnimeTextView
android:id="@+id/topLeftTextView"
android:id="@+id/tv_join"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.9"
Expand All @@ -89,7 +89,7 @@

<!-- 左中文案 -->
<com.xiaoyv.common.widget.text.AnimeTextView
android:id="@+id/middleLeftTextView"
android:id="@+id/tv_sync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.9"
Expand All @@ -108,7 +108,7 @@

<!-- 左下文案 -->
<com.xiaoyv.common.widget.text.AnimeTextView
android:id="@+id/bottomLeftTextView"
android:id="@+id/tv_online"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.9"
Expand All @@ -126,7 +126,7 @@

<!-- 右上文案 -->
<com.xiaoyv.common.widget.text.AnimeTextView
android:id="@+id/topRightTextView"
android:id="@+id/tv_mono"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.9"
Expand All @@ -143,7 +143,7 @@

<!-- 右中文案 -->
<com.xiaoyv.common.widget.text.AnimeTextView
android:id="@+id/middleRightTextView"
android:id="@+id/tv_blog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.9"
Expand All @@ -162,7 +162,7 @@

<!-- 右下文案 -->
<com.xiaoyv.common.widget.text.AnimeTextView
android:id="@+id/bottomRightTextView"
android:id="@+id/tv_index"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.9"
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_user_container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/Theme.Bangumi.PopupOverlay"
app:title="用户日志" />
app:popupTheme="@style/Theme.Bangumi.PopupOverlay" />

</com.xiaoyv.common.widget.appbar.AnimeAppBarLayout>

Expand Down

0 comments on commit 0f09fdd

Please sign in to comment.