Skip to content

Conversation

@piaskowyk
Copy link
Member

@piaskowyk piaskowyk commented May 14, 2024

Summary

This PR fixes the issue of slow animations on Android. We utilize two different sources of timestamps on Android, so we need to slow down both of them instead of just one to fix the problem. Previously, almost all animations were canceled immediately after starting because the current frame timestamp was 10 times higher than the slowed-down start timestamp.

before after
Screen.Recording.2024-05-14.at.14.30.22.mov
Screen.Recording.2024-05-14.at.14.15.50.mov

@piaskowyk piaskowyk requested review from tjzel and tomekzaw May 14, 2024 12:37
@efstathiosntonas
Copy link
Contributor

efstathiosntonas commented May 14, 2024

@piaskowyk I believe PR title is confusing, I read it like "improve the performance of -normal- animations" 😅

@piaskowyk
Copy link
Member Author

piaskowyk commented May 14, 2024

Hey, this PR is about our feature that slow down all animation for debugging purposes 😅

Screen.Recording.2024-05-14.at.15.01.44.mp4

@piaskowyk piaskowyk changed the title Fix slow animation on Android Fix slow animation mode on Android May 14, 2024
Base automatically changed from @wolewicki/use-proper-react-host to main May 14, 2024 13:06
Copy link
Collaborator

@tjzel tjzel left a comment

Choose a reason for hiding this comment

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

The animations are so slow now they made the 'after' video 3x longer!

r0h0gg6 pushed a commit to r0h0gg6/react-native-reanimated that referenced this pull request Jul 28, 2025
## Summary

This PR fixes the issue of slow animations on Android. We utilize two
different sources of timestamps on Android, so we need to slow down both
of them instead of just one to fix the problem. Previously, almost all
animations were canceled immediately after starting because the current
frame timestamp was 10 times higher than the slowed-down start
timestamp.

| before | after |
| --- | --- |
| <video
src="https://github.com/software-mansion/react-native-reanimated/assets/36106620/0221e94e-b1b7-48d2-9092-85265dbb36b0"
/> | <video
src="https://github.com/software-mansion/react-native-reanimated/assets/36106620/5dcd926e-8c94-44e5-a5a5-7b8e60ebf333"
/> |

---------

Co-authored-by: Wojciech Lewicki <[email protected]>
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.

5 participants