Zhuinden / simple-stack

[ACTIVE] Simple Stack, a backstack library / navigation framework for simpler navigation and state management (for fragments, views, or whatevers).
Apache License 2.0
1.36k stars 75 forks source link

Multiple stacks in each viewpager fragment #252

Closed omkar-tenkale closed 2 years ago

omkar-tenkale commented 2 years ago

Aim is to emulate the instagram like functionallity

a viewpaer with bottom bar - 5 tabs

each viewpager fragment is a container and has its own simple-stack navigator

So at any time states can be

A-B | B-C | C-A-B-A-C | D-A-B | E-F

Each viewpager page has its own stack and user can switch between them with bottombar easily no stack will be reset after switching

Instagram navigation works similarly

Can simple-stack help me achieve this?

Zhuinden commented 2 years ago

Hey hey, it's a bit tricky, but yes, refer to the multi-stack example below

https://github.com/Zhuinden/simple-stack/tree/df0308469080613888a695c3b66a8373e54e3f45/samples/multistack-samples/simple-stack-example-multistack-nested-fragment/src/main/java/com/zhuinden/simplestackbottomnavfragmentexample

It is also explained in this article: https://zhuinden.medium.com/creating-a-bottomnavigation-multi-stack-using-child-fragments-with-simple-stack-c73c1ca3bbd4

omkar-tenkale commented 2 years ago

Sure thanks! Very userful lib btw, i use in all my projects gives structure to navigation