OSDN Git Service

Merge \"Do a forceLayout if pending insets is changed after relayout window\" into...
authorChong Zhang <chz@google.com>
Sat, 18 Jun 2016 02:07:55 +0000 (02:07 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Sat, 18 Jun 2016 02:07:55 +0000 (02:07 +0000)
am: 2756d0707f

Change-Id: I72a8192317ebaa7c036416a65b415c2471f449de

core/java/android/view/ViewRootImpl.java

index 65f0caa..1186569 100644 (file)
@@ -1822,6 +1822,19 @@ public final class ViewRootImpl implements ViewParent,
                             + mAttachInfo.mVisibleInsets);
                 }
 
+                // If any of the insets changed, do a forceLayout on the view so that the
+                // measure cache is cleared. We might have a pending MSG_RESIZED_REPORT
+                // that is supposed to take care of it, but since pending insets are
+                // already modified here, it won't detect the frame change after this.
+                final boolean framesChanged = overscanInsetsChanged
+                        || contentInsetsChanged
+                        || stableInsetsChanged
+                        || visibleInsetsChanged
+                        || outsetsChanged;
+                if (mAdded && mView != null && framesChanged) {
+                    forceLayout(mView);
+                }
+
                 if (!hadSurface) {
                     if (mSurface.isValid()) {
                         // If we are creating a new surface, then we need to