diff --git a/app/src/main/java/com/huanchengfly/tieba/post/activities/ForumActivity.kt b/app/src/main/java/com/huanchengfly/tieba/post/activities/ForumActivity.kt index d610d76c..daf4d6cb 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/activities/ForumActivity.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/activities/ForumActivity.kt @@ -365,6 +365,11 @@ class ForumActivity : BaseActivity(), View.OnClickListener, OnRefreshedListener, addMaskAnimation(maskRadius = 50f.dpToPxFloat()) } }.init() + if (appPreferences.forumFabFunction == "hide") { + fab.visibility = View.GONE + } else { + fab.visibility = View.VISIBLE + } } override fun setTitle(newTitle: String?) { diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/forum/ForumPage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/forum/ForumPage.kt index ca0c8d70..12e994d9 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/forum/ForumPage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/forum/ForumPage.kt @@ -589,55 +589,57 @@ fun ForumPage( ) }, floatingActionButton = { - FloatingActionButton( - onClick = { - when (context.appPreferences.forumFabFunction) { - "refresh" -> { - coroutineScope.launch { - emitGlobalEventSuspend( - ForumThreadListUiEvent.BackToTop( - pagerState.currentPage == 1 - ) - ) - emitGlobalEventSuspend( - ForumThreadListUiEvent.Refresh( - pagerState.currentPage == 1, - getSortType( - context, - forumName + if (context.appPreferences.forumFabFunction != "hide") { + FloatingActionButton( + onClick = { + when (context.appPreferences.forumFabFunction) { + "refresh" -> { + coroutineScope.launch { + emitGlobalEventSuspend( + ForumThreadListUiEvent.BackToTop( + pagerState.currentPage == 1 ) ) - ) - } - } - - "back_to_top" -> { - coroutineScope.launch { - emitGlobalEvent( - ForumThreadListUiEvent.BackToTop( - pagerState.currentPage == 1 + emitGlobalEventSuspend( + ForumThreadListUiEvent.Refresh( + pagerState.currentPage == 1, + getSortType( + context, + forumName + ) + ) ) - ) + } + } + + "back_to_top" -> { + coroutineScope.launch { + emitGlobalEvent( + ForumThreadListUiEvent.BackToTop( + pagerState.currentPage == 1 + ) + ) + } + } + + else -> { + context.toastShort(R.string.toast_feature_unavailable) } } - - else -> { - context.toastShort(R.string.toast_feature_unavailable) - } - } - }, - backgroundColor = ExtendedTheme.colors.windowBackground, - contentColor = ExtendedTheme.colors.primary, - modifier = Modifier.navigationBarsPadding() - ) { - Icon( - imageVector = when (context.appPreferences.forumFabFunction) { - "refresh" -> Icons.Rounded.Refresh - "back_to_top" -> Icons.Rounded.VerticalAlignTop - else -> Icons.Rounded.Add }, - contentDescription = null - ) + backgroundColor = ExtendedTheme.colors.windowBackground, + contentColor = ExtendedTheme.colors.primary, + modifier = Modifier.navigationBarsPadding() + ) { + Icon( + imageVector = when (context.appPreferences.forumFabFunction) { + "refresh" -> Icons.Rounded.Refresh + "back_to_top" -> Icons.Rounded.VerticalAlignTop + else -> Icons.Rounded.Add + }, + contentDescription = null + ) + } } } ) { contentPadding -> diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/settings/habit/HabitSettingsPage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/settings/habit/HabitSettingsPage.kt index 7c64d36b..e3d92abb 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/settings/habit/HabitSettingsPage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/settings/habit/HabitSettingsPage.kt @@ -168,7 +168,8 @@ fun HabitSettingsPage( entries = mapOf( "post" to stringResource(id = R.string.btn_post), "refresh" to stringResource(id = R.string.btn_refresh), - "back_to_top" to stringResource(id = R.string.btn_back_to_top) + "back_to_top" to stringResource(id = R.string.btn_back_to_top), + "hide" to stringResource(id = R.string.btn_hide) ) ) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b8039eb7..165e5ffc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -737,4 +737,5 @@ 全面屏优化 略微抬起贴子页面底栏以方便点按 打开 + 隐藏