How will navigation work in Jetpack compose (since...
# compose
j
How will navigation work in Jetpack compose (since Navigation Components currently seems to be based on Fragments)?
a
The navigation component is based on pluggable Navigators and the fragment navigator is just one implementation
Further API tuning on both compose and the navigation arch component will likely happen as well, or if you want to make minimal changes and have it work today you can make a compose fragment and use it from all of the existing fragment-based navigation stuff
😍 3
j
Awesome info, thanks Adam!
a
a
navigateTo
is basically the shape of the navigation arch component API, or were you referring to something else?
a
My entire app navigation is built with
navigateTo
. I use it the same way I use
NavigationLink
in SwiftUI. Wondering if it is going to change or go away ???
a
It's just a function provided by the JetNews sample app code in that link, it won't go away from app code unless you want it to πŸ™‚
l
Note: if you want to swipe a scrappy version of a compose navigator for the AAC navigation, i put up a gist here: https://gist.github.com/lelandrichardson/5b70430ea383600eb0dba5a62172148c
πŸ‘ 1
πŸ‘€ 1
πŸ™πŸ½ 2
a
The hope is ... as soon as Compose is in beta, our app is in the Google Play Store πŸŽ‰ We expect this to be hard πŸ˜‚
k
I was unable to get this scrappy version to work on dev03. It gave me this warning message and failed to compile: Functions which invoke @Composable functions must be marked with the @Composable annotation.
a
I had to sign out to see the code πŸ˜„