From 71d0b7ceb28ea74fb3922becf234afb92a697fad Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 30 Aug 2019 22:04:40 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/ReadBookConfig.kt | 8 ++++++++ .../legado/app/ui/readbook/config/BgTextConfigDialog.kt | 6 ++++-- 2 files changed, 12 insertions(+), 2 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 9a480d5cd..196a88c36 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -139,6 +139,14 @@ object ReadBookConfig { } } + fun statusIconDark(): Boolean { + return if (App.INSTANCE.isNightTheme) { + darkStatusIconNight + } else { + darkStatusIcon + } + } + fun textColor(): Int { return if (App.INSTANCE.isNightTheme) Color.parseColor(textColorNight) else Color.parseColor(textColor) diff --git a/app/src/main/java/io/legado/app/ui/readbook/config/BgTextConfigDialog.kt b/app/src/main/java/io/legado/app/ui/readbook/config/BgTextConfigDialog.kt index a1a29eeb5..d1ee637d4 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/config/BgTextConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/config/BgTextConfigDialog.kt @@ -8,7 +8,9 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.DialogFragment import io.legado.app.R +import io.legado.app.help.ReadBookConfig import io.legado.app.ui.readbook.Help +import kotlinx.android.synthetic.main.dialog_read_bg_text.* class BgTextConfigDialog : DialogFragment() { @@ -41,7 +43,7 @@ class BgTextConfigDialog : DialogFragment() { initData() } - private fun initData() { - + private fun initData() = with(ReadBookConfig.getConfig()) { + sw_dark_status_icon.isChecked = statusIconDark() } } \ No newline at end of file