Bug 1484528 - Prevent page loading indicator running continuously; r=JanH
authorPetru Lingurar <petru.lingurar@softvision.ro>
Thu, 22 Nov 2018 14:52:46 +0000
changeset 504144 e23085e6b51f7d2ab2e9c11fedbc1ef0177f30ed
parent 504143 bafd708f5788ec19c3eda5a4068f2a56fb9f4e7a
child 504145 87bad1f80deeaf4a3cd715d75b405877165c1eeb
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJanH
bugs1484528
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1484528 - Prevent page loading indicator running continuously; r=JanH The page loading indicator should be animated while it is visible. Previously for controlling the animation the visibility state of the parent Drawable - ShiftDrawable would be checked, which in all cases would return true, so the animation would run indefinitely. The patch modifies setVisible() in accordance with the Framework version of DrawableWrapper to corectly set the visibility of both the wrapper and the wrapped drawables so that isVisible() will now return the correct value which will allow stopping the animation. Differential Revision: https://phabricator.services.mozilla.com/D12552
mobile/android/base/java/org/mozilla/gecko/drawable/DrawableWrapper.java
--- a/mobile/android/base/java/org/mozilla/gecko/drawable/DrawableWrapper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/drawable/DrawableWrapper.java
@@ -148,17 +148,19 @@ public class DrawableWrapper extends Dra
 
     @Override
     public void setFilterBitmap(boolean filter) {
         mWrapped.setFilterBitmap(filter);
     }
 
     @Override
     public boolean setVisible(boolean visible, boolean restart) {
-        return mWrapped.setVisible(visible, restart);
+        final boolean superChanged = super.setVisible(visible, restart);
+        final boolean changed = mWrapped.setVisible(visible, restart);
+        return superChanged | changed;
     }
 
     @Override
     public void unscheduleSelf(Runnable what) {
         mWrapped.unscheduleSelf(what);
     }
 
     @Override