https://kotlinlang.org logo
#compose
Title
# compose
a

Anthony

07/20/2021, 3:41 PM
When using a ModalBottomSheetLayout, is there a way to track when the user dismisses the modal bottom sheet by clicking on the screen above it and not on the predefined button to close the bottomsheet itself?
b

brandonmcansh

07/20/2021, 4:30 PM
Tapping outside is considered a cancel event. Iirc there was a callback for that
a

Anthony

07/20/2021, 4:36 PM
Where could I find some documentation on this callback and how to implement it? The doc here doesn't seem to have any mention of this callback.
d

dimsuz

07/20/2021, 10:45 PM
I think currently there's no callback. What I do is I specify
Copy code
confirmStateChange = { state -> reportStateChange(state); true }
(or return false) It's a part of `ModalBottomSheetState`: https://developer.android.com/reference/kotlin/androidx/compose/material/ModalBottomSheetState
12 Views