-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix invisible Android activity indicator (#33337)
Apply a patch for the React Native `ActivityIndicator` rendering invisible on Android. This applies the same patch that was previously applied to the Embed block to to React Native itself. The core issue in React Native appears to be [wider reaching](https://git.io/JcNlc), but I chose to [limit the scope](https://git.io/JcNla) of the patch to the one issue we are currently facing (i.e. invisible activity indicators), as I was concerned applying a deeper, untested change introducing regressions elsewhere.
- Loading branch information
Showing
2 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
diff --git a/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js | ||
index 52cbda4..3e3b71e 100644 | ||
--- a/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js | ||
+++ b/node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js | ||
@@ -14,6 +14,7 @@ | ||
const Platform = require('../../Utilities/Platform'); | ||
const React = require('react'); | ||
const StyleSheet = require('../../StyleSheet/StyleSheet'); | ||
+const {PlatformColor} = require('../../StyleSheet/PlatformColorValueTypes'); | ||
const View = require('../View/View'); | ||
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; | ||
import type {ViewProps} from '../View/ViewPropTypes'; | ||
@@ -183,7 +184,11 @@ ActivityIndicatorWithRef.displayName = 'ActivityIndicator'; | ||
* and run Flow. */ | ||
ActivityIndicatorWithRef.defaultProps = { | ||
animating: true, | ||
- color: Platform.OS === 'ios' ? GRAY : null, | ||
+ color: Platform.select({ | ||
+ ios: GRAY, | ||
+ android: PlatformColor('?attr/colorControlActivated'), | ||
+ default: null, | ||
+ }), | ||
hidesWhenStopped: true, | ||
size: 'small', | ||
}; |