It seems to me that being able to use compose navigation without having nested nav hosts and nav controllers you will end up having to build a handle every edge case type setup, but not just for bottom nav, also the toolbar, drawer, fab setups.
Or not sharing a scaffold and you pay the performance hit of a full recomp for every navigation event.
right now I am leaning toward building some way to nest navHosts and navControllers but hopefully in a form that allows me to retain deep linking without a headache.
trevjones
02/23/2022, 6:09 PM
ok that convo thread matches where I was heading in terms of trying to keep the nav details isolated.
Just need to figure out the right way to avoid full recomps all over the place while getting some good separation in.
That kind of approach makes it more of a specific contract between your global UI and individual destinations on what should be displayed that still uses the NavController as the source of truth. Of course, that could be 'don't show a topbar at all on this particular screen, I'll take care of it myself'
t
trevjones
02/23/2022, 6:18 PM
yeah that is the approach I was playing with last week. built a sort of "NavGraphLocal" by using view models scoped to the different backstack entry's that would search up the tree similar to the ViewTree*Owner pattern.
But getting the consumption pattern of it clean was where I stopped myself to make sure I wasn't going too far off the rails.
This is good help though, appreciate you digging these up