阅读界面导航栏不再透明

pull/1352/head
gedoor 3 years ago
parent 7e5ca9c493
commit 6431e82327
  1. 3
      app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt
  2. 11
      app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
  3. 6
      app/src/main/res/layout/view_read_menu.xml

@ -122,8 +122,11 @@ abstract class ReadBookBaseActivity :
flag = flag or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
}
if (ReadBookConfig.hideNavigationBar) {
flag = flag or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
if (toolBarHide) {
flag = flag or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
}
}
if (toolBarHide) {
if (ReadBookConfig.hideStatusBar) {
flag = flag or View.SYSTEM_UI_FLAG_FULLSCREEN

@ -16,6 +16,7 @@ import io.legado.app.constant.PreferKey
import io.legado.app.databinding.ViewReadMenuBinding
import io.legado.app.help.AppConfig
import io.legado.app.help.LocalConfig
import io.legado.app.help.ReadBookConfig
import io.legado.app.help.ThemeConfig
import io.legado.app.lib.theme.*
import io.legado.app.model.ReadBook
@ -83,6 +84,7 @@ class ReadMenu @JvmOverloads constructor(
ivSetting.setColorFilter(textColor)
tvSetting.setTextColor(textColor)
vwBg.setOnClickListener(null)
vwNavigationBar.setOnClickListener(null)
llBrightness.setOnClickListener(null)
seekBrightness.post {
seekBrightness.progress = AppConfig.readBrightness
@ -254,6 +256,15 @@ class ReadMenu @JvmOverloads constructor(
override fun onAnimationEnd(animation: Animation) {
binding.vwMenuBg.setOnClickListener { runMenuOut() }
binding.vwNavigationBar.run {
layoutParams = layoutParams.apply {
height = if (ReadBookConfig.hideNavigationBar) {
activity?.navigationBarHeight ?: 0
} else {
0
}
}
}
if (!LocalConfig.readMenuHelpVersionIsLast) {
callBack.showReadMenuHelp()
}

@ -470,6 +470,12 @@
</LinearLayout>
</FrameLayout>
<View
android:id="@+id/vwNavigationBar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/background_menu" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save