From 3b11ad8de8fc060f9347a1ff371f8c892a134a31 Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 17 May 2021 17:24:53 -0400 Subject: [PATCH] Revert hide updates/history --- .../data/preference/PreferenceKeys.kt | 3 --- .../data/preference/PreferencesHelper.kt | 3 --- .../kanade/tachiyomi/ui/main/MainActivity.kt | 8 ------ .../ui/setting/SettingsGeneralController.kt | 25 ++++--------------- app/src/main/res/values/strings.xml | 1 - 5 files changed, 5 insertions(+), 35 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 292cd0b75..7b24759fd 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,6 @@ object PreferenceKeys { const val hideBottomBar = "pref_hide_bottom_bar_on_scroll" - const val showNavUpdates = "pref_nav_show_updates" - const val showNavHistory = "pref_nav_show_history" - const val enableTransitions = "pref_enable_transitions_key" const val doubleTapAnimationSpeed = "pref_double_tap_anim_speed" 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 62d167340..cdfc3516d 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,6 @@ class PreferencesHelper(val context: Context) { fun hideBottomBar() = flowPrefs.getBoolean(Keys.hideBottomBar, true) - fun showNavUpdates() = prefs.getBoolean(Keys.showNavUpdates, true) - fun showNavHistory() = prefs.getBoolean(Keys.showNavHistory, true) - fun useBiometricLock() = flowPrefs.getBoolean(Keys.useBiometricLock, false) fun lockAppAfter() = flowPrefs.getInt(Keys.lockAppAfter, 0) 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 cfc19ffb3..5063e1c31 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 @@ -5,7 +5,6 @@ import android.content.Intent import android.graphics.Color import android.os.Build import android.os.Bundle -import android.view.Menu import android.view.View import android.view.ViewGroup import android.widget.Toast @@ -466,7 +465,6 @@ class MainActivity : BaseViewBindingActivity() { if (visible) { if (collapse) { bottomNavAnimator?.expand() - updateNavMenu(it.menu) } bottomViewNavigationBehavior?.slideUp(it) } else { @@ -482,15 +480,9 @@ class MainActivity : BaseViewBindingActivity() { private fun showSideNav(visible: Boolean) { binding.sideNav?.let { it.isVisible = visible - updateNavMenu(it.menu) } } - private fun updateNavMenu(menu: Menu) { - menu.findItem(R.id.nav_updates).isVisible = preferences.showNavUpdates() - menu.findItem(R.id.nav_history).isVisible = preferences.showNavHistory() - } - /** * Used to manually offset a view within the activity's child views that might be cut off due to * the collapsing AppBarLayout. 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 1b34784cf..62e21c6d0 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 @@ -45,6 +45,11 @@ class SettingsGeneralController : SettingsController() { titleRes = R.string.pref_confirm_exit defaultValue = false } + switchPreference { + key = Keys.hideBottomBar + titleRes = R.string.pref_hide_bottom_bar_on_scroll + defaultValue = true + } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { preference { @@ -261,25 +266,5 @@ class SettingsGeneralController : SettingsController() { summary = "%s" } } - - preferenceCategory { - titleRes = R.string.pref_category_navigation - - switchPreference { - key = Keys.hideBottomBar - titleRes = R.string.pref_hide_bottom_bar_on_scroll - defaultValue = true - } - switchPreference { - key = Keys.showNavUpdates - titleRes = R.string.label_recent_updates - defaultValue = true - } - switchPreference { - 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 84791296a..79b25cd0b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -149,7 +149,6 @@ Theme Locale - Navigation Dark mode Follow system Off