https://kotlinlang.org logo
#compose
Title
# compose
a

alp

03/14/2023, 4:07 AM
Hi, there is an api for animating lazy lists:
Modifier.animateItemPlacement
, does anybody know if there is any api/approach for regular Row/Column? I’m aware of
AnimatedContent
but couldn’t make it work after a quick prototyping session
c

chanjungskim

03/14/2023, 7:23 AM
Sorry, I don't get it. Could you please explain more detail you want to achieve?
a

alp

03/14/2023, 4:24 PM
I have some variable amount of
children
composables that I render in a
Row
. I want to animate item addition/removal as
children
udpated
c

chanjungskim

03/14/2023, 4:45 PM
Can you provide me some example code and image?
a

alp

03/14/2023, 5:14 PM
Copy code
Row {
  children.forEach { child->
      child.Ui()
  }
}
I don’t have an image of that, but essentially
children
is a
State<List<Component>>
where Component is :
Copy code
interface Component {
    
    @Composable
    fun Ui()
}
when
children
change, the row updates but there is no addition/removal animation (which is expected since Row/Column don’t support that out of the box)
3 Views