I am attempting to update from using XML based Bot...
# navigation-architecture-component
t
I am attempting to update from using XML based BottomNavigationView to a Compose NavigationView/NavHost, and I use XML navigation graphs extensively. Most of my current Fragments use findNavController().navigate etc. How do I construct a NavHost/NavController on the Compose side (I am trying NavigationSuiteScaffold) and then pass it down to the AndroidFragment wrapped Fragments? Thank you!
a
We use an event bus that handles these navigation events. We have fragments call events on it, and when compose navigation is enabled, the wrapper fragment that hosts the navhost composable reacts to the events by shuffling it onto the nav controller
It does require each call site change the implementation, but I think it’s good practice not to tie yourself to a specific navigation system APIs
t
Thank you for your input. I will likely use the MDC version of NavigationRail until I have time to refactor all the fragments. I have more than 10 complex graphs, and not the time to port them all to some Compose version.