Isaac Udy
12/16/2019, 6:56 PMKey
and lists, but it doesn't work very well unless you know all the animation functions that might be called upfront.
What works:
val myThings = listOf(...)
for(item in myThings) {
Key(item.id) {
animationOne(progress = ...) {
animationTwo(progress = ...) {
item.composable()
}
}
}
}
The problem with this is that I need to know animationOne and animationTwo upfront, rather than being able to choose arbitrary animations based on some item in myThings.
The main place I would like to do this is in defining "Screen" composables that can be animated in/out from each other, with a custom enter/exit animation defined in each Screen, but changing the animations that wrap a screen that's already been rendered will reset the states/memos inside of the animation block (I assume because there's different group starts).