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 {