diff options
| author | 2015-08-04 19:51:20 +0000 | |
|---|---|---|
| committer | 2015-08-04 19:51:20 +0000 | |
| commit | 2d34a8b7181635c0ff0b1f2390d70e3ac6960f00 (patch) | |
| tree | abd5b422f78e70027aa1847e642accd7e54100e7 | |
| parent | 97b68bbe7180ca15ab10d6f65bbdac6c7e64885b (diff) | |
| parent | d2e5647681fd09f6ceedd016a554148fe1f087c5 (diff) | |
Merge "Revert "Do not forceLayout when window is resized"" into mnc-dev
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 928fe93d7e56..6e93a3031de5 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -3159,6 +3159,17 @@ public final class ViewRootImpl implements ViewParent, return (theParent instanceof ViewGroup) && isViewDescendantOf((View) theParent, parent); } + private static void forceLayout(View view) { + view.forceLayout(); + if (view instanceof ViewGroup) { + ViewGroup group = (ViewGroup) view; + final int count = group.getChildCount(); + for (int i = 0; i < count; i++) { + forceLayout(group.getChildAt(i)); + } + } + } + private final static int MSG_INVALIDATE = 1; private final static int MSG_INVALIDATE_RECT = 2; private final static int MSG_DIE = 3; @@ -3297,6 +3308,10 @@ public final class ViewRootImpl implements ViewParent, mReportNextDraw = true; } + if (mView != null) { + forceLayout(mView); + } + requestLayout(); } break; @@ -3311,6 +3326,9 @@ public final class ViewRootImpl implements ViewParent, mWinFrame.top = t; mWinFrame.bottom = t + h; + if (mView != null) { + forceLayout(mView); + } requestLayout(); } break; |