2) Allow snapshotting/gif synced to animation progress.
If animation state isn't externalised, it seems difficult to snapshot at exactly the right frame. But if we can using the same approach as Android Studio animation tooling, then we can capture the exact values.
3) Allow capturing a gif of a animation.
Similar to the interactive previews in Android Studio, for the various transitions supported in Android Studio, allow capturing a gif of the transition from start to end.
For 2+3 - we could use a similar approach to Android Studio, which searches the compose slot tables for known animation types and uses them to examine or control the animation.
Something like the following will capture composition data, allows traversing the tree to find the types like Animatable, Transition.
val store = mutableSetOf<CompositionData>()
store.add(currentComposer.compositionData)
CompositionLocalProvider(
LocalInspectionMode provides true,
LocalInspectionTables provides store
) {
// animation to preview
}
I guess a 3 part request. Feel free to close if out of scope, I'm basically getting some thoughts down.
1) Support Compose Animation with samples.
Presumably now working since some recent fixes like https://github.com/cashapp/paparazzi/pull/739
2) Allow snapshotting/gif synced to animation progress.
If animation state isn't externalised, it seems difficult to snapshot at exactly the right frame. But if we can using the same approach as Android Studio animation tooling, then we can capture the exact values.
3) Allow capturing a gif of a animation.
Similar to the interactive previews in Android Studio, for the various transitions supported in Android Studio, allow capturing a gif of the transition from start to end.
For 2+3 - we could use a similar approach to Android Studio, which searches the compose slot tables for known animation types and uses them to examine or control the animation.
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/animation/AnimationSearch.kt
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/animation/AnimatedVisibilityComposeAnimation.kt
Something like the following will capture composition data, allows traversing the tree to find the types like Animatable, Transition.