From 6f0e1965b654454e7d60aa3b4553c5352024df9d Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 29 Apr 2020 17:34:44 -0400 Subject: [PATCH] More settings organization --- .../ui/setting/SettingsBrowseController.kt | 34 ++++++++++++------- app/src/main/res/values/strings.xml | 4 +-- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBrowseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBrowseController.kt index a6f78c9157..ab4d0bd7b4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBrowseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsBrowseController.kt @@ -6,6 +6,7 @@ import eu.kanade.tachiyomi.data.preference.PreferenceKeys as Keys import eu.kanade.tachiyomi.extension.ExtensionUpdateJob import eu.kanade.tachiyomi.util.preference.defaultValue import eu.kanade.tachiyomi.util.preference.onChange +import eu.kanade.tachiyomi.util.preference.preferenceCategory import eu.kanade.tachiyomi.util.preference.switchPreference import eu.kanade.tachiyomi.util.preference.titleRes @@ -14,21 +15,30 @@ class SettingsBrowseController : SettingsController() { override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) { titleRes = R.string.browse - switchPreference { - key = Keys.automaticExtUpdates - titleRes = R.string.pref_enable_automatic_extension_updates - defaultValue = true + preferenceCategory { + titleRes = R.string.label_extensions - onChange { newValue -> - val checked = newValue as Boolean - ExtensionUpdateJob.setupTask(activity!!, checked) - true + switchPreference { + key = Keys.automaticExtUpdates + titleRes = R.string.pref_enable_automatic_extension_updates + defaultValue = true + + onChange { newValue -> + val checked = newValue as Boolean + ExtensionUpdateJob.setupTask(activity!!, checked) + true + } } } - switchPreference { - key = Keys.searchPinnedSourcesOnly - titleRes = R.string.pref_search_pinned_sources_only - defaultValue = false + + preferenceCategory { + titleRes = R.string.action_global_search + + switchPreference { + key = Keys.searchPinnedSourcesOnly + titleRes = R.string.pref_search_pinned_sources_only + defaultValue = false + } } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 063a061768..d283b188a9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -160,7 +160,7 @@ Display - Library manga per row + Items per row Portrait Landscape Default @@ -305,7 +305,7 @@ Check for extension updates - Only include pinned sources in global search + Only include pinned sources Backup