pull/79/head
kunfei 5 years ago
parent c88b750360
commit df0b2e3ac3
  1. 1
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  2. 5
      app/src/main/java/io/legado/app/help/PrefExtensions.kt
  3. 2
      app/src/main/res/values/strings.xml
  4. 6
      app/src/main/res/xml/pref_config_theme.xml

@ -21,4 +21,5 @@ object PreferKey {
const val backupPath = "backupUri"
const val threadCount = "threadCount"
const val keepLight = "keep_light"
const val autoDarkMode = "autoDarkMode"
}

@ -15,4 +15,7 @@ val Context.isShowRSS: Boolean
get() = getPrefBoolean(PreferKey.showRss, true)
val Context.threadCount: Int
get() = getPrefInt(PreferKey.threadCount, 16)
get() = getPrefInt(PreferKey.threadCount, 16)
val Context.autoDarkMode: Boolean
get() = getPrefBoolean(PreferKey.autoDarkMode, true)

@ -582,5 +582,7 @@
<string name="text_too_long_qr_error">文字太多,生成二维码失败</string>
<string name="share_rss_source">分享RSS源</string>
<string name="share_book_source">分享书源</string>
<string name="auto_dark_mode">自动切换夜间模式</string>
<string name="auto_dark_mode_s">夜间模式跟随系统</string>
</resources>

@ -2,6 +2,12 @@
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="true"
android:key="autoDarkMode"
android:summary="@string/auto_dark_mode_s"
android:title="@string/auto_dark_mode"
app:iconSpaceReserved="false" />
<io.legado.app.lib.theme.prefs.ATESwitchPreference
android:defaultValue="true"

Loading…
Cancel
Save