diff options
| author | 2016-06-24 14:42:30 -0700 | |
|---|---|---|
| committer | 2016-06-24 14:47:06 -0700 | |
| commit | 76fdbb72c93a431e14357e0ea3d5a83edfa75c5e (patch) | |
| tree | 1333e1c3326593316d0f2122697607c1d3a76878 | |
| parent | 9c0c3d8d8b032544623c3098f3fb346186510f41 (diff) | |
Fix layout issue after insets changed
Fix a regression where a change in insets would forceLayout on the
view hierarchy but not run the measure/layout as a result. This would
cause layout requests to become stalled until a window-level relayout
event.
Bug 29634368
Change-Id: Ia3f32f5891c8b32c06c13f95ebd0572233572b04
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index b3daa16dd86f..195786dfcf2a 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1723,7 +1723,7 @@ public final class ViewRootImpl implements ViewParent,              }              boolean hwInitialized = false; -            boolean contentInsetsChanged = false; +            boolean framesChanged = false;              boolean hadSurface = mSurface.isValid();              try { @@ -1763,7 +1763,7 @@ public final class ViewRootImpl implements ViewParent,                  final boolean overscanInsetsChanged = !mPendingOverscanInsets.equals(                          mAttachInfo.mOverscanInsets); -                contentInsetsChanged = !mPendingContentInsets.equals( +                boolean contentInsetsChanged = !mPendingContentInsets.equals(                          mAttachInfo.mContentInsets);                  final boolean visibleInsetsChanged = !mPendingVisibleInsets.equals(                          mAttachInfo.mVisibleInsets); @@ -1817,7 +1817,7 @@ public final class ViewRootImpl implements ViewParent,                  // 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 +                framesChanged = overscanInsetsChanged                          || contentInsetsChanged                          || stableInsetsChanged                          || visibleInsetsChanged @@ -2009,7 +2009,7 @@ public final class ViewRootImpl implements ViewParent,                  boolean focusChangedDueToTouchMode = ensureTouchModeLocally(                          (relayoutResult&WindowManagerGlobal.RELAYOUT_RES_IN_TOUCH_MODE) != 0);                  if (focusChangedDueToTouchMode || mWidth != host.getMeasuredWidth() -                        || mHeight != host.getMeasuredHeight() || contentInsetsChanged || +                        || mHeight != host.getMeasuredHeight() || framesChanged ||                          updatedConfiguration) {                      int childWidthMeasureSpec = getRootMeasureSpec(mWidth, lp.width);                      int childHeightMeasureSpec = getRootMeasureSpec(mHeight, lp.height); @@ -2018,7 +2018,7 @@ public final class ViewRootImpl implements ViewParent,                              + mWidth + " measuredWidth=" + host.getMeasuredWidth()                              + " mHeight=" + mHeight                              + " measuredHeight=" + host.getMeasuredHeight() -                            + " coveredInsetsChanged=" + contentInsetsChanged); +                            + " framesChanged=" + framesChanged);                       // Ask host how big it wants to be                      performMeasure(childWidthMeasureSpec, childHeightMeasureSpec);  |