adrielcafe / voyager

🛸 A pragmatic navigation library for Jetpack Compose
https://voyager.adriel.cafe
MIT License
2.27k stars 109 forks source link

Screen as popup or transparent packground #404

Open Hightower87 opened 2 weeks ago

Hightower87 commented 2 weeks ago

Hi, is there any way to show a second screen onto first screen while keeping the first screen on the background like a popup behaviour?

I would like to show second screen with background transparent, having a popup, and still want to see the first screen. I know this can be achieved with a popup composable, but I would like to use navigator to push and pop and behave like a normal screen.

Syer10 commented 2 weeks ago

Its possible to use Voyager to do this, its not directly supported currently. You'll need to use the Navigator content parameter and create a alternative to CurrentScreen, something like CurrentNotDialogScreen and add a if statement after that for latest dialog screen.

Hightower87 commented 2 weeks ago

But this time popup will be implemented in the current compose context, and I will not be able to do such thing as: "navigator.push(PopupScene())". Thanks for the explanation.