feat: 优化

pull/254/head
gedoor 4 years ago
parent 4f63ee1cdc
commit fc47582ac9
  1. 1
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  2. 4
      app/src/main/java/io/legado/app/help/AppConfig.kt
  3. 2
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt

@ -46,6 +46,7 @@ object PreferKey {
const val textFullJustify = "textFullJustify" const val textFullJustify = "textFullJustify"
const val autoReadSpeed = "autoReadSpeed" const val autoReadSpeed = "autoReadSpeed"
const val barElevation = "barElevation" const val barElevation = "barElevation"
const val transparentStatusBar = "transparentStatusBar"
const val cPrimary = "colorPrimary" const val cPrimary = "colorPrimary"
const val cAccent = "colorAccent" const val cAccent = "colorAccent"

@ -32,9 +32,9 @@ object AppConfig {
get() = App.INSTANCE.getPrefString(PreferKey.themeMode) == "3" get() = App.INSTANCE.getPrefString(PreferKey.themeMode) == "3"
var isTransparentStatusBar: Boolean var isTransparentStatusBar: Boolean
get() = App.INSTANCE.getPrefBoolean("transparentStatusBar") get() = App.INSTANCE.getPrefBoolean(PreferKey.transparentStatusBar)
set(value) { set(value) {
App.INSTANCE.putPrefBoolean("transparentStatusBar", value) App.INSTANCE.putPrefBoolean(PreferKey.transparentStatusBar, value)
} }
val requestedDirection: String? val requestedDirection: String?

@ -76,7 +76,7 @@ class ThemeConfigFragment : PreferenceFragmentCompat(),
sharedPreferences ?: return sharedPreferences ?: return
when (key) { when (key) {
PreferKey.launcherIcon -> LauncherIconHelp.changeIcon(getPrefString(key)) PreferKey.launcherIcon -> LauncherIconHelp.changeIcon(getPrefString(key))
"transparentStatusBar" -> recreateActivities() PreferKey.transparentStatusBar -> recreateActivities()
PreferKey.cPrimary, PreferKey.cPrimary,
PreferKey.cAccent, PreferKey.cAccent,
PreferKey.cBackground, PreferKey.cBackground,

Loading…
Cancel
Save