julioromano
01/27/2021, 7:39 AMandroid:animateLayoutChanges="true"
?Andrew Neal
01/27/2021, 7:43 AMjulioromano
01/27/2021, 8:15 AMScrollableColumn
and adding .animateContentSize
makes the column resize more nicely, is there an equally easy way to also add fade in/out transitions to the individual column elements?Mikołaj Kąkol
01/27/2021, 11:36 AMjulioromano
01/27/2021, 11:48 AMMikołaj Kąkol
01/27/2021, 11:50 AMCrossfade(
stateOrModelOrSth,
modifier = Modifier.animateContentSize(tween(1000)),
animation = keyframes {
durationMillis = 3000
0.01f at 1000
1f at 3000
}
) {
YourComposable(stateOrModelOrSth)
}
Mikołaj Kąkol
01/27/2021, 11:50 AMDoris Liu
01/28/2021, 1:43 AMDoris Liu
01/28/2021, 1:46 AMtween
as such:
tween(delayMillis = 100, durationMillis = 200)
julioromano
01/28/2021, 8:17 AMRecyclerView
which has animations when the list content changes (thanks to DiffUtil
) with a ScrollableColumn
but can’t get similar animations when changing content. Perhaps that’s simply not possible with ScrollableColumn
.
In case you are wondering why I’m not using LazyColumn
instead, it’s because that RecyclerView
was overkill: it managed a relatively small set of items so I thought that view recycling wasn’t necessary when rewriting it in Compose, but probably the nice animations we get almost for free using DiffUtil
are simply not possible with ScrollableColumn
?