Yan Pujante
03/28/2021, 5:05 PM@Composable
fun PartCard2(part: Part) {
var expanded by remember { mutableStateOf(false) }
val elevation = if (expanded) 3.dp else 1.dp
Card(elevation = elevation,
modifier = Modifier.animateContentSize().clickable { expanded = !expanded }) {
Row {
Column {
Text(part.name)
if (expanded) {
(1..10).forEach {
Text("Much more....")
}
}
}
}
}
}
I have ran into situations when clicking the card would display the clicking animation, but the card remains expanded. So I am wondering, is my code wrong? Or am I running into some issues with the compose code?