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

Proposed fix to correct Compose UI animations #1645

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

geoff-powell
Copy link
Collaborator

@geoff-powell geoff-powell commented Oct 18, 2024

So animations with offsetMillis didn't work properly in paparazzi. This was due to the Transition apis tracking the startTimeNanos when a transition starts. Since this is set ahead of the transition, the delta to render the frame was always 0. For gif() methods that used start = 0 they render correctly because the starting frame is at 0 nanos.

The best way I could combat this was for cases in Compose where the caller was manually setting the startNanos for Paparazzi.takeSnapshots() I call multiple render calls with time 0 to ensure Transition apis have startTimeNanos = 0

Fixes #627 #678

@geoff-powell geoff-powell force-pushed the gpowell/compose/animation-timing branch 2 times, most recently from 1e15599 to b3babf7 Compare October 18, 2024 19:59
@geoff-powell geoff-powell force-pushed the gpowell/compose/animation-timing branch from b3babf7 to 3079a30 Compare October 18, 2024 20:03
@geoff-powell geoff-powell requested a review from nak5ive October 18, 2024 20:07
@geoff-powell geoff-powell changed the title Proposed fix to better time Compose UI animations Proposed fix to correct Compose UI animations Oct 18, 2024
@jrodbx jrodbx added this to the 1.4 milestone Oct 22, 2024
Copy link
Collaborator

@BrianGardnerAtl BrianGardnerAtl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good. Having to render twice with a 0 start time is a little quirky but the comment explains it well

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

Successfully merging this pull request may close these issues.

offsetMillis in Compose
3 participants