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
This commit is contained in:
Moti Zilberman 2018-02-06 16:49:44 -08:00 committed by Facebook Github Bot
parent a1c479fb3b
commit 6c38972327
1 changed files with 2 additions and 2 deletions

View File

@ -17,14 +17,14 @@ import com.facebook.react.bridge.ReadableMap;
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