From 7a52ea78b9cfe8a601b3d8c04f89ecd7a4f83a23 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 26 Jun 2020 10:36:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/config/ThemeConfigFragment.kt | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt index d15fac81b..81fc16204 100644 --- a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt @@ -77,17 +77,17 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), when (key) { PreferKey.launcherIcon -> LauncherIconHelp.changeIcon(getPrefString(key)) "transparentStatusBar" -> recreateActivities() - "colorPrimary", - "colorAccent", - "colorBackground", - "colorBottomBackground" -> { + PreferKey.cPrimary, + PreferKey.cAccent, + PreferKey.cBackground, + PreferKey.cBBackground -> { if (backgroundIsDark(sharedPreferences)) { alert { title = "白天背景太暗" message = "将会恢复默认背景?" yesButton { putPrefInt( - "colorBackground", + PreferKey.cBackground, getCompatColor(R.color.md_grey_100) ) upTheme(false) @@ -101,17 +101,17 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), upTheme(false) } } - "colorPrimaryNight", - "colorAccentNight", - "colorBackgroundNight", - "colorBottomBackgroundNight" -> { + PreferKey.cNPrimary, + PreferKey.cNAccent, + PreferKey.cNBackground, + PreferKey.cNBBackground -> { if (backgroundIsLight(sharedPreferences)) { alert { title = "夜间背景太亮" message = "将会恢复默认背景?" yesButton { putPrefInt( - "colorBackgroundNight", + PreferKey.cNBackground, getCompatColor(R.color.md_grey_800) ) upTheme(true) @@ -200,7 +200,7 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), private fun backgroundIsDark(sharedPreferences: SharedPreferences): Boolean { return !ColorUtils.isColorLight( sharedPreferences.getInt( - "colorBackground", + PreferKey.cBackground, getCompatColor(R.color.md_grey_100) ) ) @@ -209,7 +209,7 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), private fun backgroundIsLight(sharedPreferences: SharedPreferences): Boolean { return ColorUtils.isColorLight( sharedPreferences.getInt( - "colorBackgroundNight", + PreferKey.cNBackground, getCompatColor(R.color.md_grey_800) ) )