mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Populate Platform.isDisableAnimations for the Android mobile platform (#38511)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38511 ## Changelog [Internal] - This allows to override `Platform.isDisableAnimations` for the Android platform, in the same way as it's done with `IS_TESTING` (but similarly optionally doing `IS_DISABLE_ANIMATIONS` in addition to/instead). See for more context: https://github.com/facebook/react-native/pull/38490 Reviewed By: cortinico Differential Revision: D47530731 fbshipit-source-id: b90300124b2a8bac97fae78a94e8a2cc9d7fd5bc
This commit is contained in:
committed by
Facebook GitHub Bot
parent
42a2898617
commit
256aaa15bf
+5
@@ -28,6 +28,7 @@ import java.util.Map;
|
||||
@SuppressLint("HardwareIds")
|
||||
public class AndroidInfoModule extends NativePlatformConstantsAndroidSpec implements TurboModule {
|
||||
private static final String IS_TESTING = "IS_TESTING";
|
||||
private static final String IS_DISABLE_ANIMATIONS = "IS_DISABLE_ANIMATIONS";
|
||||
|
||||
public AndroidInfoModule(ReactApplicationContext reactContext) {
|
||||
super(reactContext);
|
||||
@@ -75,6 +76,10 @@ public class AndroidInfoModule extends NativePlatformConstantsAndroidSpec implem
|
||||
}
|
||||
constants.put(
|
||||
"isTesting", "true".equals(System.getProperty(IS_TESTING)) || isRunningScreenshotTest());
|
||||
String isDisableAnimations = System.getProperty(IS_DISABLE_ANIMATIONS);
|
||||
if (isDisableAnimations != null) {
|
||||
constants.put("isDisableAnimations", "true".equals(isDisableAnimations));
|
||||
}
|
||||
constants.put("reactNativeVersion", ReactNativeVersion.VERSION);
|
||||
constants.put("uiMode", uiMode());
|
||||
return constants;
|
||||
|
||||
Reference in New Issue
Block a user