When dealing with certain navigation flows with Na...
# compose-android
b
When dealing with certain navigation flows with Navigation3, does it make sense to just have really complicated SceneStrategies with different pane types, or is there a current pattern for doing like "Nested Navigation" somewhat like "Nested graphs" in Jetpack Navigation? Is it as simple as having an entryProvider that is another NavDisplay that has its own SceneStrategy?
To me the nested NavDisplay seems more similar to having two navControllers which I've always tried to avoid having multiple NavHosts and navControllers in Jetpack Navigation personally.
i
What are you trying to do
b
Well currently I'm just using a single NavDisplay that's nested inside my existing navigation architecture and doing BottomSheet navigation only within it. so I'm wrapping it in an if statement to show the NavDisplay similar to how you'd wrap the ModalBottomSheet in an if statement as well. I was just thinking in the future when I migrate other stuff over to Nav3 if it made sense to try and use the same SceneStrategy I have and just build on it to support the other screens, or to just leave the NavDisplay where it is basically and then just work on migrating the layers outside of it over.
Technically right now it's inside of the same column as my HorizontalPager and I have an extra item {} that's separate from the list I pass to the HorizontalPager for showing the NavDisplay, but that's just temporary until I know where I'm actually putting this user flow.
I'm guessing it would be fine to leave it as a nested NavDisplay but then once the main parent was also a NavDisplay it could make sense to try and merge them into a single NavDisplay and build out a SceneStrategy that supports both flows. (the flow leading up to the NavDisplay and the NavDisplay itself)
or would it make sense to wrap everything in a NavDisplay for right now, and then have a single behemoth entryProvider with all the older stuff + separate entryProviders for the new stuff? 🤔
i.e. having the Jetpack Navigation/ Ramcosta Compose Destinations stuff inside of an EntryProvider..
i
You might take a look at the Migration guide in the nav3-recipes repository, which tries to tackle some of these same issues: https://github.com/android/nav3-recipes/blob/main/docs/MigratingFromNavigation2.md
There's a lot of ways of doing it (and a lot of different starting points), so migration guides should always be more of a source of inspiration than a prescriptive list of steps that apply to everyone equally