diff --git a/app/src/main/java/io/legado/app/base/BaseActivity.kt b/app/src/main/java/io/legado/app/base/BaseActivity.kt index 05539ad26..94bd38a64 100644 --- a/app/src/main/java/io/legado/app/base/BaseActivity.kt +++ b/app/src/main/java/io/legado/app/base/BaseActivity.kt @@ -15,7 +15,9 @@ import io.legado.app.App import io.legado.app.R import io.legado.app.constant.AppConst import io.legado.app.constant.Theme +import io.legado.app.help.AppConfig import io.legado.app.lib.theme.ATH +import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.backgroundColor import io.legado.app.lib.theme.primaryColor import io.legado.app.ui.widget.TitleBar @@ -165,7 +167,12 @@ abstract class BaseActivity( } open fun upNavigationBarColor() { - ATH.setNavigationBarColorAuto(this) + if (AppConfig.isTransparentStatusBar) { + ATH.setNavigationBarColorAuto(this, ThemeStore.navigationBarColor(this)) + } else { + val nbColor = ColorUtils.darkenColor(ThemeStore.navigationBarColor(this)) + ATH.setNavigationBarColorAuto(this, nbColor) + } } open fun observeLiveBus() { diff --git a/app/src/main/java/io/legado/app/lib/theme/ATH.kt b/app/src/main/java/io/legado/app/lib/theme/ATH.kt index 40e6b819f..f5274d09a 100644 --- a/app/src/main/java/io/legado/app/lib/theme/ATH.kt +++ b/app/src/main/java/io/legado/app/lib/theme/ATH.kt @@ -123,7 +123,7 @@ object ATH { fun setNavigationBarColorAuto( activity: Activity, - color: Int = ThemeStore.navigationBarColor(activity) + color: Int, ) { activity.window.navigationBarColor = color setLightNavigationBar(activity, ColorUtils.isColorLight(color)) 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 eb7fcb90b..250a0ff38 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 @@ -24,7 +24,6 @@ import io.legado.app.lib.dialogs.selector import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.backgroundColor -import io.legado.app.lib.theme.bottomBackground import io.legado.app.service.help.CacheBook import io.legado.app.service.help.ReadBook import io.legado.app.ui.book.read.config.BgTextConfigDialog @@ -144,8 +143,8 @@ abstract class ReadBookBaseActivity : override fun upNavigationBarColor() { when { - binding.readMenu.isVisible -> ATH.setNavigationBarColorAuto(this) - bottomDialog > 0 -> ATH.setNavigationBarColorAuto(this, bottomBackground) + binding.readMenu.isVisible -> super.upNavigationBarColor() + bottomDialog > 0 -> super.upNavigationBarColor() else -> if (AppConfig.isTransparentStatusBar) { ATH.setNavigationBarColorAuto(this, Color.TRANSPARENT) } else {