-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
return final animation values to JS for native driven animations #36731
Conversation
This pull request was exported from Phabricator. Differential Revision: D44110833 |
Base commit: ed448b5 |
…k#36731) Summary: Pull Request resolved: facebook#36731 When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect **This diff:** - Returning the final values from the native side, at the same place it sets the "finished" flag. This gets sent to JS in `animated/animations/Animation.js`. In this diff I'm passing the value when 'hasFinishedAnimations' is true, but in a follow up diff I will look into other cases such as cancelled animations Next: 2. Update the Animated.Value to reflect the new values 3. Call the onEnd function if there is one set 4. Use `setNativeProps` to pass the new values down for layout calculations and the correct Pressability responder region Changelog: [General][Changed] - return animated values to JS for natively driven animations Differential Revision: D44110833 fbshipit-source-id: 3418aed9ae724d33dcedb0e678a7e5b4c89ca65e
This pull request was exported from Phabricator. Differential Revision: D44110833 |
5579a9c
to
f81aa00
Compare
Hi @skinsshark! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
…k#36731) Summary: Pull Request resolved: facebook#36731 When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect **This diff:** - Returning the final values from the native side, at the same place it sets the "finished" flag. This gets sent to JS in `animated/animations/Animation.js`. In this diff I'm passing the value when 'hasFinishedAnimations' is true, but in a follow up diff I will look into other cases such as cancelled animations Next: 2. Update the Animated.Value to reflect the new values 3. Call the onEnd function if there is one set 4. Use `setNativeProps` to pass the new values down for layout calculations and the correct Pressability responder region Changelog: [General][Changed] - return animated values to JS for natively driven animations Reviewed By: javache Differential Revision: D44110833 fbshipit-source-id: 3a2a24b5184836450beb5dc698db01253fe91437
…k#37782) Summary: Pull Request resolved: facebook#37782 Pull Request resolved: facebook#36731 When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect **This diff:** - Returning the final values from the native side, at the same place it sets the "finished" flag. This gets sent to JS in `animated/animations/Animation.js`. In this diff I'm passing the value when 'hasFinishedAnimations' is true, but in a follow up diff I will look into other cases such as cancelled animations Next: 2. Update the Animated.Value to reflect the new values 3. Call the onEnd function if there is one set 4. Pass the new values down for layout calculations and the correct Pressability responder region Changelog: [General][Changed] - return animated values to JS for natively driven animations Reviewed By: javache Differential Revision: D44110833 fbshipit-source-id: 8f8b8a6c92ae32a1b12d9b28843d21b2116bb42b
This pull request has been merged in 4b54c0b. |
Summary:
When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect
This diff:
animated/animations/Animation.js
. In this diff I'm passing the value when 'hasFinishedAnimations' is true, but in a follow up diff I will look into other cases such as cancelled animationsNext:
2. Update the Animated.Value to reflect the new values
3. Call the onEnd function if there is one set
4. Use
setNativeProps
to pass the new values down for layout calculations and the correct Pressability responder regionChangelog:
[General][Internal] - return animated values to JS for natively driven animations
Differential Revision: D44110833