Karthick
12/25/2022, 7:11 AMconfirmStateChange
not using the latest state?. I want to disable state change while loading. My code is like this.
val uiState = viewModel.uiState.value
Logger.d(SNAP_TAG, "UISTATE $uiState")
val bottomSheetState = rememberBottomSheetState(
initialValue = BottomSheetValue.Expanded,
confirmStateChange = {
Logger.d(SNAP_TAG, "UISTATE $uiState")
!(uiState is UiState.Loading)
}
)
But confirmStateChange
lambda always have uiState as Loading, even-though state changed to Success. My logs are like this whenever i tried to collapse
UISTATE com.example.state.UiState$Loading@f06c50e
UISTATE Success
UISTATE com.example.state.UiState$Loading@f06c50e
UISTATE com.example.state.UiState$Loading@f06c50e
Debdut Saha
12/25/2022, 7:26 AMDebdut Saha
12/25/2022, 7:26 AMKarthick
12/25/2022, 7:27 AMjasu
12/26/2022, 6:14 AMconfirmStateChange
?Karthick
12/26/2022, 8:03 AMconfirmStateChange
lambda will call and we have to return boolean. If true swiping down gesture will make bottom sheet to collapse. else it wont swipe down. Its like we are not allowing.
I want to disable swipe when loading.. @jasujasu
12/26/2022, 9:04 AMFilip Wiesner
12/26/2022, 10:00 AMWhyIt is using the state that was captured in lambda. Either usernot using the latest state?confirmStateChange
uiState.value
inside the lambda or use property delagate: val uiState by viewmodel.uiState