Bug 1394404 - Part 1: Update AnimatedProgressBar's progress value to 100 before hiding it. r?walkingice draft
authorJing-wei Wu <topwu.tw@gmail.com>
Fri, 08 Sep 2017 18:14:33 +0800
changeset 661406 f8b0fdbca28d079a9c91569f49ff8bd5edd7b763
parent 661405 cd0a76c0cfc8de88d10beddfc616c452fc529059
child 661407 9ed6c2521f6ea64c265d2f65b55345a3fad07eff
push id78734
push userbmo:topwu.tw@gmail.com
push dateFri, 08 Sep 2017 10:18:07 +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
@@ -404,19 +404,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
      */