Skip to content

Commit 6c38972

Browse files
motiz88facebook-github-bot
authored andcommitted
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 #17860 Differential Revision: D6918799 Pulled By: hramos fbshipit-source-id: 8d15e4bc881ed41a4123c6f811c0c72119f67be0
1 parent a1c479f commit 6c38972

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
private final NativeAnimatedNodesManager mNativeAnimatedNodesManager;
1919
private final int mInputNode;
20-
private final int mModulus;
20+
private final double mModulus;
2121

2222
public ModulusAnimatedNode(
2323
ReadableMap config,
2424
NativeAnimatedNodesManager nativeAnimatedNodesManager) {
2525
mNativeAnimatedNodesManager = nativeAnimatedNodesManager;
2626
mInputNode = config.getInt("input");
27-
mModulus = config.getInt("modulus");
27+
mModulus = config.getDouble("modulus");
2828
}
2929

3030
@Override

0 commit comments

Comments
 (0)