pull/298/head
gedoor 4 years ago
parent c86267deb4
commit 6542a02c22
  1. 12
      app/src/main/java/io/legado/app/help/storage/Restore.kt
  2. 2
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.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)

@ -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)

Loading…
Cancel
Save