From af49add1ed32ff6d74fa1a836bb37e36fec67d91 Mon Sep 17 00:00:00 2001 From: Eugen Sawin Date: Thu, 26 Jul 2018 16:50:38 +0200 Subject: [PATCH] Bug 1437988 - [2.0] Use progress tracking events for custom tabs progress bar. r=droeh --- .../org/mozilla/gecko/customtabs/CustomTabsActivity.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java index 052348e062ff..393b0eadfd13 100644 --- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java +++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java @@ -114,7 +114,6 @@ public class CustomTabsActivity extends AppCompatActivity doorhangerOverlay = findViewById(R.id.custom_tabs_doorhanger_overlay); mProgressView = (ProgressBar) findViewById(R.id.page_progress); - updateProgress(10); final Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar); setSupportActionBar(toolbar); final ActionBar actionBar = getSupportActionBar(); @@ -596,7 +595,6 @@ public class CustomTabsActivity extends AppCompatActivity public void onLocationChange(GeckoSession session, String url) { mCurrentUrl = url; updateActionBar(); - updateProgress(60); } @Override @@ -663,18 +661,21 @@ public class CustomTabsActivity extends AppCompatActivity mCanStop = true; updateActionBar(); updateCanStop(); - updateProgress(20); } @Override public void onPageStop(GeckoSession session, boolean success) { mCanStop = false; updateCanStop(); - updateProgress(100); } @Override public void onProgressChange(GeckoSession session, int progress) { + if (progress == 100) { + mCanStop = false; + updateCanStop(); + } + updateProgress(progress); } @Override