Skip to content

Commit

Permalink
Populate Platform.isDisableAnimations for the Android mobile platform (
Browse files Browse the repository at this point in the history
…facebook#38511)

Summary:
Pull Request resolved: facebook#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: facebook#38490

Reviewed By: cortinico

Differential Revision: D47530731

fbshipit-source-id: b90300124b2a8bac97fae78a94e8a2cc9d7fd5bc
  • Loading branch information
rshest authored and juniorklawa committed Jul 20, 2023
1 parent c52ea81 commit 5cbdd62
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 5cbdd62

Please sign in to comment.