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