Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I use bottom navigation in precompose? #291

Open
thanhhoai162963 opened this issue Mar 26, 2024 · 5 comments
Open

Can I use bottom navigation in precompose? #291

thanhhoai162963 opened this issue Mar 26, 2024 · 5 comments

Comments

@thanhhoai162963
Copy link

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.

@Tlaster
Copy link
Owner

Tlaster commented Mar 26, 2024

Yes you can!

@thanhhoai162963
Copy link
Author

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

@Tlaster
Copy link
Owner

Tlaster commented Mar 26, 2024

There's a Navigator.currentEntry that you can use as a replacement for currentBackStackEntryAsState

@thanhhoai162963
Copy link
Author

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
)
)

@Tlaster
Copy link
Owner

Tlaster commented Mar 26, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants