Bryan Herbst
03/02/2021, 6:52 PMModalBottomSheetLayout
is dismissed, either from accessibility actions or from tapping on the scrim outside the sheet?
Drop a DisposableEffect
inside the sheet’s content? I don’t see any sort of callback or observable state.KoskiA
03/02/2021, 6:54 PMswipeable()
in my dev challenge. I used a LaunchedEffect
: https://github.com/dandc87/Compose-Challenge-Puppies/blob/de067d272b4c7c41df6c4856[…]7123/app/src/main/java/com/dandc87/fetch/SwipeableCardLayout.ktBryan Herbst
03/02/2021, 6:59 PMmatvei
03/02/2021, 7:00 PMval state = rememberModalBottomsheetState(BottmsheetValue.Expanded)
DisposableEffect(state.isClosed) {
//this is called when state.isClosed changed during last composition, so you can trigger a side effect when you want (true or false)
onDispose { /* cleanup here */}
}
ModalBottomSheetLayout(state, ....)
Bryan Herbst
03/02/2021, 7:01 PMmatvei
03/02/2021, 7:01 PM