From 6431e8232759ca05b2f546d10026a4bade2b3304 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 29 Sep 2021 10:54:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=85=E8=AF=BB=E7=95=8C=E9=9D=A2=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=A0=8F=E4=B8=8D=E5=86=8D=E9=80=8F=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/book/read/ReadBookBaseActivity.kt | 5 ++++- .../main/java/io/legado/app/ui/book/read/ReadMenu.kt | 11 +++++++++++ app/src/main/res/layout/view_read_menu.xml | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt index a2ca85009..82e5e4cfd 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt @@ -122,7 +122,10 @@ abstract class ReadBookBaseActivity : flag = flag or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN } if (ReadBookConfig.hideNavigationBar) { - flag = flag or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + 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) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt index 91d5f643e..b1008dd96 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt @@ -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() } diff --git a/app/src/main/res/layout/view_read_menu.xml b/app/src/main/res/layout/view_read_menu.xml index 1e3d59440..e41cd22fd 100644 --- a/app/src/main/res/layout/view_read_menu.xml +++ b/app/src/main/res/layout/view_read_menu.xml @@ -470,6 +470,12 @@ + + \ No newline at end of file