Rihards
04/25/2023, 8:56 AMPedro Alberto
04/25/2023, 9:48 AMRihards
04/25/2023, 9:51 AMWhen you want to display things on top of each other usually the usecase is a BoxSuch solution would hide the button. What I need to achieve - to place the snackbar higher than the button.
Oleksandr Balan
04/25/2023, 11:44 AMColumn(
modifier = Modifier.padding(16.dp)
) {
var visible by remember { mutableStateOf(false) }
if (visible) {
Snackbar(
modifier = Modifier
.height(0.dp)
.wrapContentHeight(Alignment.Bottom, unbounded = true)
) {
Text(text = "I am a Snackbar")
}
}
Button(
onClick = { visible = !visible },
modifier = Modifier.fillMaxWidth()
) {
Text(text = "Button")
}
}
Inspired by:
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1679897079197999?thread_ts=1679857059.059849&cid=CJLTWPH7SRihards
04/25/2023, 12:56 PMPedro Alberto
06/19/2023, 10:20 AM