From 6542a02c22b07bb0902626459fb1e2a8cbdb3f50 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 6 Aug 2020 21:54:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/help/storage/Restore.kt | 12 +++++++++--- .../io/legado/app/ui/config/OtherConfigFragment.kt | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/storage/Restore.kt b/app/src/main/java/io/legado/app/help/storage/Restore.kt index 389c1d570..7494bb453 100644 --- a/app/src/main/java/io/legado/app/help/storage/Restore.kt +++ b/app/src/main/java/io/legado/app/help/storage/Restore.kt @@ -37,14 +37,16 @@ object Restore { val ignoreKeys = arrayOf( "readConfig", PreferKey.themeMode, - PreferKey.bookshelfLayout + PreferKey.bookshelfLayout, + PreferKey.showRss ) //忽略标题 val ignoreTitle = arrayOf( App.INSTANCE.getString(R.string.read_config), App.INSTANCE.getString(R.string.theme_mode), - App.INSTANCE.getString(R.string.bookshelf_layout) + App.INSTANCE.getString(R.string.bookshelf_layout), + App.INSTANCE.getString(R.string.show_rss) ) //默认忽略keys @@ -179,7 +181,8 @@ object Restore { LauncherIconHelp.changeIcon(App.INSTANCE.getPrefString(PreferKey.launcherIcon)) } App.INSTANCE.applyDayNight() - postEvent(EventBus.RECREATE, "true") + postEvent(EventBus.SHOW_RSS, "") + postEvent(EventBus.RECREATE, "") } } @@ -189,6 +192,7 @@ object Restore { readPrefKeys.contains(key) && ignoreReadConfig -> false PreferKey.themeMode == key && ignoreThemeMode -> false PreferKey.bookshelfLayout == key && ignoreBookshelfLayout -> false + PreferKey.showRss == key && ignoreShowRss -> false else -> true } } @@ -199,6 +203,8 @@ object Restore { get() = ignoreConfig[PreferKey.themeMode] == true private val ignoreBookshelfLayout: Boolean get() = ignoreConfig[PreferKey.bookshelfLayout] == true + private val ignoreShowRss: Boolean + get() = ignoreConfig[PreferKey.showRss] == true fun saveIgnoreConfig() { val json = GSON.toJson(ignoreConfig) 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 ec9942eba..0f8cfc8b6 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 @@ -109,7 +109,7 @@ class OtherConfigFragment : PreferenceFragmentCompat(), PreferKey.processText -> sharedPreferences?.let { setProcessTextEnable(it.getBoolean(key, true)) } - PreferKey.showRss -> postEvent(EventBus.SHOW_RSS, "unused") + PreferKey.showRss -> postEvent(EventBus.SHOW_RSS, "") PreferKey.defaultCover -> upPreferenceSummary( key, getPrefString(PreferKey.defaultCover)