Home > Software design >  How to disable UI refresh on multiple click on BottomNavigationView item android kotlin
How to disable UI refresh on multiple click on BottomNavigationView item android kotlin

Time:11-27

I've noticed that some apps use slightly different implementation when clicking on the BottomNavigationView menu item. By default, as I understand it, the user can click on the menu item many times in a row and then with each click the fragment will be updated

However, in some applications, clicking the same menu item multiple times will not update the fragment.

This raises the question of how to implement the second option so that when you repeatedly click on the same menu item, my fragment does not update and does not "blink"?

CodePudding user response:

You should just set the setOnNavigationItemReselectedListener on your BottomNavigationView and let it do nothing.

Or NavigationBarView.setOnItemReselectedListener since the on above is marked as deprecated.

  • Related