whats the best way to handle routing in compose, navigation component?
09/28/2020, 6:06 AM
You have "third party" lib (compose-router, compose-backstack, etc).
Compose flavor for Navigation Component is ongoing (there's some related commits in the lib repository on Gerrit)
That's if you want pure compose.
If you're using fragments for each screen , you can use Navigation Component - Fragment or whatever you were using
09/28/2020, 6:07 AM
oh I see , so Navigation component will be used in the future
09/28/2020, 6:10 AM
I would say available more than used 😛
Android team will push for it but other open source libraries could be better depending on the need 🤷
If you're just playing around, it might be "fun" to play around with an homemade solution.
Just write down you requirements for navigation (API, back press handling, saving current routing, etc) and write some code to handle it 🤷 .
It might not going to be production-worthy but at least you'll have learned some stuffs.
09/28/2020, 4:29 PM
I like to think of it similar to compose-material. If you want a Material app out of the box, that's easy to do. If you want to write your own design system that is completely different, the same fundamental building blocks Compose Material used are also available to you. Same with the Navigation Component integration: there's an out of the box solution and the building blocks to do your own thing as well
And just like compose-material, expect just about all of the samples, docs, etc. to be using the Navigation Component once it is available