Bug 1010986 - Force layout on child once swipe refresh layout is re-attached. r=mfinkle, a=lmandel
authorLucas Rocha <lucasr@mozilla.com>
Fri, 04 Jul 2014 11:52:10 +0100
changeset 207849 66788ae23537711c82e2e672452ceb9e4503e7cf
parent 207848 94b82dd392bf56c27c9cfd78fc2d5a79698e8cdb
child 207850 a2ee1d8b0f0ce10140a0f42ed041108133baf16f
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, lmandel
bugs1010986
milestone32.0a2
Bug 1010986 - Force layout on child once swipe refresh layout is re-attached. r=mfinkle, a=lmandel
mobile/android/base/widget/GeckoSwipeRefreshLayout.java
--- a/mobile/android/base/widget/GeckoSwipeRefreshLayout.java
+++ b/mobile/android/base/widget/GeckoSwipeRefreshLayout.java
@@ -191,16 +191,22 @@ public class GeckoSwipeRefreshLayout ext
         a.recycle();
     }
 
     @Override
     public void onAttachedToWindow() {
         super.onAttachedToWindow();
         removeCallbacks(mCancel);
         removeCallbacks(mReturnToStartPosition);
+
+        // Sometimes the inner view doesn't get a proper layout
+        // pass when re-attached to the view tree (see bug 1010986).
+        if (getChildCount() > 0) {
+            getChildAt(0).forceLayout();
+        }
     }
 
     @Override
     public void onDetachedFromWindow() {
         super.onDetachedFromWindow();
         removeCallbacks(mReturnToStartPosition);
         removeCallbacks(mCancel);
     }