material-components / material-components/material-components-android
[BottomNavigationView] BottomNavigationView can have only one setOnNavigationItemSelectedListener
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading BottomNavigationView's setOnNavigationItemSelectedListener and setOnNavigationItemReselectedListener APIs, then compare their behavior with NavController's addOnDestinationChangedListener and removeOnDestinationChangedListener pattern. Done should allow the navigation setup and another consumer to receive the relevant callbacks without breaking existing listener behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100