Can I use bottom navigation in precompose?
thanhhoai162963 opened this issue · comments
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Yes you can!
Do you have any tutorials on using bottom navigation in precompose? Is there some function I can't find? Thank you
example as :
val bottomNavController = rememberNavigator()
val navBackStackEntry by bottomNavController.currentBackStackEntryAsState() // not found.
val currentDestination = navBackStackEntry?.destination
There's a Navigator.currentEntry
that you can use as a replacement for currentBackStackEntryAsState
my code in jetpack compose:
bottomNavController.navigate(route) {this: navOptionsbuilder
popUpTo(bottomNavController.graph.findStartDestination().id) {this:PopUpToBuilder
saveState = true
}
restoreState = true
Can you help me convert these functions ? Thanks you
bottomNavController.navigate(
route, options = NavOptions(
launchSingleTop = true,
popUpTo = PopUpTo(....)// I don't know
)
)
There's a doc for popUpTo
: https://github.com/Tlaster/PreCompose/blob/master/docs/component/navigation.md#navoptions