Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose delay for animation effect #678

Open
eugene-bes opened this issue Jan 9, 2023 · 4 comments
Open

Compose delay for animation effect #678

eugene-bes opened this issue Jan 9, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@eugene-bes
Copy link

Hi.
I have compose widget with animation effect.
This animation has a duration about 500ms.
How can I add delay 500ms before the paparazzi takes a screenshot?

@eugene-bes eugene-bes added the enhancement New feature or request label Jan 9, 2023
@jisungbin
Copy link

jisungbin commented Jan 9, 2023

Maybe duplicate of #627.

@eugene-bes
Copy link
Author

@jisungbin I expected this to work but it doesn't :(

@leo-beliakov
Copy link

@jrodbx Any updates on this?

@geoff-powell
Copy link
Collaborator

Update here, unfortunately AndroidX Compose Animations track the animation start time to animate state. As such, paparazzi jumps to the offsetMillis passed in snapshot/gif methods. This makes snapshots at the given offset not represent the actual state as the start time becomes the offsetMillis passed.

Fixes:

  1. Request an issue on IssueTracker to add a way in AndroidX compose animations to restrict this start time logic for our usecase.
  2. When snapshoting something with an offsetMillis > 0, requiring the initial render for the 0 frame to track the correct animation timing with startTime = 0 in compose animation.

I am leaning toward 2 as it unblocks us. It does require an additional render but I think this is okay as it should only effect snapshots/gifs with offset > 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants