Clinton Teegarden
1 min readApr 26, 2021

--

Nice post.

I have been playing around with this a lot, the idea of removing Fragments and using Composables really intrigues me.

I was doing this quite a bit with a Bottom Navigation Bar, which is largely the same as the drawer. However, one thing I cannot figure out is how to "reuse" back stack entries so that each time a tab is selected the whole composable isn't just brand new with no saved state. I noticed your code is largely doing the same that Google is suggesting of popping to start destination and adding single top in the nav builder. If you remove this, you will see that you can backwards navigate through your selections and the back stack resumes previously shown composables. However, I cannot seem to achieve this by just tapping between tabs and maybe wanting to pick up where I left off on Tab B after returning to it from Tab C or Tab A.

I was curious if you had tried anything similar? I have just come to the conclusion that maybe its just not there yet since this is still in alpha.

--

--

Clinton Teegarden
Clinton Teegarden

Written by Clinton Teegarden

Mobile Lead & Architect @ CapTech. I specialize in delivering products for Fortune 500 clients in Mobile, Services and end to end solutions.

Responses (2)