Bug 1184762 - Check visibility before closing with animation. r=mcomella
authordominique vincent <domivinc@toitl.com>
Wed, 22 Jul 2015 12:03:36 +0200
changeset 286405 f0bef6917e181a2893a0a65639b4d97978bd9613
parent 286404 c2e8b03c28bcd3ed17fa46ae5041841204028450
child 286406 60d809c185ad3be1f0dda05c2010f5b4e914e638
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1184762
milestone42.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 1184762 - Check visibility before closing with animation. r=mcomella
mobile/android/base/ZoomedView.java
--- a/mobile/android/base/ZoomedView.java
+++ b/mobile/android/base/ZoomedView.java
@@ -497,23 +497,25 @@ public class ZoomedView extends FrameLay
         // the position of the zoomed view will be calculated.
         animationStart.x = (float) leftFromGecko * metrics.zoomFactor + offset.x;
         animationStart.y = (float) topFromGecko * metrics.zoomFactor + offset.y;
 
         moveUsingGeckoPosition(leftFromGecko, topFromGecko);
     }
 
     private void stopZoomDisplay(boolean withAnimation) {
-        shouldSetVisibleOnUpdate = false;
-        hideZoomedView(withAnimation);
-        ThreadUtils.removeCallbacksFromUiThread(requestRenderRunnable);
-        if (layerView != null) {
-            layerView.setOnMetricsChangedZoomedViewportListener(null);
-            layerView.removeZoomedViewListener(this);
-            layerView = null;
+        if (getVisibility() == View.VISIBLE) {
+            shouldSetVisibleOnUpdate = false;
+            hideZoomedView(withAnimation);
+            ThreadUtils.removeCallbacksFromUiThread(requestRenderRunnable);
+            if (layerView != null) {
+                layerView.setOnMetricsChangedZoomedViewportListener(null);
+                layerView.removeZoomedViewListener(this);
+                layerView = null;
+            }
         }
     }
 
     private void changeZoomFactor() {
         if (currentZoomFactorIndex < ZOOM_FACTORS_LIST.length - 1) {
             currentZoomFactorIndex++;
         } else {
             currentZoomFactorIndex = 0;