-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Use native animations if the animated value is native in NavigationCardStackPanResponder #10641
Use native animations if the animated value is native in NavigationCardStackPanResponder #10641
Conversation
NavigationCardStackPanResponder
By analyzing the blame information on this pull request, we identified @hedgerwang and @ahanriat to be potential reviewers. |
ping @ericvicenti This PR is related to the other one you just review to make NavigationGestures work with native animated values. |
Looks great, thanks! |
@facebook-github-bot shipit |
@ericvicenti has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: `NavigationCardStackPanResponder` uses `__getValue` and the `stopAnimation` callback value which both doesn't work with native driven animation. The workaround here is to add a value listener so the JS value of the AnimatedValue gets updated too so `__getValue` has a relatively up to date value. This value should be good unless JS lags behind native a lot but that should not happen during a navigation gesture. Also added a comment that explains the hack. **Test plan** Tested in an app that uses native driven animations with a back gesture. This also needs #10643 and #10641 for everything to work properly. Closes #10642 Differential Revision: D4135496 Pulled By: ericvicenti fbshipit-source-id: 395aff78b16a37ad9407207a05504fdd6311f733
…rdStackPanResponder Summary: Since native and non-native animations do not work together check if the animated value is native and set useNativeDriver accordingly. So untill we move to always using the native driver this is needed. This and another fix in NativeAnimations module will allow using native animations to transitions with gestures. **Test plan** Tested in an app that uses native driven animations with a back gesture. This also needs facebook#10643 and facebook#10642 for everything to work properly. Closes facebook#10641 Differential Revision: D4135972 Pulled By: ericvicenti fbshipit-source-id: 8e65574ebb296da044f4d03bf1eedee4a37ebdac
Summary: `NavigationCardStackPanResponder` uses `__getValue` and the `stopAnimation` callback value which both doesn't work with native driven animation. The workaround here is to add a value listener so the JS value of the AnimatedValue gets updated too so `__getValue` has a relatively up to date value. This value should be good unless JS lags behind native a lot but that should not happen during a navigation gesture. Also added a comment that explains the hack. **Test plan** Tested in an app that uses native driven animations with a back gesture. This also needs facebook#10643 and facebook#10641 for everything to work properly. Closes facebook#10642 Differential Revision: D4135496 Pulled By: ericvicenti fbshipit-source-id: 395aff78b16a37ad9407207a05504fdd6311f733
…rdStackPanResponder Summary: Since native and non-native animations do not work together check if the animated value is native and set useNativeDriver accordingly. So untill we move to always using the native driver this is needed. This and another fix in NativeAnimations module will allow using native animations to transitions with gestures. **Test plan** Tested in an app that uses native driven animations with a back gesture. This also needs facebook#10643 and facebook#10642 for everything to work properly. Closes facebook#10641 Differential Revision: D4135972 Pulled By: ericvicenti fbshipit-source-id: 8e65574ebb296da044f4d03bf1eedee4a37ebdac
Summary: `NavigationCardStackPanResponder` uses `__getValue` and the `stopAnimation` callback value which both doesn't work with native driven animation. The workaround here is to add a value listener so the JS value of the AnimatedValue gets updated too so `__getValue` has a relatively up to date value. This value should be good unless JS lags behind native a lot but that should not happen during a navigation gesture. Also added a comment that explains the hack. **Test plan** Tested in an app that uses native driven animations with a back gesture. This also needs facebook#10643 and facebook#10641 for everything to work properly. Closes facebook#10642 Differential Revision: D4135496 Pulled By: ericvicenti fbshipit-source-id: 395aff78b16a37ad9407207a05504fdd6311f733
Since native and non-native animations do not work together check if the animated value is native and set useNativeDriver accordingly. So untill we move to always using the native driver this is needed. This and another fix in NativeAnimations module will allow using native animations to transitions with gestures.
Test plan
Tested in an app that uses native driven animations with a back gesture. This also needs #10643 and #10642 for everything to work properly.