mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
Deselect all bottom nav items when home tab not among them
This commit is contained in:
parent
5b6b1a3dfa
commit
f29013427c
@ -131,6 +131,8 @@ class MainActivity : BaseActivity() {
|
||||
false
|
||||
}
|
||||
|
||||
if (binding.bottomNav.menu.children.none { it.itemId == startFragmentId }) deselectBottomBarItems()
|
||||
|
||||
binding.toolbar.title = ThemeHelper.getStyledAppName(this)
|
||||
|
||||
// handle error logs
|
||||
@ -179,6 +181,17 @@ class MainActivity : BaseActivity() {
|
||||
loadIntentData()
|
||||
}
|
||||
|
||||
/**
|
||||
* Deselect all bottom bar items
|
||||
*/
|
||||
fun deselectBottomBarItems() {
|
||||
binding.bottomNav.menu.setGroupCheckable(0, true, false)
|
||||
for (child in binding.bottomNav.menu.children) {
|
||||
child.isChecked = false
|
||||
}
|
||||
binding.bottomNav.menu.setGroupCheckable(0, true, true)
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to find a scroll or recycler view and scroll it back to the top
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user