Adding navigation
Scaffold()
allows you to put content in a slot at the bottom of the screen using its bottomBar
parameter. This can, for example, be a BottomAppBar()
. Material Design bottom app bars provide access to a bottom navigation drawer and up to four actions, including a floating action button. ComposeUnitConverter
adds BottomNavigation()
instead. Material Design bottom navigation bars allow movement between primary destinations in an app.
Defining screens
Conceptually, primary destinations are screens, something that, before Jetpack Compose, may have been displayed in separate activities. Here's how screens are defined in ComposeUnitConverter
:
sealed class ComposeUnitConverterScreen( val route: String, @StringRes val label: Int, @DrawableRes val icon: Int ) { companion object { val screens = listOf( Temperature, Distances...