Bug 1394404 - Part 1: Update AnimatedProgressBar's progress value to 100 before hiding it. r=walkingice
authorJing-wei Wu <topwu.tw@gmail.com>
Fri, 08 Sep 2017 18:14:33 +0800
changeset 662288 a2ed5fdd3fc33be5a9c8defbe2dec306caeab88f
parent 662287 42306e3867ae163689a28dc70bb1ca8b154fbce3
child 662289 1f1893590a1df0ecf2d4f9e2dfdc3223991a942f
push id79014
push userbmo:bpostelnicu@mozilla.com
push dateMon, 11 Sep 2017 09:58:20 +0000
reviewerswalkingice
bugs1394404
milestone57.0a1
Bug 1394404 - Part 1: Update AnimatedProgressBar's progress value to 100 before hiding it. r=walkingice Our new animated progress bar follows the logic to hide itself: 1. When its progress value reaches 100, it disappears gracefully(with animation), otherwise, 2. It just disappears directly. To make sure the progress bar always looked like fully loaded, we have to set its progress value to 100 before hiding it. MozReview-Commit-ID: JSYEPYEhG4A
mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/customtabs/CustomTabsActivity.java
@@ -412,19 +412,19 @@ public class CustomTabsActivity extends 
         forwardMenuItem.setEnabled(mCanGoForward);
     }
 
     /**
      * Update the state of the progress bar.
      * @param progress The current loading progress; must be between 0 and 100
      */
     private void updateProgress(final int progress) {
+        mProgressView.setProgress(progress);
         if (mCanStop) {
             mProgressView.setVisibility(View.VISIBLE);
-            mProgressView.setProgress(progress);
         } else {
             mProgressView.setVisibility(View.GONE);
         }
     }
 
     /**
      * Update loading status of current page
      */