Skip to content

Instantly share code, notes, and snippets.

@Farhandroid
Created March 1, 2022 12:18
Show Gist options
  • Save Farhandroid/a910ae9bb401cbf4140b73de12fc1fb0 to your computer and use it in GitHub Desktop.
Save Farhandroid/a910ae9bb401cbf4140b73de12fc1fb0 to your computer and use it in GitHub Desktop.
CustomBottomNavigation
@Composable
fun CustomBottomNavigation(navController: NavHostController) {
val items = listOf(
BottomNavigationItem.Home,
BottomNavigationItem.Mail,
BottomNavigationItem.Person
)
BottomNavigation(
contentColor = Color.White
) {
val navBackStackEntry by navController.currentBackStackEntryAsState()
val currentRoute = navBackStackEntry?.destination
items.forEach { item ->
currentRoute?.let {
BottomItem(
screen = item,
currentDestination = it,
navController = navController
)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment