Update progressBar before changing visibility.
[PrivacyBrowser.git] / app / src / main / java / com / stoutner / privacybrowser / Webview.java
index bc8dd08d1bf555a0c68fff887f524bdccca11746..16c524159d605fe17219b89f4a8420e0c2d21b4c 100644 (file)
@@ -48,12 +48,12 @@ public class Webview extends AppCompatActivity {
         // Update the progress bar when a page is loading.
         mainWebView.setWebChromeClient(new WebChromeClient() {
             public void onProgressChanged(WebView view, int progress) {
+                progressBar.setProgress(progress);
                 if (progress < 100) {
                     progressBar.setVisibility(View.VISIBLE);
                 } else {
                     progressBar.setVisibility(View.GONE);
                 }
-                progressBar.setProgress(progress);
             }
         });