diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index d4606b927..89b7b4848 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -11,6 +11,7 @@ 'use strict'; var EdgeInsetsPropType = require('EdgeInsetsPropType'); +var ProgressBarAndroid = require('ProgressBarAndroid'); var React = require('React'); var ReactNativeViewAttributes = require('ReactNativeViewAttributes'); var StyleSheet = require('StyleSheet'); @@ -33,6 +34,15 @@ var WebViewState = keyMirror({ ERROR: null, }); +var defaultRenderLoading = () => ( + + + +); + /** * Renders a native WebView. */ @@ -170,7 +180,7 @@ var WebView = React.createClass({ var otherView = null; if (this.state.viewState === WebViewState.LOADING) { - otherView = this.props.renderLoading && this.props.renderLoading(); + otherView = (this.props.renderLoading || defaultRenderLoading)(); } else if (this.state.viewState === WebViewState.ERROR) { var errorEvent = this.state.lastErrorEvent; otherView = this.props.renderError && this.props.renderError( @@ -307,6 +317,14 @@ var styles = StyleSheet.create({ height: 0, flex: 0, // disable 'flex:1' when hiding a View }, + loadingView: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + loadingProgressBar: { + height: 20, + }, }); module.exports = WebView;