Revert hide updates/history

This commit is contained in:
arkon 2021-05-17 17:24:53 -04:00
parent cf4b870846
commit 3b11ad8de8
5 changed files with 5 additions and 35 deletions

View File

@ -15,9 +15,6 @@ object PreferenceKeys {
const val hideBottomBar = "pref_hide_bottom_bar_on_scroll" 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 enableTransitions = "pref_enable_transitions_key"
const val doubleTapAnimationSpeed = "pref_double_tap_anim_speed" const val doubleTapAnimationSpeed = "pref_double_tap_anim_speed"

View File

@ -65,9 +65,6 @@ class PreferencesHelper(val context: Context) {
fun hideBottomBar() = flowPrefs.getBoolean(Keys.hideBottomBar, true) 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 useBiometricLock() = flowPrefs.getBoolean(Keys.useBiometricLock, false)
fun lockAppAfter() = flowPrefs.getInt(Keys.lockAppAfter, 0) fun lockAppAfter() = flowPrefs.getInt(Keys.lockAppAfter, 0)

View File

@ -5,7 +5,6 @@ import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.Menu
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.Toast import android.widget.Toast
@ -466,7 +465,6 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
if (visible) { if (visible) {
if (collapse) { if (collapse) {
bottomNavAnimator?.expand() bottomNavAnimator?.expand()
updateNavMenu(it.menu)
} }
bottomViewNavigationBehavior?.slideUp(it) bottomViewNavigationBehavior?.slideUp(it)
} else { } else {
@ -482,15 +480,9 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
private fun showSideNav(visible: Boolean) { private fun showSideNav(visible: Boolean) {
binding.sideNav?.let { binding.sideNav?.let {
it.isVisible = visible 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 * Used to manually offset a view within the activity's child views that might be cut off due to
* the collapsing AppBarLayout. * the collapsing AppBarLayout.

View File

@ -45,6 +45,11 @@ class SettingsGeneralController : SettingsController() {
titleRes = R.string.pref_confirm_exit titleRes = R.string.pref_confirm_exit
defaultValue = false 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) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
preference { preference {
@ -261,25 +266,5 @@ class SettingsGeneralController : SettingsController() {
summary = "%s" 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
}
}
} }
} }

View File

@ -149,7 +149,6 @@
<!-- General section --> <!-- General section -->
<string name="pref_category_theme">Theme</string> <string name="pref_category_theme">Theme</string>
<string name="pref_category_locale">Locale</string> <string name="pref_category_locale">Locale</string>
<string name="pref_category_navigation">Navigation</string>
<string name="pref_theme_mode">Dark mode</string> <string name="pref_theme_mode">Dark mode</string>
<string name="theme_system">Follow system</string> <string name="theme_system">Follow system</string>
<string name="theme_light">Off</string> <string name="theme_light">Off</string>