As you can see, sub-answers are visible only if the parent answer is selected. It works well, however, is it possible to animate the visibility of such a group of sub-answers?
Something like this:
Copy code
fun LazyListScope.node(answer: Answer) {
item {
Text(answer.content)
}
// Needs context of a @Composable function, will not compile
AnimatedVisibility(visible = answer.selected) {
nodes(answer.subAnswers)
}
}
I will appreciate any help 🙏
s
shikasd
05/02/2023, 5:29 PM
You cannot use AnimatedVisibility directly in lazy layout block, but can wrap each individual item instead