Component - Bottom navigation bar
A bottom navigation bar lets users switch between main sections of an app quickly. It stays fixed at the bottom of the screen and shows icons and labels for each section.
A bottom navigation bar lets users switch between main sections of an app quickly. It stays fixed at the bottom of the screen and shows icons and labels for each section.
BottomNavigationView ├─ MenuItem (Home) ├─ MenuItem (Search) ├─ MenuItem (Profile)
BottomNavigationView in an Android app?BottomNavigationView in Kotlin?setOnItemSelectedListener.bottomNav.setOnItemSelectedListener { item ->
when(item.itemId) {
R.id.home -> { showHome(); true }
R.id.search -> { showSearch(); true }
else -> false
}
}
What happens when the user taps the "search" item?bottomNav.setOnItemSelectedListener { item ->
when(item.itemId) {
R.id.home -> showHome()
R.id.profile -> showProfile()
}
}Pass the test and this pattern moves unknown