feat: 适配NavigationBar

pull/248/head
gedoor 5 years ago
parent db7fc03ef9
commit 701ed7cece
  1. 2
      app/src/main/java/io/legado/app/App.kt
  2. 1
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  3. 5
      app/src/main/java/io/legado/app/lib/theme/ThemeStore.kt

@ -71,6 +71,7 @@ class App : Application() {
fun applyTheme() {
if (AppConfig.isNightTheme) {
ThemeStore.editTheme(this)
.coloredNavigationBar(true)
.primaryColor(
getPrefInt(PreferKey.cNPrimary, getCompatColor(R.color.md_blue_grey_600))
).accentColor(
@ -82,6 +83,7 @@ class App : Application() {
).apply()
} else {
ThemeStore.editTheme(this)
.coloredNavigationBar(true)
.primaryColor(
getPrefInt(PreferKey.cPrimary, getCompatColor(R.color.md_indigo_800))
).accentColor(

@ -107,6 +107,7 @@ abstract class BaseActivity(
} else if (theme == Theme.Light) {
ATH.setLightStatusBar(this, true)
}
ATH.setNavigationBarColorAuto(this)
}
open fun observeLiveBus() {

@ -237,7 +237,10 @@ private constructor(private val mContext: Context) : ThemeStoreInterface {
fun navigationBarColor(context: Context): Int {
return if (!coloredNavigationBar(context)) {
Color.BLACK
} else prefs(context).getInt(ThemeStorePrefKeys.KEY_NAVIGATION_BAR_COLOR, primaryColor(context))
} else prefs(context).getInt(
ThemeStorePrefKeys.KEY_NAVIGATION_BAR_COLOR,
bottomBackground(context)
)
}
@CheckResult

Loading…
Cancel
Save