From df0b2e3ac38883da3a3fdfbd973a5255070484cb Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 27 Jan 2020 11:40:31 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/constant/PreferKey.kt | 1 + app/src/main/java/io/legado/app/help/PrefExtensions.kt | 5 ++++- app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/pref_config_theme.xml | 6 ++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/constant/PreferKey.kt b/app/src/main/java/io/legado/app/constant/PreferKey.kt index 80efd5925..1cb5e2edc 100644 --- a/app/src/main/java/io/legado/app/constant/PreferKey.kt +++ b/app/src/main/java/io/legado/app/constant/PreferKey.kt @@ -21,4 +21,5 @@ object PreferKey { const val backupPath = "backupUri" const val threadCount = "threadCount" const val keepLight = "keep_light" + const val autoDarkMode = "autoDarkMode" } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/PrefExtensions.kt b/app/src/main/java/io/legado/app/help/PrefExtensions.kt index 4b89939cc..4b8daf1e4 100644 --- a/app/src/main/java/io/legado/app/help/PrefExtensions.kt +++ b/app/src/main/java/io/legado/app/help/PrefExtensions.kt @@ -15,4 +15,7 @@ val Context.isShowRSS: Boolean get() = getPrefBoolean(PreferKey.showRss, true) val Context.threadCount: Int - get() = getPrefInt(PreferKey.threadCount, 16) \ No newline at end of file + get() = getPrefInt(PreferKey.threadCount, 16) + +val Context.autoDarkMode: Boolean + get() = getPrefBoolean(PreferKey.autoDarkMode, true) \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 12ceceb6d..1e352f8e4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -582,5 +582,7 @@ 文字太多,生成二维码失败 分享RSS源 分享书源 + 自动切换夜间模式 + 夜间模式跟随系统 diff --git a/app/src/main/res/xml/pref_config_theme.xml b/app/src/main/res/xml/pref_config_theme.xml index f9f3df963..853b2fb12 100644 --- a/app/src/main/res/xml/pref_config_theme.xml +++ b/app/src/main/res/xml/pref_config_theme.xml @@ -2,6 +2,12 @@ +