优化导航栏非沉浸是颜色深一些

pull/540/head
gedoor 4 years ago
parent d873208c72
commit 045bbd7c42
  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.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<VB : ViewBinding>(
}
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() {

@ -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))

@ -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 {

Loading…
Cancel
Save