cashapp / paparazzi

Render your Android screens without a physical device or emulator
https://cashapp.github.io/paparazzi/
Apache License 2.0
2.32k stars 216 forks source link

`InstantAnimationsRule` doesn't work with Compose #901

Open BraisGabin opened 1 year ago

BraisGabin commented 1 year ago

InstantAnimationsRule doesn't work with compose.

I have some components that have animations and it would be great to be able to take a screenshot of the last frame.

This use case could be fullfilled with #627 or #752. Anyway it would be great than instead of hardcode an offset you could just say "take a screenshot of the last frame".

geoff-powell commented 1 month ago

Wanted to give an update here. For now we will not be supporting Compose animations for this test rule. It was implemented in a time where gif support was not ready and now we have APNG support for animations. Our suggestion for capturing this is the following (per @jrodbx 😉):

If frames = 1, snapshot static image
If frames = 2, grrr, but ok, we allow via pending recompositions, cuz androidx Composable kinda misbehave require another pass?
if frames > 2, either use gif support OR you have a bug, fix yo' UI widget.

We will think on this use case in our upcoming 2.0 rewrite.