mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-07-01 22:00:41 +02:00
Merge pull request #6 from KotlinGeekDev/fix-navigation-issues
Fix navigation.
This commit is contained in:
@ -47,10 +47,24 @@ fun AppBottomBar(navController: NavHostController) {
|
|||||||
selected = currentRoute == item.route,
|
selected = currentRoute == item.route,
|
||||||
onClick = {
|
onClick = {
|
||||||
if (currentRoute != item.route) {
|
if (currentRoute != item.route) {
|
||||||
navController.navigate(item.route)
|
navController.navigate(item.route){
|
||||||
|
navController.graph.startDestinationRoute?.let { start ->
|
||||||
|
popUpTo(start)
|
||||||
|
restoreState = true
|
||||||
|
}
|
||||||
|
launchSingleTop = true
|
||||||
|
restoreState = true
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: Make it scrool to the top
|
// TODO: Make it scrool to the top
|
||||||
navController.navigate(item.route)
|
navController.navigate(item.route){
|
||||||
|
navController.graph.startDestinationRoute?.let { start ->
|
||||||
|
popUpTo(start)
|
||||||
|
restoreState = true
|
||||||
|
}
|
||||||
|
launchSingleTop = true
|
||||||
|
restoreState = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user