Skip to content
Browse files

Support non-integer modulus in ModulusAnimatedNode on Android

`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 #17860

Differential Revision: D6918799

Pulled By: hramos

fbshipit-source-id: 8d15e4bc881ed41a4123c6f811c0c72119f67be0
  • Loading branch information...
motiz88 authored and facebook-github-bot committed Feb 7, 2018
1 parent a1c479f commit 6c389723274712bc52d6642cc6c1907b5523726d
Showing with 2 additions and 2 deletions.
  1. +2 −2 ReactAndroid/src/main/java/com/facebook/react/animated/
@@ -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");


0 comments on commit 6c38972

Please sign in to comment.
You can’t perform that action at this time.