Any ideas how to set dim in Popup Compose? In Dial...
# compose
p
Any ideas how to set dim in Popup Compose? In Dialog we have dim alpha from android:backgroundDimAmount, but Popup doesn`t exist
a
Iirc, you're responsible for drawing your own background
p
But, I can set analog dim-alpha in compose background?
a
yes, theres a modifier for that, or use a color with an alpha
p
But how i can change status/navigation bar? by rememberSystemUiController ?
a
Yeah, you can use accompanist for that
p
but interesting facts Popup{ Box(fillMexSize().black() { } } Start and top sides have some spacer 🤔
a
You need to ignore the window inserts too
That's done at the activity level setting flags on the window or using WindowCompat
p
how?
I mean NOT status bar and navigation I mean red space left screen
a
Ooohh
Not sure tbh
To be fair, if you want one that's semantically correct, reference Google's material implementation
p
Okey, i really create hack for this
Copy code
var showMenu by remember { mutableStateOf(true) }
val onDismissMenu = { showMenu = false }

 if (showMenu) {
        Dialog(
            onDismissRequest = onDismissMenu,
            properties = DialogProperties(usePlatformDefaultWidth = false)
        ) {
            Box(
                modifier = Modifier
                    .fillMaxSize()
                    .clickable {
                        onDismissMenu.invoke()
                    }
            ) {
// by offset in Modifier u can place content by X and Y 
                Content()
            }
        }
    }
x and y i get from design yeah