diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2012-10-29 17:14:54 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-29 17:14:54 -0700 |
commit | ea5e56ad9c2324dd6fbeab64e031878e03122c40 (patch) | |
tree | 1793ce2e3afbaffb8fc2cb45ea63424fc4351eaa /core/java/android | |
parent | 8e32da8ef024cf5dc423c5734ba93dae7ea8c8a3 (diff) | |
parent | d31f0ab93f4f35a7ca6df6d428db2a5fd3d6750a (diff) | |
download | frameworks_base-ea5e56ad9c2324dd6fbeab64e031878e03122c40.zip frameworks_base-ea5e56ad9c2324dd6fbeab64e031878e03122c40.tar.gz frameworks_base-ea5e56ad9c2324dd6fbeab64e031878e03122c40.tar.bz2 |
am d31f0ab9: am 9d662c77: am 68b14054: Merge "Revert "Fix bug #7325234 LayoutParams are not resolved correctly (Settings apps looks broken on Manta in Arabic)"" into jb-mr1-dev
* commit 'd31f0ab93f4f35a7ca6df6d428db2a5fd3d6750a':
Revert "Fix bug #7325234 LayoutParams are not resolved correctly (Settings apps looks broken on Manta in Arabic)"
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/view/ViewGroup.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/FrameLayout.java | 5 | ||||
-rw-r--r-- | core/java/android/widget/LinearLayout.java | 6 | ||||
-rw-r--r-- | core/java/android/widget/RelativeLayout.java | 7 | ||||
-rw-r--r-- | core/java/android/widget/ScrollView.java | 2 | ||||
-rw-r--r-- | core/java/android/widget/TableRow.java | 5 |
6 files changed, 3 insertions, 24 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 8b6b814..ad28f7b 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -4907,8 +4907,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed) { final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams(); - final int layoutDirection = getLayoutDirection(); - lp.resolveLayoutDirection(layoutDirection); final int childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec, mPaddingLeft + mPaddingRight + lp.leftMargin + lp.rightMargin diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java index e158776..738f63b 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -304,16 +304,11 @@ public class FrameLayout extends ViewGroup { int maxWidth = 0; int childState = 0; - final int layoutDirection = getLayoutDirection(); - for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (mMeasureAllChildren || child.getVisibility() != GONE) { measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0); - // measureChildWithMargins() has triggered layout params resolution, so no need - // to do it now final LayoutParams lp = (LayoutParams) child.getLayoutParams(); - maxWidth = Math.max(maxWidth, child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin); maxHeight = Math.max(maxHeight, diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index abf2756..ea8ee79 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -648,8 +648,6 @@ public class LinearLayout extends ViewGroup { int largestChildHeight = Integer.MIN_VALUE; - final int layoutDirection = getLayoutDirection(); - // See how tall everyone is. Also remember max width. for (int i = 0; i < count; ++i) { final View child = getVirtualChildAt(i); @@ -669,7 +667,6 @@ public class LinearLayout extends ViewGroup { } LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) child.getLayoutParams(); - lp.resolveLayoutDirection(layoutDirection); totalWeight += lp.weight; @@ -992,8 +989,6 @@ public class LinearLayout extends ViewGroup { int largestChildWidth = Integer.MIN_VALUE; - final int layoutDirection = getLayoutDirection(); - // See how wide everyone is. Also remember max height. for (int i = 0; i < count; ++i) { final View child = getVirtualChildAt(i); @@ -1014,7 +1009,6 @@ public class LinearLayout extends ViewGroup { final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) child.getLayoutParams(); - lp.resolveLayoutDirection(layoutDirection); totalWeight += lp.weight; diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index de5b369..3d1b6b3 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -414,15 +414,12 @@ public class RelativeLayout extends ViewGroup { final boolean isWrapContentWidth = widthMode != MeasureSpec.EXACTLY; final boolean isWrapContentHeight = heightMode != MeasureSpec.EXACTLY; - final int layoutDirection = getLayoutDirection(); - View[] views = mSortedHorizontalChildren; int count = views.length; for (int i = 0; i < count; i++) { View child = views[i]; if (child.getVisibility() != GONE) { LayoutParams params = (LayoutParams) child.getLayoutParams(); - params.resolveLayoutDirection(layoutDirection); applyHorizontalSizeRules(params, myWidth); measureChildHorizontal(child, params, myWidth, myHeight); @@ -486,6 +483,8 @@ public class RelativeLayout extends ViewGroup { } } + final int layoutDirection = getLayoutDirection(); + if (isWrapContentWidth) { // Width already has left padding in it since it was calculated by looking at // the right of each child view @@ -742,7 +741,6 @@ public class RelativeLayout extends ViewGroup { final int layoutDirection = getLayoutDirection(); int[] rules = params.getRules(layoutDirection); - params.resolveLayoutDirection(layoutDirection); if (params.mLeft < 0 && params.mRight >= 0) { // Right is fixed, but left varies @@ -996,7 +994,6 @@ public class RelativeLayout extends ViewGroup { if (child.getVisibility() != GONE) { RelativeLayout.LayoutParams st = (RelativeLayout.LayoutParams) child.getLayoutParams(); - st.resolveLayoutDirection(getLayoutDirection()); child.layout(st.mLeft, st.mTop, st.mRight, st.mBottom); } } diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java index 1def89f..bc41931 100644 --- a/core/java/android/widget/ScrollView.java +++ b/core/java/android/widget/ScrollView.java @@ -329,13 +329,11 @@ public class ScrollView extends FrameLayout { return; } - final int layoutDirection = getLayoutDirection(); if (getChildCount() > 0) { final View child = getChildAt(0); int height = getMeasuredHeight(); if (child.getMeasuredHeight() < height) { final FrameLayout.LayoutParams lp = (LayoutParams) child.getLayoutParams(); - lp.resolveLayoutDirection(layoutDirection); int childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec, mPaddingLeft + mPaddingRight, lp.width); diff --git a/core/java/android/widget/TableRow.java b/core/java/android/widget/TableRow.java index a8cc406..fe3631a 100644 --- a/core/java/android/widget/TableRow.java +++ b/core/java/android/widget/TableRow.java @@ -192,9 +192,7 @@ public class TableRow extends LinearLayout { int widthMeasureSpec, int totalWidth, int heightMeasureSpec, int totalHeight) { if (mConstrainedColumnWidths != null) { - final int layoutDirection = getLayoutDirection(); final LayoutParams lp = (LayoutParams) child.getLayoutParams(); - lp.resolveLayoutDirection(layoutDirection); int measureMode = MeasureSpec.EXACTLY; int columnWidth = 0; @@ -228,6 +226,7 @@ public class TableRow extends LinearLayout { final int childWidth = child.getMeasuredWidth(); lp.mOffset[LayoutParams.LOCATION_NEXT] = columnWidth - childWidth; + final int layoutDirection = getLayoutDirection(); final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection); switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) { case Gravity.LEFT: @@ -293,13 +292,11 @@ public class TableRow extends LinearLayout { } final int[] columnWidths = mColumnWidths; - final int layoutDirection = getLayoutDirection(); for (int i = 0; i < numColumns; i++) { final View child = getVirtualChildAt(i); if (child != null && child.getVisibility() != GONE) { final LayoutParams layoutParams = (LayoutParams) child.getLayoutParams(); - layoutParams.resolveLayoutDirection(layoutDirection); if (layoutParams.span == 1) { int spec; switch (layoutParams.width) { |