Skip to content

Commit

Permalink
Populate Platform.isDisableAnimations for the Android mobile platform
Browse files Browse the repository at this point in the history
Summary:
## 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: facebook#38490

Differential Revision: D47530731

fbshipit-source-id: 80c63787bca303cbedddb05a64eee99d98a51ff6
  • Loading branch information
rshest authored and facebook-github-bot committed Jul 19, 2023
1 parent 7341f9a commit 91e035b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
@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);
Expand Down Expand Up @@ -75,6 +76,10 @@ private String uiMode() {
}
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;
Expand Down

0 comments on commit 91e035b

Please sign in to comment.