From d0669fc922a1d9c80d8df817b9f5bad580f069a6 Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Tue, 15 Aug 2017 21:58:43 -0700 Subject: [PATCH] `onAnimatedValueUpdate` should also include offset 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 https://github.com/facebook/react-native/pull/15500 Differential Revision: D5638336 Pulled By: shergin fbshipit-source-id: d2104fdb483d9db3b856d625d021cceaa9232787 --- .../java/com/facebook/react/animated/ValueAnimatedNode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/ValueAnimatedNode.java b/ReactAndroid/src/main/java/com/facebook/react/animated/ValueAnimatedNode.java index fb545da9bbdfa4..77dc74c70d6869 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/ValueAnimatedNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/ValueAnimatedNode.java @@ -49,7 +49,7 @@ public void onValueUpdate() { if (mValueListener == null) { return; } - mValueListener.onValueUpdate(mValue); + mValueListener.onValueUpdate(getValue()); } public void setValueListener(@Nullable AnimatedNodeValueListener listener) {