Zhuinden / simple-stack-compose-integration

[ACTIVE/BETA] Compose integration for Simple-Stack.
Apache License 2.0
103 stars 9 forks source link

[Question] How to deal with BottomNavigation in compose? #31

Open ydhnwb opened 10 months ago

ydhnwb commented 10 months ago

I'm currently practicing with the ftue sample as reference. Already create unauthenticated navugation, but I want my authenticated first page contains BottomNavigation (compose), which every of the tab contains its own stack (like youtube or instagram).

How to achieve that? Is the nested-navigation sample can be user for that?

Zhuinden commented 10 months ago

Hello, that is correct, you would create a BackstackHost to have a stack per each bottom nav tab, like in nested navigation example.

ydhnwb commented 10 months ago

I'm running out ideas to make it work with 4 bottomNav item and have history when navigate between 4 of them. Example bottomNav: HOME, EXPLORE, WHISHLIST, PROFILE.

How to keep history when user navigate: HOME -> EXPLORE -> WHISLIST -> PROFILE, after user press back, it will goes backwards like from PROFILE back to WHISLIST back to EXPLORE back to HOME and then Exit the app?

Do you have example for this?

I'm using Fragment with Compose based on ftue example and bottomBar inside Scaffold. Here the code if you want to take a look

Zhuinden commented 10 months ago

I haven't had any time to make an example, even though technically your request is totally viable.

In our projects, this is why I still use fragments instead, but I do know it has become "uncool" to do so these days. So I haven't had the time and don't have an example ready at this moment. I really hope at some point I'll reclaim some of my time, though...