Last active
March 1, 2022 12:13
-
-
Save Farhandroid/3436734fce56c38bb780b1405b9f1992 to your computer and use it in GitHub Desktop.
BottomItem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun RowScope.BottomItem( | |
screen: BottomNavigationItem, | |
currentDestination: NavDestination?, | |
navController: NavHostController, | |
) { | |
//RowScope.BottomNavigationItem | |
BottomNavigationItem( | |
icon = { Icon(painterResource(id = screen.icon), contentDescription = screen.title) }, | |
selected = currentDestination?.hierarchy?.any { | |
it.route == screen.screen_route | |
} == true, | |
unselectedContentColor = LocalContentColor.current.copy(alpha = ContentAlpha.disabled), | |
onClick = { | |
navController.navigate(screen.screen_route) | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment