Are there any good navigation-compose examples out...
# compose
c
Are there any good navigation-compose examples out there? There's documentation about each individual piece, but I'm finding there's a lot of nuance in how all of them are connected. Some concepts are only discussed with fragments architecture, which complicates things too. I'm finding many gotchas trying to combine bottom nav, type safety, deeplinks, and sign-in/out. I understand that's quite a bit to get all that working together, though I feel like most apps have the same requirements.
s
Yeah you're right about this, things can get quite involved and there aren't any clear examples out there that are doing all of this at the same time. I know I've linked it to you before, and I also understand that this is an entire app with 90% of the code not being interesting to you and your question here, but I hope it can be useful nonetheless. So, here https://github.com/HedvigInsurance/android we do these things out of what you asked: • We are doing single activity. • Have logged in and logged out scenarios • Have bottom tabs which are saving their backstack when moving between them • Support predictive back throughout the entire app. Including when leaving the app through the real start destination or when you're on the login destination • Use type-safe APIs • Use deep links support of androidx.navigation.compose and we use the default activity launch mode, which means we do
navigateUp
properly when deep linking to destinations which are inside subgraphs and in general everything you'd expect from Android deep linking. What we are not doing: • Logged in and logged out activities • Using any of the fragment stuff. We're just 100% compose everywhere. • Never managed to get saving the logged in backstack when logging out and then logging in again, in order to end up in the same spot the moment you logged out. Filed i/334413738 but unfortunately they haven't had the time to look more into it I think.