simple-stack-compose-integration icon indicating copy to clipboard operation
simple-stack-compose-integration copied to clipboard

[Question] How to deal with BottomNavigation in compose?

Open ydhnwb opened this issue 7 months ago • 3 comments

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?

ydhnwb avatar Nov 12 '23 21:11 ydhnwb

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

Zhuinden avatar Nov 12 '23 22:11 Zhuinden

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

ydhnwb avatar Nov 17 '23 18:11 ydhnwb

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...

Zhuinden avatar Nov 23 '23 13:11 Zhuinden