From 8e7c235ff0c3406526971eefd437bc6b0a9a5d05 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 15 May 2021 15:03:09 -0400 Subject: [PATCH] Cleanup hide updates/history button settings --- .../tachiyomi/data/preference/PreferenceKeys.kt | 5 ++--- .../tachiyomi/data/preference/PreferencesHelper.kt | 5 ++--- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 6 ++---- .../ui/setting/SettingsGeneralController.kt | 12 ++++++------ app/src/main/res/values/strings.xml | 2 -- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt index 6fad83404d..0bc039ea6f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt @@ -15,9 +15,8 @@ object PreferenceKeys { const val hideBottomBar = "pref_hide_bottom_bar_on_scroll" - const val hideUpdatesButton = "pref_hide_updates_button" - - const val hideHistoryButton = "pref_hide_history_button" + const val showNavUpdates = "pref_nav_show_updates" + const val showNavHistory = "pref_nav_show_history" const val enableTransitions = "pref_enable_transitions_key" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt index db157250c0..a68c1ceacf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt @@ -65,9 +65,8 @@ class PreferencesHelper(val context: Context) { fun hideBottomBar() = flowPrefs.getBoolean(Keys.hideBottomBar, true) - fun hideUpdatesButton() = flowPrefs.getBoolean(Keys.hideUpdatesButton, true) - - fun hideHistoryButton() = flowPrefs.getBoolean(Keys.hideHistoryButton, true) + fun showNavUpdates() = prefs.getBoolean(Keys.showNavUpdates, true) + fun showNavHistory() = prefs.getBoolean(Keys.showNavHistory, true) fun useBiometricLock() = flowPrefs.getBoolean(Keys.useBiometricLock, false) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 5c3be4bf5f..cfc19ffb3c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -487,10 +487,8 @@ class MainActivity : BaseViewBindingActivity() { } private fun updateNavMenu(menu: Menu) { - val navUpdates = menu.findItem(R.id.nav_updates) - navUpdates.isVisible = !preferences.hideUpdatesButton().get() - val navHistory = menu.findItem(R.id.nav_history) - navHistory.isVisible = !preferences.hideHistoryButton().get() + menu.findItem(R.id.nav_updates).isVisible = preferences.showNavUpdates() + menu.findItem(R.id.nav_history).isVisible = preferences.showNavHistory() } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt index e814f5caca..1b34784cf7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt @@ -271,14 +271,14 @@ class SettingsGeneralController : SettingsController() { defaultValue = true } switchPreference { - key = Keys.hideUpdatesButton - titleRes = R.string.pref_hide_updates_button - defaultValue = false + key = Keys.showNavUpdates + titleRes = R.string.label_recent_updates + defaultValue = true } switchPreference { - key = Keys.hideHistoryButton - titleRes = R.string.pref_hide_history_button - defaultValue = false + key = Keys.showNavHistory + titleRes = R.string.label_recent_manga + defaultValue = true } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ee8f0f1cbc..f08077b8f6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -167,8 +167,6 @@ Date format Confirm exit Hide bottom bar on scroll - Hide Updates button - Hide History button Manage notifications Security