pull/737/head
Robot 4 years ago
commit e3e8b88f59
  1. 9
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  2. 2
      app/src/main/java/io/legado/app/lib/theme/ATH.kt
  3. 5
      app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt

@ -15,7 +15,9 @@ import io.legado.app.App
import io.legado.app.R import io.legado.app.R
import io.legado.app.constant.AppConst import io.legado.app.constant.AppConst
import io.legado.app.constant.Theme 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.ATH
import io.legado.app.lib.theme.ThemeStore
import io.legado.app.lib.theme.backgroundColor import io.legado.app.lib.theme.backgroundColor
import io.legado.app.lib.theme.primaryColor import io.legado.app.lib.theme.primaryColor
import io.legado.app.ui.widget.TitleBar import io.legado.app.ui.widget.TitleBar
@ -165,7 +167,12 @@ abstract class BaseActivity<VB : ViewBinding>(
} }
open fun upNavigationBarColor() { 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() { open fun observeLiveBus() {

@ -123,7 +123,7 @@ object ATH {
fun setNavigationBarColorAuto( fun setNavigationBarColorAuto(
activity: Activity, activity: Activity,
color: Int = ThemeStore.navigationBarColor(activity) color: Int,
) { ) {
activity.window.navigationBarColor = color activity.window.navigationBarColor = color
setLightNavigationBar(activity, ColorUtils.isColorLight(color)) setLightNavigationBar(activity, ColorUtils.isColorLight(color))

@ -24,7 +24,6 @@ import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import io.legado.app.lib.theme.backgroundColor 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.CacheBook
import io.legado.app.service.help.ReadBook import io.legado.app.service.help.ReadBook
import io.legado.app.ui.book.read.config.BgTextConfigDialog import io.legado.app.ui.book.read.config.BgTextConfigDialog
@ -144,8 +143,8 @@ abstract class ReadBookBaseActivity :
override fun upNavigationBarColor() { override fun upNavigationBarColor() {
when { when {
binding.readMenu.isVisible -> ATH.setNavigationBarColorAuto(this) binding.readMenu.isVisible -> super.upNavigationBarColor()
bottomDialog > 0 -> ATH.setNavigationBarColorAuto(this, bottomBackground) bottomDialog > 0 -> super.upNavigationBarColor()
else -> if (AppConfig.isTransparentStatusBar) { else -> if (AppConfig.isTransparentStatusBar) {
ATH.setNavigationBarColorAuto(this, Color.TRANSPARENT) ATH.setNavigationBarColorAuto(this, Color.TRANSPARENT)
} else { } else {

Loading…
Cancel
Save