onesector
onesector

Reputation: 444

How to disable UI refresh on multiple click on BottomNavigationView item android kotlin

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"?

Upvotes: 0

Views: 416

Answers (1)

Mieczkoni
Mieczkoni

Reputation: 544

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.

Upvotes: 1

Related Questions