AppBottomBar

mail@pastecode.io avatar
unknown
kotlin
a month ago
735 B
7
Indexable
Never
@Composable
fun AppBottomBar(navController: NavController) {
    val bottomScreens = remember {
        listOf(
            BottomBarScreen.Main,
            BottomBarScreen.Forecast
        )
    }


    NavigationBar {
        bottomScreens.forEach { screen ->
            NavigationBarItem(
                selected = screen == navController.currentDestination, // Что тут сделать то?)
                onClick = { navController.navigate(screen) },
                icon = {
                    Icon(
                        painter = painterResource(id = screen.iconId),
                        contentDescription = null
                    )
                }
            )
        }
    }
}
Leave a Comment