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

pull/540/head
gedoor 4 years ago
parent c01a68e46d
commit b81ef8a0c2
  1. 2
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  2. 1
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  3. 8
      app/src/main/java/io/legado/app/help/AppConfig.kt
  4. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt
  5. 1
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  6. 4
      app/src/main/res/values-zh-rHK/strings.xml
  7. 4
      app/src/main/res/values-zh-rTW/strings.xml
  8. 4
      app/src/main/res/values-zh/strings.xml
  9. 4
      app/src/main/res/values/strings.xml
  10. 6
      app/src/main/res/xml/pref_config_theme.xml

@ -167,7 +167,7 @@ abstract class BaseActivity<VB : ViewBinding>(
}
open fun upNavigationBarColor() {
if (AppConfig.isTransparentStatusBar) {
if (AppConfig.immNavigationBar) {
ATH.setNavigationBarColorAuto(this, ThemeStore.navigationBarColor(this))
} else {
val nbColor = ColorUtils.darkenColor(ThemeStore.navigationBarColor(this))

@ -55,6 +55,7 @@ object PreferKey {
const val autoReadSpeed = "autoReadSpeed"
const val barElevation = "barElevation"
const val transparentStatusBar = "transparentStatusBar"
const val immNavigationBar = "immNavigationBar"
const val defaultCover = "defaultCover"
const val replaceEnableDefault = "replaceEnableDefault"
const val showBrightnessView = "showBrightnessView"

@ -73,11 +73,11 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
}
}
var isTransparentStatusBar: Boolean
val isTransparentStatusBar: Boolean
get() = context.getPrefBoolean(PreferKey.transparentStatusBar)
set(value) {
context.putPrefBoolean(PreferKey.transparentStatusBar, value)
}
val immNavigationBar: Boolean
get() = context.getPrefBoolean(PreferKey.immNavigationBar)
val screenDirection: String?
get() = context.getPrefString(PreferKey.screenDirection)

@ -145,7 +145,7 @@ abstract class ReadBookBaseActivity :
when {
binding.readMenu.isVisible -> super.upNavigationBarColor()
bottomDialog > 0 -> super.upNavigationBarColor()
else -> if (AppConfig.isTransparentStatusBar) {
else -> if (AppConfig.immNavigationBar) {
ATH.setNavigationBarColorAuto(this, Color.TRANSPARENT)
} else {
ATH.setNavigationBarColorAuto(this, Color.parseColor("#20000000"))

@ -133,6 +133,7 @@ class ThemeConfigFragment : BasePreferenceFragment(),
when (key) {
PreferKey.launcherIcon -> LauncherIconHelp.changeIcon(getPrefString(key))
PreferKey.transparentStatusBar -> recreateActivities()
PreferKey.immNavigationBar -> recreateActivities()
PreferKey.cPrimary,
PreferKey.cAccent,
PreferKey.cBackground,

@ -361,8 +361,8 @@
<string name="finish_book">完結書籍</string>
<string name="local_book">本地書籍</string>
<string name="status_bar_immersion">狀態欄顏色透明</string>
<string name="navigation_bar_color_change">導航欄變色</string>
<string name="navigation_bar_color_change_s">導航欄根據夜間模式變化</string>
<string name="imm_navigation_bar">沉浸式导航栏</string>
<string name="imm_navigation_bar_s">导航栏颜色透明</string>
<string name="add_to_shelf">放入書架</string>
<string name="continue_read">繼續閲讀</string>
<string name="cover_path">封面地址</string>

@ -362,8 +362,8 @@
<string name="finish_book">完結書籍</string>
<string name="local_book">本機書籍</string>
<string name="status_bar_immersion">狀態欄顏色透明</string>
<string name="navigation_bar_color_change">導航欄變色</string>
<string name="navigation_bar_color_change_s">導航欄根據夜間模式變化</string>
<string name="imm_navigation_bar">沉浸式导航栏</string>
<string name="imm_navigation_bar_s">导航栏颜色透明</string>
<string name="add_to_shelf">放入書架</string>
<string name="continue_read">繼續閱讀</string>
<string name="cover_path">封面地址</string>

@ -364,8 +364,8 @@
<string name="finish_book">完结书籍</string>
<string name="local_book">本地书籍</string>
<string name="status_bar_immersion">状态栏颜色透明</string>
<string name="navigation_bar_color_change">导航栏变色</string>
<string name="navigation_bar_color_change_s">导航栏根据夜间模式变化</string>
<string name="imm_navigation_bar">沉浸式导航栏</string>
<string name="imm_navigation_bar_s">导航栏颜色透明</string>
<string name="add_to_shelf">放入书架</string>
<string name="continue_read">继续阅读</string>
<string name="cover_path">封面地址</string>

@ -365,8 +365,8 @@
<string name="finish_book">Finished books</string>
<string name="local_book">Local books</string>
<string name="status_bar_immersion">The status bar color becomes transparent</string>
<string name="navigation_bar_color_change">Discolored navigation bar</string>
<string name="navigation_bar_color_change_s">The navigation bar changes color following the dark mode</string>
<string name="imm_navigation_bar">immersion navigation bar</string>
<string name="imm_navigation_bar_s">The navigation bar becomes transparent</string>
<string name="add_to_shelf">Add to Bookshelf</string>
<string name="continue_read">Continue reading</string>
<string name="cover_path">Cover path</string>

@ -21,9 +21,9 @@
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false"
android:key="navigationBarColorChange"
android:summary="@string/navigation_bar_color_change_s"
android:title="@string/navigation_bar_color_change"
android:key="immNavigationBar"
android:summary="@string/imm_navigation_bar_s"
android:title="@string/imm_navigation_bar"
app:iconSpaceReserved="false" />
<io.legado.app.ui.widget.prefs.Preference

Loading…
Cancel
Save