Skip to content

Commit

Permalink
onAnimatedValueUpdate should also include offset
Browse files Browse the repository at this point in the history
Summary:
Native Android implementation of animation listeners reports value only, and does not include offset. For non-native animation, the JavaScript listeners receive the animated node value + the animated node offset. Here's where the JavaScript node calls the listeners:
https://github.com/facebook/react-native/blob/046f600cc23ff2d4aeb57be8e5606347f19b76d2/Libraries/Animated/src/AnimatedImplementation.js#L942
 and here's how `__getValue()` is calculated:
 https://github.com/facebook/react-native/blob/046f600cc23ff2d4aeb57be8e5606347f19b76d2/Libraries/Animated/src/AnimatedImplementation.js#L741-L743

cc janicduplessis kmagiera
Closes #15500

Differential Revision: D5638336

Pulled By: shergin

fbshipit-source-id: d2104fdb483d9db3b856d625d021cceaa9232787
  • Loading branch information
rozele authored and facebook-github-bot committed Aug 16, 2017
1 parent c2b3ee7 commit d0669fc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onValueUpdate() {
if (mValueListener == null) {
return;
}
mValueListener.onValueUpdate(mValue);
mValueListener.onValueUpdate(getValue());
}

public void setValueListener(@Nullable AnimatedNodeValueListener listener) {
Expand Down

0 comments on commit d0669fc

Please sign in to comment.