Colton Idle
02/02/2022, 5:59 AM...
LaunchedEffect(userMessage) {
snackbarHostState.showSnackbar(userMessage.message)
// Once the message is displayed and dismissed, notify the ViewModel.
viewModel.userMessageShown(userMessage.id)
}
...
Is showSnackbar a synchrnous call? i.e. userMessageShown() will be called ONLY after showSnackbar is done/dismissed?heckfyxe
02/02/2022, 6:06 AMAdam Powell
02/02/2022, 2:19 PMColton Idle
02/02/2022, 7:29 PMAnd yes, userMessageShown will be called only after showSnackbar completesThanks. I guess I was seeing it more of an "async" thing like toast which is a fire and forget sort of operation. so in this case I'm 100% "acknowledging" that the message was shown ONLY after it has been dismissed. Cool. That's a really big yet subtle point that the comment is making IMO and I wanted to make sure I understood it. This means that on rotation, the snackbar will still be shown if it hasn't yet been dismissed (from what I can understand) which is a good thing.
uli
02/02/2022, 7:31 PMColton Idle
02/02/2022, 7:32 PMheckfyxe
02/02/2022, 7:44 PMColton Idle
02/02/2022, 8:36 PM