diff --git a/app/src/main/java/io/legado/app/help/AppConfig.kt b/app/src/main/java/io/legado/app/help/AppConfig.kt index 2e336fdad..f2e34c3b6 100644 --- a/app/src/main/java/io/legado/app/help/AppConfig.kt +++ b/app/src/main/java/io/legado/app/help/AppConfig.kt @@ -121,6 +121,9 @@ object AppConfig { App.INSTANCE.putPrefInt("elevation", value) } + val readBodyToLh: Boolean get() = App.INSTANCE.getPrefBoolean("readBodyToLh", true) + + val isGooglePlay: Boolean get() = App.INSTANCE.channel == "google" } val Context.channel: String diff --git a/app/src/main/java/io/legado/app/ui/book/read/Help.kt b/app/src/main/java/io/legado/app/ui/book/read/Help.kt index f5144977e..8d87e89ed 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/Help.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/Help.kt @@ -112,7 +112,7 @@ object Help { * 适配刘海 */ fun upLayoutInDisplayCutoutMode(window: Window) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && AppConfig.readBodyToLh) { window.attributes = window.attributes.apply { layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 1cc006512..d87311f09 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -41,9 +41,6 @@ class ContentView(context: Context) : FrameLayout(context) { battery_view.typeface = ChapterProvider.typeface //显示状态栏时隐藏header if (hideStatusBar) { - ll_header.layoutParams = ll_header.layoutParams.apply { - height = context.statusBarHeight + headerPaddingTop.dp + headerPaddingBottom.dp - } ll_header.setPadding( headerPaddingLeft.dp, headerPaddingTop.dp, diff --git a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt index f3087f5e7..88bb95afe 100644 --- a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt @@ -13,7 +13,7 @@ import io.legado.app.R import io.legado.app.base.BaseFragment import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey -import io.legado.app.help.channel +import io.legado.app.help.AppConfig import io.legado.app.lib.theme.ATH import io.legado.app.service.WebService import io.legado.app.ui.about.AboutActivity @@ -85,7 +85,7 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. true } } - if (requireContext().channel == "google") { + if (AppConfig.isGooglePlay) { findPreference("aboutCategory") ?.removePreference(findPreference("donate")) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 32682ddf8..4afe3398e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -646,4 +646,5 @@ 点击授予权限 阅读需要访问存储卡权限,请点击下方的"授予权限"按钮,或前往“设置”—“应用权限”—打开所需权限。如果授予权限后仍然不正常,请点击右上角的“选择文件夹”,使用系统文件夹选择器。 全文朗读中不能朗读选中文字 + 扩展到刘海 diff --git a/app/src/main/res/xml/pref_config_read.xml b/app/src/main/res/xml/pref_config_read.xml index 6be6d1e50..6b55f0fcc 100644 --- a/app/src/main/res/xml/pref_config_read.xml +++ b/app/src/main/res/xml/pref_config_read.xml @@ -24,6 +24,12 @@ android:key="hideStatusBar" app:iconSpaceReserved="false" /> + +