I implement the bottom menu with three icons and, in order not to copy the code into 3 activations, I implemented a fragment, but the problem is to find out if the user has not clicked on an already open activation. That is, I need something like "getActivity! = OpenedActivity". How to implement it?
1 answer
To implement the bottom menu use BottomNavigationView
BottomNavigationView has two listeners:
BottomNavigationView.OnNavigationItemReselectedListenerBottomNavigationView.OnNavigationItemSelectedListener
In case you select an item from the bottom menu already selected, the first driver will work, otherwise the second listener.
|
BottomNavigationView, then you need one activation and several fragments that will be displayed by clicking in theBottomNavigationView. The connection between theΠ½ΠΈΠΆΠ½Π΅Π΅ ΠΌΠ΅Π½Ρ Ρ ΡΡΠ΅ΠΌΠΈ ΠΈΠΊΠΎΠ½ΠΊΠ°ΠΌΠΈand3 Π°ΠΊΡΠΈΠ²ΠΈΡΠΈincomprehensible. - post_zeew