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

@@ -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<MainActivityBinding>() {
if (visible) {
if (collapse) {
bottomNavAnimator?.expand()
updateNavMenu(it.menu)
}
bottomViewNavigationBehavior?.slideUp(it)
} else {
@@ -482,15 +480,9 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
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.

View File

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