https://kotlinlang.org logo
#compose
Title
# compose
a

Abhishek Dewan

10/04/2022, 10:52 PM
Hi folks. Had a question around compose navigation multiple back stacks. Working on a requirement where each of the 4 bottom navigation tabs has its own backstack. That can be easily achieved by using the multiple backstack feature in compose navigation. However a bug I’m noticing is that one of the tabs navigates to another, the bottom item associated with that tab isn’t selected anymore. This is because the current route of the navgraph isn’t any of the 4 tabs anymore and is something else. question: Does anyone have a good way of dealing with this? I know of a way which requires me going through the backqueue in navhostcontroller and figuring it out using that. It works mostly but seems hacky. Wanted to see if other folks have had to deal with that
i

Ian Lake

10/04/2022, 11:07 PM
It sounds like you want some different logic for what tab is selected, rather than using what graph your destination is in (e.g., just keeping track of what the last selected item was)? That's a fine thing to do
Here's the last conversation where we talked about that (and some of the downsides of moving to a separate source of truth too): https://kotlinlang.slack.com/archives/CJLTWPH7S/p1662850794861799?thread_ts=1662749511.994389&cid=CJLTWPH7S
a

André Kindwall

10/05/2022, 7:30 AM
2 Views