|
@@ -5,6 +5,7 @@ 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
|
|
@@ -465,8 +466,8 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
|
|
if (visible) {
|
|
|
if (collapse) {
|
|
|
bottomNavAnimator?.expand()
|
|
|
+ updateNavMenu(it.menu)
|
|
|
}
|
|
|
-
|
|
|
bottomViewNavigationBehavior?.slideUp(it)
|
|
|
} else {
|
|
|
if (collapse) {
|
|
@@ -481,9 +482,17 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
|
|
|
private fun showSideNav(visible: Boolean) {
|
|
|
binding.sideNav?.let {
|
|
|
it.isVisible = visible
|
|
|
+ updateNavMenu(it.menu)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Used to manually offset a view within the activity's child views that might be cut off due to
|
|
|
* the collapsing AppBarLayout.
|