Bug 1179195 - [TABLET] Swipe to close a tab from tab panel animation is busted after performing specific scenario. r=rnewman, a=ritu
authorMartyn Haigh <mhaigh@mozilla.org>
Thu, 02 Jul 2015 14:58:12 +0100
changeset 281810 9f9255fa45c0f9a1b68167913254134159f65bce
parent 281809 3fd7b9eddf11af140496f564a537f021e4d24ea6
child 281811 c05f7ddf3df68b0c7f529652e98c2276fc73a7d5
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, ritu
bugs1179195
milestone41.0a2
Bug 1179195 - [TABLET] Swipe to close a tab from tab panel animation is busted after performing specific scenario. r=rnewman, a=ritu
mobile/android/base/tabs/TabsGridLayout.java
--- a/mobile/android/base/tabs/TabsGridLayout.java
+++ b/mobile/android/base/tabs/TabsGridLayout.java
@@ -153,16 +153,19 @@ class TabsGridLayout extends GridView
         final int lastPosition = getLastVisiblePosition();
         final int numberOfColumns = getNumColumns();
         final int childCount = getChildCount();
         final int removedPosition = mTabsAdapter.getPositionForTab(removedTab);
 
         for (int x = 1, i = (removedPosition - firstPosition) + 1; i < childCount; i++, x++) {
             final View child = getChildAt(i);
             if (child != null) {
+                // Reset the transformations here in case the user is swiping tabs away fast and they swipe a tab
+                // before the last animation has finished (bug 1179195).
+                resetTransforms(child);
                 mTabLocations.append(x, new PointF(child.getX(), child.getY()));
             }
         }
 
         final boolean firstChildOffScreen = ((firstPosition > 0) || getChildAt(0).getY() < 0);
         final boolean lastChildVisible = (lastPosition - childCount == firstPosition - 1);
         final boolean oneItemOnLastRow = (lastPosition % numberOfColumns == 0);
         if (firstChildOffScreen && lastChildVisible && oneItemOnLastRow) {