-
Notifications
You must be signed in to change notification settings - Fork 136
[POS as a Tab] Analytics #14225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[POS as a Tab] Analytics #14225
Changes from 6 commits
d7a9a73
af7b4fa
5ad1dbd
4a29cd3
15c21a2
3a507d9
10aff47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ class MainBottomNavigationView @JvmOverloads constructor( | |
| private lateinit var moreMenuBadge: BadgeDrawable | ||
|
|
||
| interface MainNavigationListener { | ||
| fun onNavItemSelected(navPos: BottomNavigationPosition) | ||
| fun onNavItemSelected(navPos: BottomNavigationPosition): Boolean | ||
| fun onNavItemReselected(navPos: BottomNavigationPosition) | ||
| } | ||
|
|
||
|
|
@@ -135,11 +135,8 @@ class MainBottomNavigationView @JvmOverloads constructor( | |
|
|
||
| override fun onNavigationItemSelected(item: MenuItem): Boolean { | ||
| navController?.let { navController -> | ||
| val navSuccess = NavigationUI.onNavDestinationSelected(item, navController) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's necessary to call |
||
| if (navSuccess) { | ||
| listener.onNavItemSelected(findNavigationPositionById(item.itemId)) | ||
| return true | ||
| } | ||
| NavigationUI.onNavDestinationSelected(item, navController) | ||
| return listener.onNavItemSelected(findNavigationPositionById(item.itemId)) | ||
| } | ||
| return false | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The POS tab cannot be reselected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 I'd consider explicitly listing
POSinstead of relying onelse.If someone introduces a new BottomNavigationPosition, they might forget to update this
when, however, if thewhendoesn't haveelsestatement, the compiler will inform them about their mistake.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Done in 10aff47