From 6c389723274712bc52d6642cc6c1907b5523726d Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Tue, 6 Feb 2018 16:49:44 -0800 Subject: [PATCH] Support non-integer modulus in ModulusAnimatedNode on Android Summary: `Animated.modulo(value, modulus)` supports a non-integer modulus in the iOS and JS implementations but crashes on Android when `useNativeDriver` is set to `true`. Unfortunately, I'm not fluent enough with this codebase to add a Java test for this fix - especially as I couldn't find any analogous tests to extrapolate from. However, the fix itself seems straightforward enough. None needed [ANDROID] [BUGFIX] [Animated] - Support non-integer modulus in .modulo() Closes https://github.com/facebook/react-native/pull/17860 Differential Revision: D6918799 Pulled By: hramos fbshipit-source-id: 8d15e4bc881ed41a4123c6f811c0c72119f67be0 --- .../java/com/facebook/react/animated/ModulusAnimatedNode.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java b/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java index 11fa7fc274c308..2bce6b806362bb 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java @@ -17,14 +17,14 @@ private final NativeAnimatedNodesManager mNativeAnimatedNodesManager; private final int mInputNode; - private final int mModulus; + private final double mModulus; public ModulusAnimatedNode( ReadableMap config, NativeAnimatedNodesManager nativeAnimatedNodesManager) { mNativeAnimatedNodesManager = nativeAnimatedNodesManager; mInputNode = config.getInt("input"); - mModulus = config.getInt("modulus"); + mModulus = config.getDouble("modulus"); } @Override