mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 22:00:30 +05:30
Merge pull request #3773 from Bnyro/master
Deselect all bottom nav items when home tab not among them
This commit is contained in:
commit
4652b36a9a
@ -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