material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.24k stars 3.05k forks source link

[BottomNavigationView] BottomNavigationView can have only one setOnNavigationItemSelectedListener #735

Open AndrewBloom opened 4 years ago

AndrewBloom commented 4 years ago

FEATURE REQUEST

As per title, BottomNavigationView can have only one setOnNavigationItemSelectedListener. This is annoying because if i use the bottomNavigationView.setupWithNavController(navController) this internally sets that listener, and i cannot use it anymore for anything else (like setting the text in a custom appBar, for example) A list of listeners would be the right thing in my opinion.

Ps. this probably applies to setOnNavigationItemReselectedListener(BottomNavigationView.OnNavigationItemReselectedListener listener) too.

For Pattern reference, see NavController addOnDestinationChangedListener and removeOnDestinationChangedListener

kikasik commented 4 years ago

Yes! It will be very useful

UMFsimke commented 2 years ago

@drchen is this something that is still on the roadmap? I would love to implement this as my first PR if possible

imhappi commented 2 years ago

@UMFsimke feel free!