From 15804a4cf54a0a5503500d31fa2ea6e19b274c04 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 26 Aug 2019 09:47:28 +0800 Subject: [PATCH] up --- .../java/io/legado/app/help/ReadBookConfig.kt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index dad8c76d3..5fb46551d 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -4,10 +4,7 @@ import android.graphics.Color import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable import io.legado.app.App -import io.legado.app.utils.GSON -import io.legado.app.utils.fromJsonArray -import io.legado.app.utils.getPrefInt -import io.legado.app.utils.putPrefInt +import io.legado.app.utils.* import java.io.BufferedWriter import java.io.File import java.io.FileWriter @@ -24,8 +21,16 @@ object ReadBookConfig { } var styleSelect - get() = App.INSTANCE.getPrefInt("readStyleSelect") - set(value) = App.INSTANCE.putPrefInt("readStyleSelect", value) + get() = if (App.INSTANCE.isNightTheme) { + App.INSTANCE.getPrefInt("readStyleSelectNight", 4) + } else { + App.INSTANCE.getPrefInt("readStyleSelect") + } + set(value) = if (App.INSTANCE.isNightTheme) { + App.INSTANCE.putPrefInt("readStyleSelectNight", value) + } else { + App.INSTANCE.putPrefInt("readStyleSelect", value) + } var bg: Drawable? = null fun getConfig(index: Int = styleSelect): Config {