https://kotlinlang.org logo
#compose
Title
# compose
l

Loránd

02/07/2020, 4:46 PM
Just curious, are there any recommendations on how navigation should be handled in a compose app?
z

Zsolt

02/07/2020, 6:23 PM
If by recommendation you mean official standpoint then I have no idea. If you're just looking for ideas in general how to achieve it, you can go the Navigation component way: https://gist.github.com/lelandrichardson/5b70430ea383600eb0dba5a62172148c , or you can switch on state as you can see in the Jetnews app. That way you can have a single-Activity Compose app and stay inside Compose for navigation. There's also https://github.com/zsoltk/compose-router that you can use to achieve the same with some additional power (back stack, back press handling, scoped bundles).
l

Loránd

02/08/2020, 1:05 PM
@Zsolt Thanks for the info, I will check out the jetnews app and learn from that example.
4 Views