mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-26 21:46:30 +02:00
Fix navigation.
This commit is contained in:
committed by
KotlinGeek
parent
41b82ec749
commit
e78c7aba85
@@ -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