Bug 857342 - Don't animate the tab counter if the BrowserToolbar isn't visible. r=mfinkle, a=akeybl
authorSriram Ramasubramanian <sriram@mozilla.com>
Tue, 02 Apr 2013 15:55:09 -0700
changeset 133328 ba4b5ba5492b
parent 133327 f9118486db08
child 133329 88f3ce70814d
push id3604
push userryanvm@gmail.com
push dateTue, 09 Apr 2013 14:12:41 +0000
treeherdermozilla-aurora@08a001d51ccc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, akeybl
bugs857342
milestone22.0a2
Bug 857342 - Don't animate the tab counter if the BrowserToolbar isn't visible. r=mfinkle, a=akeybl
mobile/android/base/BrowserToolbar.java
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -881,16 +881,22 @@ public class BrowserToolbar implements V
                     mActivity.showNormalTabs();
                 else
                     mActivity.showPrivateTabs();
             }
         }
     }
 
     public void updateTabCountAndAnimate(int count) {
+        // Don't animate if the toolbar is hidden.
+        if (!isVisible()) {
+            updateTabCount(count);
+            return;
+        }
+
         if (mCount > count) {
             mTabsCount.setInAnimation(mSlideDownIn);
             mTabsCount.setOutAnimation(mSlideDownOut);
         } else if (mCount < count) {
             mTabsCount.setInAnimation(mSlideUpIn);
             mTabsCount.setOutAnimation(mSlideUpOut);
         } else {
             return;