https://kotlinlang.org logo
#compose
Title
# compose
а

Александр Макаров

03/04/2022, 10:05 AM
Hi, colleagues. Any idea how to make Nested NavHosts with different NavControllers? My current code snapshot causes doubling of navigation event while calling navController::navigateUp()
Futhermore, on Compose Navigation 2.5.0-alpha03 this causes a crash because of attaching to existing lifecycle
а

Александр Макаров

03/04/2022, 7:55 PM
As official docks recommend to hide\show bottom nav - it creates unintended glitch while it dissapears (especially with animation). That's not that good for UX, but that was my first approach before current decision. Multiple NavHosts was navigating as it expected, but navigatingUp creates a double event which causes a crash on 2.5.0-alpha03
If everybody had a good approach to single-activity case (e.g I want to open SettingsScreen composable, from MainScreen, which exist in parent navgraph) without bottomnav in nested navgraph destinations - that would be great
i

Ian Lake

03/08/2022, 4:12 AM
it creates unintended glitch while it dissapears (especially with animation)
You are in complete control over the animation so any glitch is more that you aren't using
AnimatedVisibility
or aren't observing the animation state to know when to start your animation
3 Views