I implement user interface in Jetpack Compose, and want to show SnackBar inside Compose functions.
the issue is that i can't change SnackBar's Layout Direction to Rtl.
What I've implemented to change the direction:
LaunchedEffect(SnackbarHost(hostState = scaffoldState.snackbarHostState, snackbar = {
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Rtl) {
Snackbar(it)
}
}
)) {
viewModel.snackBarMessage.collect {
scaffoldState.snackbarHostState.showSnackbar(
it,
null,
SnackbarDuration.Short
)
}
}