Update progressBar before changing visibility.
authorSoren Stoutner <soren@stoutner.com>
Thu, 24 Sep 2015 23:15:45 +0000 (16:15 -0700)
committerSoren Stoutner <soren@stoutner.com>
Thu, 24 Sep 2015 23:15:45 +0000 (16:15 -0700)
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);
             }
         });