compose-navigation icon indicating copy to clipboard operation
compose-navigation copied to clipboard

Backstack like Instagram/Youtube

Open handiwiguna opened this issue 4 years ago • 4 comments

Just like instagram/youtube, does this navigation library support below functionality?

  1. Multiple backstack
  2. Remove duplicate item in root backstack (bottom navigation)

Thank you.

handiwiguna avatar Mar 30 '21 09:03 handiwiguna

  1. It does support multiple backstacks. There is a sample. One thing that it does not do is restore sub-backstack once you return to it. So if you have bottom tabs. Navigate in first tab, then switch to another tab and go back to first tab, history there will be lost and you will be on first screen of that tab. You can run sample app to see how it's working

mvarnagiris avatar Mar 30 '21 10:03 mvarnagiris

I don't understand your second question though

mvarnagiris avatar Mar 30 '21 10:03 mvarnagiris

Basically my intention is to have a multiple sub backstack like Youtube bottom navigation.

For example: Home (1st tab Bottom Nav) > Explore (2nd tab Bottom Nav) > Trending > Library (3rd tab Bottom Nav) > History > Explore (2nd tab Bottom Nav) > Library (3rd tab Bottom Nav)

Then if click Explore (2nd tab Bottom Nav) again, it will show Trending screen , when i click back button: it will show Explore (2nd tab Bottom Nav) > History > Library (3rd tab Bottom Nav) > Home

Regarding to question number 2, on above example, the Explore & History stack only appear once though I click many times.

handiwiguna avatar Mar 30 '21 11:03 handiwiguna

So I think at the moment that is not possible because when you switch tabs - backstack from previous tab is cleared

mvarnagiris avatar Apr 07 '21 18:04 mvarnagiris