Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw behind the system status bar in a Jetpack Compose Dialog

I disabled fitSystemWindows via WindowCompat.setDecorFitsSystemWindows(window, false) to draw behind the status bar and I am using the insets accompanist library to get the respective insets for adding padding to specific composables.

However, if I show a fullscreen dialog, the dialog still has padding to the system- and navigation bar and refuses to draw behind the status bar.

The Dialog looks like the following snippet:

Dialog(
    onDimissRequest = {},
    properties = DialogProperties(usePlatformDefaultWidth = false)
) {
    // ...
}

Is there any additional setting required in order to also let the dialog draw behind the system's status bar?

like image 691
J. Hegg Avatar asked Dec 10 '25 02:12

J. Hegg


1 Answers

Maybe ModalDrawerLayout can help ?

ModalDrawerLayout(
    drawerContent = {
        // smth, idk
    },
    bodyContent = {
        Dialog(
            onDismissRequest = {},
            properties = DialogProperties(usePlatformDefaultWidth = false)
        ) {
            // Dialog content here
        }
    }
)
like image 81
Dumitru Avatar answered Dec 11 '25 15:12

Dumitru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!