diff --git a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt index d758c147c..6a1673403 100644 --- a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt @@ -28,7 +28,7 @@ import io.legado.app.utils.* class ThemeConfigFragment : BasePreferenceFragment(), SharedPreferences.OnSharedPreferenceChangeListener { - val items = arrayListOf("极简", "曜夜", "经典", "黑白", "A屏黑") + val items = App.INSTANCE.resources.getStringArray(R.array.default_themes).toList() override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { addPreferencesFromResource(R.xml.pref_config_theme) @@ -41,7 +41,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), findPreference(PreferKey.cBackground)?.let { it.onSaveColor = { color -> if (!ColorUtils.isColorLight(color)) { - toast("白天背景不能太暗") + toast(R.string.day_background_too_dark) true } else { false @@ -51,7 +51,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), findPreference(PreferKey.cBBackground)?.let { it.onSaveColor = { color -> if (!ColorUtils.isColorLight(color)) { - toast("白天底栏不能太暗") + toast(R.string.day_bottom_bar_too_dark) true } else { false @@ -61,7 +61,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), findPreference(PreferKey.cNBackground)?.let { it.onSaveColor = { color -> if (ColorUtils.isColorLight(color)) { - toast("夜间背景不能太亮") + toast(R.string.night_background_too_light) true } else { false @@ -71,7 +71,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), findPreference(PreferKey.cNBBackground)?.let { it.onSaveColor = { color -> if (ColorUtils.isColorLight(color)) { - toast("夜间底栏不能太亮") + toast(R.string.night_bottom_bar_too_light) true } else { false @@ -85,11 +85,11 @@ class ThemeConfigFragment : BasePreferenceFragment(), val textColor = getCompatColor(R.color.tv_text_default) when { ColorUtils.getColorDifference(color, background) <= 60 -> { - toast("强调色不能和背景颜色相似") + toast(R.string.accent_background_diff) true } ColorUtils.getColorDifference(color, textColor) <= 60 -> { - toast("强调色不能和文字颜色相似") + toast(R.string.accent_text_diff) true } else -> false @@ -103,11 +103,11 @@ class ThemeConfigFragment : BasePreferenceFragment(), val textColor = getCompatColor(R.color.tv_text_default) when { ColorUtils.getColorDifference(color, background) <= 60 -> { - toast("强调色不能和背景颜色相似") + toast(R.string.accent_background_diff) true } ColorUtils.getColorDifference(color, textColor) <= 60 -> { - toast("强调色不能和文字颜色相似") + toast(R.string.accent_text_diff) true } else -> false @@ -191,7 +191,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), } private fun changeTheme() { - alert(title = "切换默认主题") { + alert(title = getString(R.string.select_theme)) { items(items) { _, which -> when (which) { 0 -> { diff --git a/app/src/main/res/values-zh-rHK/arrays.xml b/app/src/main/res/values-zh-rHK/arrays.xml index 315f18e35..f3a1dc0f7 100644 --- a/app/src/main/res/values-zh-rHK/arrays.xml +++ b/app/src/main/res/values-zh-rHK/arrays.xml @@ -55,4 +55,13 @@ 粗體 細體 + + + 极简 + 曜夜 + 经典 + 黑白 + A屏黑 + + \ No newline at end of file diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 1a9cd53fc..92c60043d 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -732,4 +732,11 @@ 默认启用替换净化 新加入书架的书是否启用替换净化 选择恢复文件 + 切换默认主题 + 白天背景不能太暗 + 白天底栏不能太暗 + 夜间背景不能太亮 + 夜间底栏不能太亮 + 强调色不能和背景颜色相似 + 强调色不能和文字颜色相似 diff --git a/app/src/main/res/values-zh-rTW/arrays.xml b/app/src/main/res/values-zh-rTW/arrays.xml index 5d4e2aaeb..add52f533 100644 --- a/app/src/main/res/values-zh-rTW/arrays.xml +++ b/app/src/main/res/values-zh-rTW/arrays.xml @@ -112,4 +112,13 @@ 粗體 細體 + + + 极简 + 曜夜 + 经典 + 黑白 + A屏黑 + + diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 700d90727..9152d604e 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -732,5 +732,12 @@ 默认启用替换净化 新加入书架的书是否启用替换净化 选择恢复文件 + 切换默认主题 + 白天背景不能太暗 + 白天底栏不能太暗 + 夜间背景不能太亮 + 夜间底栏不能太亮 + 强调色不能和背景颜色相似 + 强调色不能和文字颜色相似 diff --git a/app/src/main/res/values-zh/arrays.xml b/app/src/main/res/values-zh/arrays.xml index 5b580aeb3..04138f7c2 100644 --- a/app/src/main/res/values-zh/arrays.xml +++ b/app/src/main/res/values-zh/arrays.xml @@ -113,4 +113,12 @@ 细体 + + 极简 + 曜夜 + 经典 + 黑白 + A屏黑 + + \ No newline at end of file diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 3e168a76d..a3d7e28ff 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -732,4 +732,11 @@ 默认启用替换净化 新加入书架的书是否启用替换净化 选择恢复文件 + 切换默认主题 + 白天背景不能太暗 + 白天底栏不能太暗 + 夜间背景不能太亮 + 夜间底栏不能太亮 + 强调色不能和背景颜色相似 + 强调色不能和文字颜色相似 diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index f9abf310a..6910aa52e 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -1,116 +1,124 @@ - - - @string/book_type_text - @string/book_type_audio - - - - du Xiao Mei - du Xiao Yu - du Xiao Yao - du Ya Ya - du Xiao Jiao - du Mi Duo - du Bo Wen - du Xiao Tong - du Xiao Meng - baidu SaoNan - baidu PingShu - baidu ZhuChi - - - - @string/indent_0 - @string/indent_1 - @string/indent_2 - @string/indent_3 - @string/indent_4 - - - - .txt - .json - .xml - - - - @string/jf_convert_o - @string/jf_convert_j - @string/jf_convert_f - - - - Follow system - Bright mode - Dark mode - E-Ink mode - - - - Auto - Black - White - Following - - - - Default - 1 min - 2 min - 3 min - Always - - - - @string/default_path - @string/sys_folder_picker - @string/app_folder_picker - - - - @string/screen_unspecified - @string/screen_portrait - @string/screen_landscape - @string/screen_sensor - - - - iconMain - icon1 - icon2 - icon3 - icon4 - icon5 - icon6 - - - - Off - Traditional to Simplified - Simplified to Traditional - - - - Default font - Serif font - Monospaced font - - - - Blank - Heading - Time - Battery - Pages - Progress - Pages and progress - - - - Normal - Bold - Light - - - \ No newline at end of file + + + @string/book_type_text + @string/book_type_audio + + + + du Xiao Mei + du Xiao Yu + du Xiao Yao + du Ya Ya + du Xiao Jiao + du Mi Duo + du Bo Wen + du Xiao Tong + du Xiao Meng + baidu SaoNan + baidu PingShu + baidu ZhuChi + + + + @string/indent_0 + @string/indent_1 + @string/indent_2 + @string/indent_3 + @string/indent_4 + + + + .txt + .json + .xml + + + + @string/jf_convert_o + @string/jf_convert_j + @string/jf_convert_f + + + + Follow system + Bright mode + Dark mode + E-Ink mode + + + + Auto + Black + White + Following + + + + Default + 1 min + 2 min + 3 min + Always + + + + @string/default_path + @string/sys_folder_picker + @string/app_folder_picker + + + + @string/screen_unspecified + @string/screen_portrait + @string/screen_landscape + @string/screen_sensor + + + + iconMain + icon1 + icon2 + icon3 + icon4 + icon5 + icon6 + + + + Off + Traditional to Simplified + Simplified to Traditional + + + + Default font + Serif font + Monospaced font + + + + Blank + Heading + Time + Battery + Pages + Progress + Pages and progress + + + + Normal + Bold + Light + + + + 极简 + 曜夜 + 经典 + 黑白 + A屏黑 + + + \ 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 669ccb904..4ee8a7719 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -733,5 +733,12 @@ 默认启用替换净化 新加入书架的书是否启用替换净化 选择恢复文件 + 切换默认主题 + 白天背景不能太暗 + 白天底栏不能太暗 + 夜间背景不能太亮 + 夜间底栏不能太亮 + 强调色不能和背景颜色相似 + 强调色不能和文字颜色相似 \ No newline at end of file