Permalink
Browse files

Loading-State when reloading Android WebView

Summary:
This commit enables state WebViewState before triggering reload on WebView. This will (if defined) trigger the loading screen again.

On iOS the LoadingIndicator will be called whenever you reload the WebView. On Android this feature is missing (see #11013). This PR adds this behaviour.

Important: One might think that "onLoadStart" is the right area to add this code, but on Android onLoadStart will also trigger for sub-resources -> the loading screen will also appear when loading iframes on the same page. I expect thats why this was not added in first place.

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Closes #15538

Differential Revision: D5653257

Pulled By: hramos

fbshipit-source-id: 908b82ddaf2c34048bcb833bc07e03ab68d09467
  • Loading branch information...
DracoBlue authored and facebook-github-bot committed Aug 17, 2017
1 parent 0d3039f commit f95153ed5202621827b4c40a80e2b7736cd0d3e8
Showing with 3 additions and 0 deletions.
  1. +3 −0 Libraries/Components/WebView/WebView.android.js
@@ -313,6 +313,9 @@ class WebView extends React.Component {
};
reload = () => {
this.setState({
viewState: WebViewState.LOADING
});
UIManager.dispatchViewManagerCommand(
this.getWebViewHandle(),
UIManager.RCTWebView.Commands.reload,

0 comments on commit f95153e

Please sign in to comment.