Skip to content

Commit bc23f24

Browse files
chrisbobbeGautam-Arora24
authored andcommitted
ZulipMobile: Enable LayoutAnimation on Android.
We'll use this soon to redo the header and footer animations in `Lightbox`. Greg points out [1] that, while a code comment in React Native says that activating this 'experimental' code will one day be unnecessary, we should be skeptical that that'll actually happen, given React Native's record. :) [1] zulip#4442 (comment)
1 parent 4db25f4 commit bc23f24

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/ZulipMobile.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* @flow strict-local */
22
import React from 'react';
3+
import { Platform, UIManager } from 'react-native';
34
import 'react-native-url-polyfill/auto';
45
import { SafeAreaProvider } from 'react-native-safe-area-context';
56

@@ -21,6 +22,18 @@ initializeSentry();
2122
// $FlowFixMe[prop-missing]
2223
console.disableYellowBox = true; // eslint-disable-line
2324

25+
// Enable `LayoutAnimation` on Android. Already enabled on iOS.
26+
// https://reactnative.dev/docs/layoutanimation
27+
if (Platform.OS === 'android') {
28+
// In the future, layout animation may be enabled by default. If
29+
// that happens, this method will probably be removed:
30+
// https://github.com/facebook/react-native/blob/v0.63.4/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java#L741-L755.
31+
//
32+
// In the meantime, we should be on the lookout for any issues with
33+
// this feature on Android.
34+
UIManager.setLayoutAnimationEnabledExperimental(true);
35+
}
36+
2437
export default (): React$Node => (
2538
<CompatibilityChecker>
2639
<StoreProvider>

0 commit comments

Comments
 (0)