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

Fix setAnimatedNodeValue in Native Animated on iOS #10643

Closed

Conversation

janicduplessis
Copy link
Contributor

setAnimatedNodeValue currently does not update views if there is no animation currently running. This simply updates the view immediately instead of relying on the animation loop. Extracted it out in a function to be able to use it for native Animated.event too.

Test plan
Tested this in an app using native driven animations with NavigationCardStackPanResponder that makes use of setValue to update Animated.Values during the back gesture.

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @buba447 and @ryangomba to be potential reviewers.

@ryangomba
Copy link
Contributor

Looks good to me. Do I have the power to @facebook-github-bot shipit ?

@janicduplessis
Copy link
Contributor Author

You can try :)

@ryangomba
Copy link
Contributor

@facebook-github-bot shipit

@janicduplessis
Copy link
Contributor Author

Looks like not :(

@ide can you ship this

@ide
Copy link
Contributor

ide commented Oct 31, 2016

@facebook-github-bot shipit

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Oct 31, 2016
facebook-github-bot pushed a commit that referenced this pull request Nov 5, 2016
…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 #10643 and #10642 for everything to work properly.
Closes #10641

Differential Revision: D4135972

Pulled By: ericvicenti

fbshipit-source-id: 8e65574ebb296da044f4d03bf1eedee4a37ebdac
facebook-github-bot pushed a commit that referenced this pull request Nov 5, 2016
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
mlguys pushed a commit to mlguys/react-native that referenced this pull request Nov 8, 2016
…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
mlguys pushed a commit to mlguys/react-native that referenced this pull request Nov 8, 2016
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
aleclarson pushed a commit to aleclarson/react-native that referenced this pull request Nov 15, 2016
Summary:
`setAnimatedNodeValue` currently does not update views if there is no animation currently running. This simply updates the view immediately instead of relying on the animation loop. Extracted it out in a function to be able to use it for native `Animated.event` too.

**Test plan**
Tested this in an app using native driven animations with `NavigationCardStackPanResponder` that makes use of `setValue` to update `Animated.Values` during the back gesture.
Closes facebook#10643

Differential Revision: D4106346

fbshipit-source-id: 7c639e03ded87058354340f1179f8b75be423e84
ide pushed a commit to expo/react-native that referenced this pull request Nov 23, 2016
Summary:
`setAnimatedNodeValue` currently does not update views if there is no animation currently running. This simply updates the view immediately instead of relying on the animation loop. Extracted it out in a function to be able to use it for native `Animated.event` too.

**Test plan**
Tested this in an app using native driven animations with `NavigationCardStackPanResponder` that makes use of `setValue` to update `Animated.Values` during the back gesture.
Closes facebook#10643

Differential Revision: D4106346

fbshipit-source-id: 7c639e03ded87058354340f1179f8b75be423e84
ide pushed a commit to expo/react-native that referenced this pull request Nov 30, 2016
Summary:
`setAnimatedNodeValue` currently does not update views if there is no animation currently running. This simply updates the view immediately instead of relying on the animation loop. Extracted it out in a function to be able to use it for native `Animated.event` too.

**Test plan**
Tested this in an app using native driven animations with `NavigationCardStackPanResponder` that makes use of `setValue` to update `Animated.Values` during the back gesture.
Closes facebook#10643

Differential Revision: D4106346

fbshipit-source-id: 7c639e03ded87058354340f1179f8b75be423e84
DanielMSchmidt pushed a commit to DanielMSchmidt/react-native that referenced this pull request Jan 4, 2017
Summary:
`setAnimatedNodeValue` currently does not update views if there is no animation currently running. This simply updates the view immediately instead of relying on the animation loop. Extracted it out in a function to be able to use it for native `Animated.event` too.

**Test plan**
Tested this in an app using native driven animations with `NavigationCardStackPanResponder` that makes use of `setValue` to update `Animated.Values` during the back gesture.
Closes facebook#10643

Differential Revision: D4106346

fbshipit-source-id: 7c639e03ded87058354340f1179f8b75be423e84
DanielMSchmidt pushed a commit to DanielMSchmidt/react-native that referenced this pull request Jan 4, 2017
…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
DanielMSchmidt pushed a commit to DanielMSchmidt/react-native that referenced this pull request Jan 4, 2017
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved. Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants