Hey there :wave: (using V2) I am trying to open a...
# compose-destinations
t
Hey there 👋 (using V2) I am trying to open a composable/screen from an app with a bottom nav bar. Unfortunately I can't manage to open it on top of the whole screen including the bottom bar (bottom bar should not be visible anymore). Let's say I have "ScreenB" as the destination for one bottom nav item. In "ScreenB" I see the content + the bottom bar. "ScreenB" contains a button which should open another screen "ScreenC". On "ScreenC" I should not see the bottom bar. Currently I am using the
DestinationsNavigator
to navigate to "ScreenC". Doing this inside the composable of "ScreenB". Something like
navController.navigate(DeviceRegistrationScreenDestination)
. The bottom bar is still shown on "ScreenC" which is obvious to me. Now the question is: Is it possible to launch a screen on top of the bottom bar without a callback to the first NavHost that contains the bottom bar?
r
@Thomas Richtsfeld you can put BottomBar as part of ScreenB or you can make the "NavHost" or "Scaffold" composable adapt to which screen is being shown and hide the bottom bar for some. There should be also a way to do it with shared element transitions. This is an old question with lots of different ways to solve it, each has its own pros and cons depending on what exactly you want to achive. It is not a Compose Destinations specific question, so I would do a little google search or ask on a broader navigation channel. Any solution for official navigation would also work here, maybe with minimal changes (hopefully improvements 🙂 )
t
Yep, thanks. I figured out that it is a general issue that we all have. Without hiding/showing the bottom bar it is not possible when the same NavHost is used for all nav destinations.
i
We've also talked about this topic twice in this very channel, both with the same answer (use one NavHost). Here's the link to the last conversation, which links to the one before that: https://kotlinlang.slack.com/archives/C06CS4UCQ10/p1721330435911589?thread_ts=1721330435.911589&cid=C06CS4UCQ10
🙌 1