carbaj0
01/26/2020, 4:33 PMFloatingActionButton(
text = "aa",
elevation = 7.dp,
textStyle = (+typography()).body1.copy(color = Color.White),
onClick = { Snackbar(text = "dsaf") }
)
java.lang.IllegalStateException: Composition requires an active composition contextBruno_
01/26/2020, 4:41 PMAdam Powell
01/26/2020, 4:43 PMalexsullivan114
01/26/2020, 7:39 PMSnackbar.make
API with a Snackbar
composable, which you need to setup just like any other composable.Adam Powell
01/26/2020, 7:43 PMvar snackbarMessage by +state<String?> { null }
// ...
FloatingActionButton(
// ...
onClick = { snackbarMessage = "dasf" }
)
// ...
if (snackbarMessage != null) {
Snackbar(text = snackbarMessage)
}
Adam Powell
01/26/2020, 7:45 PMalexsullivan114
01/26/2020, 11:37 PMSnackbar
and Toast
have very unique APIs to make them easy to launch from really anywhere. Are there any plans to offer similar APIs for their replacement composables?Adam Powell
01/27/2020, 1:44 AMAmbient
and enqueue new messages to show with it from further down the hierarchyAdam Powell
01/27/2020, 1:47 AMAdam Powell
01/27/2020, 1:50 AMAdam Powell
01/27/2020, 1:54 AMAdam Powell
01/27/2020, 1:55 AMcarbaj0
01/27/2020, 9:21 AMSnackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn't interrupt the user experience, and they don't require user input to disappear.
Do I have to handle the time that is shown on the screen, out the Snackbar component?matvei
01/27/2020, 11:31 AMalexsullivan114
01/27/2020, 11:41 AMScaffold
to do so.matvei
01/27/2020, 11:44 AM