https://kotlinlang.org logo
Title
p

PHondogo

04/25/2023, 7:45 PM
Hello! What is the best way for making modal element (preventing all events on elements under it)?
o

Othman El Jazouli

04/25/2023, 7:51 PM
I think either a bottomSheet (similar to a composable in your navhost) - this for standalone screens or a
ModalBottomSheetLayout
with a
sheetState
val sheetState = rememberModalBottomSheetState(
    initialValue = ModalBottomSheetValue.Hidden,
    skipHalfExpanded = true,
    confirmValueChange = { it != ModalBottomSheetValue.HalfExpanded }
)
and a
sheetContent
which is your actual sheet stuff, and
content
is your main screen, and you can play with
sheetState
show/hide this is used more for quick actions of the content screen