I’m trying to call snackbarHostState.showSnackbar(snackbarText)
when the FloatingActionButton
is clicked, but the call gets this:
[]
In AndroidManifest i have this code:
<activity android:name=".YourActivity"
android:windowSoftInputMode="adjustResize"/>
What might have affected the location of the FloatingActionButton
in Scaffold
:
Scaffold(
snackbarHost = { SnackbarHost(hostState = snackbarHostState) }
floatingActionButtonPosition = FabPosition.End,
floatingActionButton = {
FloatingActionButton(
onClick = { snackbarHostState.showSnackbar(snackbarText) },
modifier = Modifier.visible(fabState?.isVisible ?: false),
) {
fabState?.icon?.let {
Icon(
it.imageVector,
it.contentDescription.asString()
)
}
}
},
// ...) {}
New contributor
Denis Skurtu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.