From 7f1add2b31493bf8002938b7ec94e6426cc2f5bd Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 9 Mar 2020 21:29:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/AppConfig.kt | 3 +++ .../java/io/legado/app/ui/config/OtherConfigFragment.kt | 7 +++++++ app/src/main/res/values/arrays.xml | 2 +- app/src/main/res/values/pref_key_value.xml | 2 +- app/src/main/res/xml/pref_config_other.xml | 8 ++++++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/AppConfig.kt b/app/src/main/java/io/legado/app/help/AppConfig.kt index 9d6f87d61..4b768b9e7 100644 --- a/app/src/main/java/io/legado/app/help/AppConfig.kt +++ b/app/src/main/java/io/legado/app/help/AppConfig.kt @@ -32,6 +32,9 @@ object AppConfig { App.INSTANCE.putPrefBoolean("transparentStatusBar", value) } + val requestedDirection: String? + get() = App.INSTANCE.getPrefString(R.string.pk_requested_direction) + var backupPath: String? get() = App.INSTANCE.getPrefString(PreferKey.backupPath) set(value) { diff --git a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt index a010428fd..c6633461a 100644 --- a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt @@ -43,6 +43,10 @@ class OtherConfigFragment : PreferenceFragmentCompat(), upPreferenceSummary(getString(R.string.pk_download_path), BookHelp.downloadPath) upPreferenceSummary(PreferKey.threadCount, AppConfig.threadCount.toString()) upPreferenceSummary(PreferKey.webPort, webPort.toString()) + upPreferenceSummary( + getString(R.string.pk_requested_direction), + AppConfig.requestedDirection + ) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -103,6 +107,9 @@ class OtherConfigFragment : PreferenceFragmentCompat(), setProcessTextEnable(it.getBoolean(key, true)) } PreferKey.showRss -> postEvent(EventBus.SHOW_RSS, "unused") + getString(R.string.pk_requested_direction) -> { + upPreferenceSummary(key, AppConfig.requestedDirection) + } } } diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 104febad6..a53546e7f 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -67,7 +67,7 @@ @string/app_folder_picker - + @string/screen_unspecified @string/screen_portrait @string/screen_landscape diff --git a/app/src/main/res/values/pref_key_value.xml b/app/src/main/res/values/pref_key_value.xml index 7bcded4da..0c535ad67 100644 --- a/app/src/main/res/values/pref_key_value.xml +++ b/app/src/main/res/values/pref_key_value.xml @@ -1,7 +1,7 @@ auto_refresh - list_screen_direction + list_screen_direction full_screen threads_num user_agent diff --git a/app/src/main/res/xml/pref_config_other.xml b/app/src/main/res/xml/pref_config_other.xml index b049bcf22..bc241370e 100644 --- a/app/src/main/res/xml/pref_config_other.xml +++ b/app/src/main/res/xml/pref_config_other.xml @@ -6,6 +6,14 @@ android:title="@string/main_activity" app:iconSpaceReserved="false"> + +