diff options
author | Romain Guy <romainguy@google.com> | 2013-05-15 11:02:25 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2013-05-15 11:02:25 -0700 |
commit | 398051b8ee658c70c39dee04534edf6c968dffdd (patch) | |
tree | 169a92eb07f02959ca695be85e864a72ab9dc14b | |
parent | c979d9c0084d8fb7e3f2e480acae2da22cf2e5cf (diff) | |
download | frameworks_base-398051b8ee658c70c39dee04534edf6c968dffdd.zip frameworks_base-398051b8ee658c70c39dee04534edf6c968dffdd.tar.gz frameworks_base-398051b8ee658c70c39dee04534edf6c968dffdd.tar.bz2 |
Revert "Reduce the number of measurement passes in RelativeLayout"
This reverts commit 4cb81d6423ab15ce97575699e5fbc765322ba699.
-rw-r--r-- | core/java/android/widget/RelativeLayout.java | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index f724e52..f940226 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -695,20 +695,6 @@ public class RelativeLayout extends ViewGroup { params.topMargin, params.bottomMargin, mPaddingTop, mPaddingBottom, myHeight); - if (params.mPreviousWidthSpec == childWidthMeasureSpec && !child.isLayoutRequested()) { - switch (MeasureSpec.getMode(childHeightMeasureSpec)) { - case MeasureSpec.EXACTLY: - if (child.getMeasuredHeight() == MeasureSpec.getSize(childHeightMeasureSpec)) { - return; - } - break; - case MeasureSpec.AT_MOST: - if (child.getMeasuredHeight() <= MeasureSpec.getSize(childHeightMeasureSpec)) { - return; - } - break; - } - } child.measure(childWidthMeasureSpec, childHeightMeasureSpec); } @@ -740,7 +726,6 @@ public class RelativeLayout extends ViewGroup { childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(maxHeight, MeasureSpec.AT_MOST); } child.measure(childWidthMeasureSpec, childHeightMeasureSpec); - params.mPreviousWidthSpec = childWidthMeasureSpec; } /** @@ -915,6 +900,8 @@ public class RelativeLayout extends ViewGroup { } else if (childParams.alignWithParent && rules[LEFT_OF] != 0) { if (myWidth >= 0) { childParams.mRight = myWidth - mPaddingRight - childParams.rightMargin; + } else { + // FIXME uh oh... } } @@ -939,6 +926,8 @@ public class RelativeLayout extends ViewGroup { } else if (childParams.alignWithParent && rules[ALIGN_RIGHT] != 0) { if (myWidth >= 0) { childParams.mRight = myWidth - mPaddingRight - childParams.rightMargin; + } else { + // FIXME uh oh... } } @@ -949,6 +938,8 @@ public class RelativeLayout extends ViewGroup { if (0 != rules[ALIGN_PARENT_RIGHT]) { if (myWidth >= 0) { childParams.mRight = myWidth - mPaddingRight - childParams.rightMargin; + } else { + // FIXME uh oh... } } } @@ -967,6 +958,8 @@ public class RelativeLayout extends ViewGroup { } else if (childParams.alignWithParent && rules[ABOVE] != 0) { if (myHeight >= 0) { childParams.mBottom = myHeight - mPaddingBottom - childParams.bottomMargin; + } else { + // FIXME uh oh... } } @@ -991,6 +984,8 @@ public class RelativeLayout extends ViewGroup { } else if (childParams.alignWithParent && rules[ALIGN_BOTTOM] != 0) { if (myHeight >= 0) { childParams.mBottom = myHeight - mPaddingBottom - childParams.bottomMargin; + } else { + // FIXME uh oh... } } @@ -1001,6 +996,8 @@ public class RelativeLayout extends ViewGroup { if (0 != rules[ALIGN_PARENT_BOTTOM]) { if (myHeight >= 0) { childParams.mBottom = myHeight - mPaddingBottom - childParams.bottomMargin; + } else { + // FIXME uh oh... } } @@ -1245,8 +1242,6 @@ public class RelativeLayout extends ViewGroup { @ViewDebug.ExportedProperty(category = "layout") public boolean alignWithParent; - int mPreviousWidthSpec; - public LayoutParams(Context c, AttributeSet attrs) { super(c, attrs); |