From 219dd7538b76d65f1a3cec36fa9fcd752fd8177f Mon Sep 17 00:00:00 2001 From: ManigandanRaamanathan Date: Fri, 31 Jan 2020 02:36:50 +0800 Subject: [PATCH] Added more apis Added more apis to customise the rendering style and android Statusbar height issues --- src/index.js | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/index.js b/src/index.js index 0edc4f9..c0becf8 100644 --- a/src/index.js +++ b/src/index.js @@ -4,15 +4,16 @@ import { ActivityIndicator, View, Text, - StyleSheet + StyleSheet, + Platform, + StatusBar } from 'react-native'; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', - padding: 20, - backgroundColor: 'rgba(0, 0, 0, 0.5)' + padding: 20 }, innerContainer: { borderRadius: 10, @@ -42,7 +43,11 @@ export default class OrientationLoadingOverlay extends Component { color: 'white', indicatorSize: 'large', messageFontSize: 24, - message: '' + message: '', + container: null, + innerContainer: null, + bgColor: "rgba(0,0,0,0.5)", + statusBarOverlay: false }; render() { @@ -61,9 +66,14 @@ export default class OrientationLoadingOverlay extends Component { onOrientationChange={ evt => this.setState({currentOrientation: evt.nativeEvent.orientation}) } - > - - + maxHeight={10} + > + {Platform.OS === 'android' && this.props.statusBarOverlay? + + : null + } + + {this.props.children} @@ -80,15 +90,19 @@ export default class OrientationLoadingOverlay extends Component { onOrientationChange={ evt => this.setState({currentOrientation: evt.nativeEvent.orientation}) } - > - - + > + + {Platform.OS === 'android' && this.props.statusBarOverlay? + + : null + } + - + {this.props.message}