pull/32/head
kunfei 5 years ago
parent b840b800da
commit b59da2fa81
  1. 18
      app/src/main/java/io/legado/app/App.kt
  2. 4
      app/src/main/res/values-night/colors.xml
  3. 6
      app/src/main/res/values/colors.xml
  4. 8
      app/src/main/res/xml/pref_config_theme.xml

@ -68,14 +68,24 @@ class App : Application() {
fun applyTheme() {
if (isNightTheme) {
ThemeStore.editTheme(this)
.primaryColor(getPrefInt("colorPrimaryNight", getCompatColor(R.color.colorPrimary)))
.accentColor(getPrefInt("colorAccentNight", getCompatColor(R.color.colorAccent)))
.primaryColor(
getPrefInt(
"colorPrimaryNight",
getCompatColor(R.color.md_blue_grey_600)
)
)
.accentColor(
getPrefInt(
"colorAccentNight",
getCompatColor(R.color.md_deep_orange_800)
)
)
.backgroundColor(getPrefInt("colorBackgroundNight", getCompatColor(R.color.md_grey_800)))
.apply()
} else {
ThemeStore.editTheme(this)
.primaryColor(getPrefInt("colorPrimary", getCompatColor(R.color.colorPrimary)))
.accentColor(getPrefInt("colorAccent", getCompatColor(R.color.colorAccent)))
.primaryColor(getPrefInt("colorPrimary", getCompatColor(R.color.md_light_blue_500)))
.accentColor(getPrefInt("colorAccent", getCompatColor(R.color.md_pink_800)))
.backgroundColor(getPrefInt("colorBackground", getCompatColor(R.color.md_grey_100)))
.apply()
}

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">@color/md_blue_grey_600</color>
<color name="colorPrimaryDark">@color/md_blue_grey_700</color>
<color name="colorAccent">@color/md_deep_orange_800</color>
<color name="background">@color/md_grey_800</color>
<color name="background_card">#353535</color>
<color name="background_menu">#282828</color>

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">@color/md_light_blue_500</color>
<color name="colorPrimaryDark">@color/md_light_blue_600</color>
<color name="colorAccent">@color/md_pink_A400</color>
<color name="colorPrimary">@color/md_light_blue_600</color>
<color name="colorPrimaryDark">@color/md_light_blue_700</color>
<color name="colorAccent">@color/md_pink_800</color>
<color name="divider">#66666666</color>
<color name="error">#eb4333</color>

@ -34,7 +34,7 @@
app:iconSpaceReserved="false">
<io.legado.app.lib.theme.prefs.ATEColorPreference
android:defaultValue="@color/colorPrimary"
android:defaultValue="@color/md_light_blue_600"
android:key="colorPrimary"
android:summary="白天,主色调"
android:title="主色调"
@ -42,7 +42,7 @@
app:iconSpaceReserved="false" />
<io.legado.app.lib.theme.prefs.ATEColorPreference
android:defaultValue="@color/colorAccent"
android:defaultValue="@color/md_pink_800"
android:key="colorAccent"
android:summary="白天,强调色"
android:title="强调色"
@ -64,7 +64,7 @@
app:iconSpaceReserved="false">
<io.legado.app.lib.theme.prefs.ATEColorPreference
android:defaultValue="@color/colorPrimary"
android:defaultValue="@color/md_blue_grey_600"
android:key="colorPrimaryNight"
android:summary="夜间,主色调"
android:title="主色调"
@ -72,7 +72,7 @@
app:iconSpaceReserved="false" />
<io.legado.app.lib.theme.prefs.ATEColorPreference
android:defaultValue="@color/colorAccent"
android:defaultValue="@color/md_deep_orange_800"
android:key="colorAccentNight"
android:summary="夜间,强调色"
android:title="强调色"

Loading…
Cancel
Save