Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jetpack Compose Immersive mode Dialog

I have an Immersive application that's hiding the system bar using the Compose accompanist library in system navigation

val systemUiController: SystemUiController = rememberSystemUiController()

systemUiController.isStatusBarVisible = false // Status bar
systemUiController.isNavigationBarVisible = false // Navigation bar
systemUiController.isSystemBarsVisible = false // Status & Navigation bars
systemUiController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE

This works fine but when I open a new alertDialog the system navigations show up again. Looking for a compose way of preventing the system bar to appear when AlertDialog or DropdownMenu is opened.

My code is basically a scaffold with a variable that controls showing/hiding the AlertDialog from the ViewModel.

Here is a gif to make it more clear. You can see the system navigation are hidden normally but when I clicked on DropDownMenu and when the AlertDialog they appear. enter image description here

like image 484
HaMiD Sani Avatar asked Oct 29 '25 14:10

HaMiD Sani


1 Answers

Want to answer my own question in case anyone else is looking for a solution. Please follow the Github conversation

like image 67
HaMiD Sani Avatar answered Oct 31 '25 03:10

HaMiD Sani