Код: Выделить всё
@Preview
fun MainAnimatedPanel() {
var visible by remember { mutableStateOf(true) }
val density = LocalDensity.current
Box(
modifier = Modifier.fillMaxSize()
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally
) {
Box(
modifier = Modifier
.fillMaxWidth()
.background(Color.Yellow)
.weight(1f)
.clickable { visible = !visible }
)
AnimatedVisibility(
visible = visible,
enter = slideInVertically {
with(density) { 250.dp.roundToPx() }
},
exit = slideOutVertically {
with(density) { 250.dp.roundToPx() }
},
) {
Box(
modifier = Modifier
.fillMaxWidth()
.height(250.dp)
.background(Color.Magenta)
)
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/789 ... te-with-th
Мобильная версия