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 '9d662c77650a1cee9d05ad93743684482eeba935': Revert "Fix bug #7325234 LayoutParams are not resolved correctly (Settings apps looks broken on Manta in Arabic)"
This commit is contained in:
@@ -4816,8 +4816,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
|||||||
int parentWidthMeasureSpec, int widthUsed,
|
int parentWidthMeasureSpec, int widthUsed,
|
||||||
int parentHeightMeasureSpec, int heightUsed) {
|
int parentHeightMeasureSpec, int heightUsed) {
|
||||||
final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
|
final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
lp.resolveLayoutDirection(layoutDirection);
|
|
||||||
|
|
||||||
final int childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec,
|
final int childWidthMeasureSpec = getChildMeasureSpec(parentWidthMeasureSpec,
|
||||||
mPaddingLeft + mPaddingRight + lp.leftMargin + lp.rightMargin
|
mPaddingLeft + mPaddingRight + lp.leftMargin + lp.rightMargin
|
||||||
|
|||||||
@@ -304,16 +304,11 @@ public class FrameLayout extends ViewGroup {
|
|||||||
int maxWidth = 0;
|
int maxWidth = 0;
|
||||||
int childState = 0;
|
int childState = 0;
|
||||||
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
final View child = getChildAt(i);
|
final View child = getChildAt(i);
|
||||||
if (mMeasureAllChildren || child.getVisibility() != GONE) {
|
if (mMeasureAllChildren || child.getVisibility() != GONE) {
|
||||||
measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0);
|
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();
|
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
|
||||||
|
|
||||||
maxWidth = Math.max(maxWidth,
|
maxWidth = Math.max(maxWidth,
|
||||||
child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin);
|
child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin);
|
||||||
maxHeight = Math.max(maxHeight,
|
maxHeight = Math.max(maxHeight,
|
||||||
|
|||||||
@@ -648,8 +648,6 @@ public class LinearLayout extends ViewGroup {
|
|||||||
|
|
||||||
int largestChildHeight = Integer.MIN_VALUE;
|
int largestChildHeight = Integer.MIN_VALUE;
|
||||||
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
|
|
||||||
// See how tall everyone is. Also remember max width.
|
// See how tall everyone is. Also remember max width.
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
final View child = getVirtualChildAt(i);
|
final View child = getVirtualChildAt(i);
|
||||||
@@ -669,7 +667,6 @@ public class LinearLayout extends ViewGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) child.getLayoutParams();
|
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) child.getLayoutParams();
|
||||||
lp.resolveLayoutDirection(layoutDirection);
|
|
||||||
|
|
||||||
totalWeight += lp.weight;
|
totalWeight += lp.weight;
|
||||||
|
|
||||||
@@ -992,8 +989,6 @@ public class LinearLayout extends ViewGroup {
|
|||||||
|
|
||||||
int largestChildWidth = Integer.MIN_VALUE;
|
int largestChildWidth = Integer.MIN_VALUE;
|
||||||
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
|
|
||||||
// See how wide everyone is. Also remember max height.
|
// See how wide everyone is. Also remember max height.
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
final View child = getVirtualChildAt(i);
|
final View child = getVirtualChildAt(i);
|
||||||
@@ -1014,7 +1009,6 @@ public class LinearLayout extends ViewGroup {
|
|||||||
|
|
||||||
final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
|
final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams)
|
||||||
child.getLayoutParams();
|
child.getLayoutParams();
|
||||||
lp.resolveLayoutDirection(layoutDirection);
|
|
||||||
|
|
||||||
totalWeight += lp.weight;
|
totalWeight += lp.weight;
|
||||||
|
|
||||||
|
|||||||
@@ -414,15 +414,12 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
final boolean isWrapContentWidth = widthMode != MeasureSpec.EXACTLY;
|
final boolean isWrapContentWidth = widthMode != MeasureSpec.EXACTLY;
|
||||||
final boolean isWrapContentHeight = heightMode != MeasureSpec.EXACTLY;
|
final boolean isWrapContentHeight = heightMode != MeasureSpec.EXACTLY;
|
||||||
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
|
|
||||||
View[] views = mSortedHorizontalChildren;
|
View[] views = mSortedHorizontalChildren;
|
||||||
int count = views.length;
|
int count = views.length;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
View child = views[i];
|
View child = views[i];
|
||||||
if (child.getVisibility() != GONE) {
|
if (child.getVisibility() != GONE) {
|
||||||
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
||||||
params.resolveLayoutDirection(layoutDirection);
|
|
||||||
|
|
||||||
applyHorizontalSizeRules(params, myWidth);
|
applyHorizontalSizeRules(params, myWidth);
|
||||||
measureChildHorizontal(child, params, myWidth, myHeight);
|
measureChildHorizontal(child, params, myWidth, myHeight);
|
||||||
@@ -486,6 +483,8 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final int layoutDirection = getLayoutDirection();
|
||||||
|
|
||||||
if (isWrapContentWidth) {
|
if (isWrapContentWidth) {
|
||||||
// Width already has left padding in it since it was calculated by looking at
|
// Width already has left padding in it since it was calculated by looking at
|
||||||
// the right of each child view
|
// the right of each child view
|
||||||
@@ -730,7 +729,6 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
final int layoutDirection = getLayoutDirection();
|
||||||
int[] rules = params.getRules(layoutDirection);
|
int[] rules = params.getRules(layoutDirection);
|
||||||
params.resolveLayoutDirection(layoutDirection);
|
|
||||||
|
|
||||||
if (params.mLeft < 0 && params.mRight >= 0) {
|
if (params.mLeft < 0 && params.mRight >= 0) {
|
||||||
// Right is fixed, but left varies
|
// Right is fixed, but left varies
|
||||||
@@ -984,7 +982,6 @@ public class RelativeLayout extends ViewGroup {
|
|||||||
if (child.getVisibility() != GONE) {
|
if (child.getVisibility() != GONE) {
|
||||||
RelativeLayout.LayoutParams st =
|
RelativeLayout.LayoutParams st =
|
||||||
(RelativeLayout.LayoutParams) child.getLayoutParams();
|
(RelativeLayout.LayoutParams) child.getLayoutParams();
|
||||||
st.resolveLayoutDirection(getLayoutDirection());
|
|
||||||
child.layout(st.mLeft, st.mTop, st.mRight, st.mBottom);
|
child.layout(st.mLeft, st.mTop, st.mRight, st.mBottom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -329,13 +329,11 @@ public class ScrollView extends FrameLayout {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
if (getChildCount() > 0) {
|
if (getChildCount() > 0) {
|
||||||
final View child = getChildAt(0);
|
final View child = getChildAt(0);
|
||||||
int height = getMeasuredHeight();
|
int height = getMeasuredHeight();
|
||||||
if (child.getMeasuredHeight() < height) {
|
if (child.getMeasuredHeight() < height) {
|
||||||
final FrameLayout.LayoutParams lp = (LayoutParams) child.getLayoutParams();
|
final FrameLayout.LayoutParams lp = (LayoutParams) child.getLayoutParams();
|
||||||
lp.resolveLayoutDirection(layoutDirection);
|
|
||||||
|
|
||||||
int childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
|
int childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
|
||||||
mPaddingLeft + mPaddingRight, lp.width);
|
mPaddingLeft + mPaddingRight, lp.width);
|
||||||
|
|||||||
@@ -192,9 +192,7 @@ public class TableRow extends LinearLayout {
|
|||||||
int widthMeasureSpec, int totalWidth,
|
int widthMeasureSpec, int totalWidth,
|
||||||
int heightMeasureSpec, int totalHeight) {
|
int heightMeasureSpec, int totalHeight) {
|
||||||
if (mConstrainedColumnWidths != null) {
|
if (mConstrainedColumnWidths != null) {
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
|
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
|
||||||
lp.resolveLayoutDirection(layoutDirection);
|
|
||||||
|
|
||||||
int measureMode = MeasureSpec.EXACTLY;
|
int measureMode = MeasureSpec.EXACTLY;
|
||||||
int columnWidth = 0;
|
int columnWidth = 0;
|
||||||
@@ -228,6 +226,7 @@ public class TableRow extends LinearLayout {
|
|||||||
final int childWidth = child.getMeasuredWidth();
|
final int childWidth = child.getMeasuredWidth();
|
||||||
lp.mOffset[LayoutParams.LOCATION_NEXT] = columnWidth - childWidth;
|
lp.mOffset[LayoutParams.LOCATION_NEXT] = columnWidth - childWidth;
|
||||||
|
|
||||||
|
final int layoutDirection = getLayoutDirection();
|
||||||
final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection);
|
final int absoluteGravity = Gravity.getAbsoluteGravity(gravity, layoutDirection);
|
||||||
switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
|
switch (absoluteGravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
|
||||||
case Gravity.LEFT:
|
case Gravity.LEFT:
|
||||||
@@ -293,13 +292,11 @@ public class TableRow extends LinearLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int[] columnWidths = mColumnWidths;
|
final int[] columnWidths = mColumnWidths;
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
|
|
||||||
for (int i = 0; i < numColumns; i++) {
|
for (int i = 0; i < numColumns; i++) {
|
||||||
final View child = getVirtualChildAt(i);
|
final View child = getVirtualChildAt(i);
|
||||||
if (child != null && child.getVisibility() != GONE) {
|
if (child != null && child.getVisibility() != GONE) {
|
||||||
final LayoutParams layoutParams = (LayoutParams) child.getLayoutParams();
|
final LayoutParams layoutParams = (LayoutParams) child.getLayoutParams();
|
||||||
layoutParams.resolveLayoutDirection(layoutDirection);
|
|
||||||
if (layoutParams.span == 1) {
|
if (layoutParams.span == 1) {
|
||||||
int spec;
|
int spec;
|
||||||
switch (layoutParams.width) {
|
switch (layoutParams.width) {
|
||||||
|
|||||||
@@ -343,11 +343,9 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
|
|||||||
final int height = maxHeight - verticalPadding;
|
final int height = maxHeight - verticalPadding;
|
||||||
final int childSpecHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);
|
final int childSpecHeight = MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);
|
||||||
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
if (mClose != null) {
|
if (mClose != null) {
|
||||||
availableWidth = measureChildView(mClose, availableWidth, childSpecHeight, 0);
|
availableWidth = measureChildView(mClose, availableWidth, childSpecHeight, 0);
|
||||||
MarginLayoutParams lp = (MarginLayoutParams) mClose.getLayoutParams();
|
MarginLayoutParams lp = (MarginLayoutParams) mClose.getLayoutParams();
|
||||||
lp.resolveLayoutDirection(layoutDirection);
|
|
||||||
availableWidth -= lp.leftMargin + lp.rightMargin;
|
availableWidth -= lp.leftMargin + lp.rightMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -946,9 +946,6 @@ public class ActionBarView extends AbsActionBarView {
|
|||||||
final ActionBar.LayoutParams ablp = lp instanceof ActionBar.LayoutParams ?
|
final ActionBar.LayoutParams ablp = lp instanceof ActionBar.LayoutParams ?
|
||||||
(ActionBar.LayoutParams) lp : null;
|
(ActionBar.LayoutParams) lp : null;
|
||||||
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
lp.resolveLayoutDirection(layoutDirection);
|
|
||||||
|
|
||||||
int horizontalMargin = 0;
|
int horizontalMargin = 0;
|
||||||
int verticalMargin = 0;
|
int verticalMargin = 0;
|
||||||
if (ablp != null) {
|
if (ablp != null) {
|
||||||
@@ -1099,9 +1096,8 @@ public class ActionBarView extends AbsActionBarView {
|
|||||||
customView = mCustomNavView;
|
customView = mCustomNavView;
|
||||||
}
|
}
|
||||||
if (customView != null) {
|
if (customView != null) {
|
||||||
ViewGroup.LayoutParams lp = customView.getLayoutParams();
|
|
||||||
final int layoutDirection = getLayoutDirection();
|
final int layoutDirection = getLayoutDirection();
|
||||||
lp.resolveLayoutDirection(layoutDirection);
|
ViewGroup.LayoutParams lp = customView.getLayoutParams();
|
||||||
final ActionBar.LayoutParams ablp = lp instanceof ActionBar.LayoutParams ?
|
final ActionBar.LayoutParams ablp = lp instanceof ActionBar.LayoutParams ?
|
||||||
(ActionBar.LayoutParams) lp : null;
|
(ActionBar.LayoutParams) lp : null;
|
||||||
final int gravity = ablp != null ? ablp.gravity : DEFAULT_CUSTOM_GRAVITY;
|
final int gravity = ablp != null ? ablp.gravity : DEFAULT_CUSTOM_GRAVITY;
|
||||||
@@ -1339,15 +1335,11 @@ public class ActionBarView extends AbsActionBarView {
|
|||||||
@Override
|
@Override
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
measureChildWithMargins(mUpView, widthMeasureSpec, 0, heightMeasureSpec, 0);
|
measureChildWithMargins(mUpView, widthMeasureSpec, 0, heightMeasureSpec, 0);
|
||||||
// measureChildWithMargins() has triggered layout params resolution, so no need
|
|
||||||
// to do it now
|
|
||||||
final LayoutParams upLp = (LayoutParams) mUpView.getLayoutParams();
|
final LayoutParams upLp = (LayoutParams) mUpView.getLayoutParams();
|
||||||
mUpWidth = upLp.leftMargin + mUpView.getMeasuredWidth() + upLp.rightMargin;
|
mUpWidth = upLp.leftMargin + mUpView.getMeasuredWidth() + upLp.rightMargin;
|
||||||
int width = mUpView.getVisibility() == GONE ? 0 : mUpWidth;
|
int width = mUpView.getVisibility() == GONE ? 0 : mUpWidth;
|
||||||
int height = upLp.topMargin + mUpView.getMeasuredHeight() + upLp.bottomMargin;
|
int height = upLp.topMargin + mUpView.getMeasuredHeight() + upLp.bottomMargin;
|
||||||
measureChildWithMargins(mIconView, widthMeasureSpec, width, heightMeasureSpec, 0);
|
measureChildWithMargins(mIconView, widthMeasureSpec, width, heightMeasureSpec, 0);
|
||||||
// measureChildWithMargins() has triggered layout params resolution, so no need
|
|
||||||
// to do it now
|
|
||||||
final LayoutParams iconLp = (LayoutParams) mIconView.getLayoutParams();
|
final LayoutParams iconLp = (LayoutParams) mIconView.getLayoutParams();
|
||||||
width += iconLp.leftMargin + mIconView.getMeasuredWidth() + iconLp.rightMargin;
|
width += iconLp.leftMargin + mIconView.getMeasuredWidth() + iconLp.rightMargin;
|
||||||
height = Math.max(height,
|
height = Math.max(height,
|
||||||
@@ -1387,12 +1379,10 @@ public class ActionBarView extends AbsActionBarView {
|
|||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
final int vCenter = (b - t) / 2;
|
final int vCenter = (b - t) / 2;
|
||||||
final boolean isLayoutRtl = isLayoutRtl();
|
final boolean isLayoutRtl = isLayoutRtl();
|
||||||
final int layoutDirection = getLayoutDirection();
|
|
||||||
final int width = getWidth();
|
final int width = getWidth();
|
||||||
int upOffset = 0;
|
int upOffset = 0;
|
||||||
if (mUpView.getVisibility() != GONE) {
|
if (mUpView.getVisibility() != GONE) {
|
||||||
final LayoutParams upLp = (LayoutParams) mUpView.getLayoutParams();
|
final LayoutParams upLp = (LayoutParams) mUpView.getLayoutParams();
|
||||||
upLp.resolveLayoutDirection(layoutDirection);
|
|
||||||
final int upHeight = mUpView.getMeasuredHeight();
|
final int upHeight = mUpView.getMeasuredHeight();
|
||||||
final int upWidth = mUpView.getMeasuredWidth();
|
final int upWidth = mUpView.getMeasuredWidth();
|
||||||
upOffset = upLp.leftMargin + upWidth + upLp.rightMargin;
|
upOffset = upLp.leftMargin + upWidth + upLp.rightMargin;
|
||||||
@@ -1413,7 +1403,6 @@ public class ActionBarView extends AbsActionBarView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final LayoutParams iconLp = (LayoutParams) mIconView.getLayoutParams();
|
final LayoutParams iconLp = (LayoutParams) mIconView.getLayoutParams();
|
||||||
iconLp.resolveLayoutDirection(layoutDirection);
|
|
||||||
final int iconHeight = mIconView.getMeasuredHeight();
|
final int iconHeight = mIconView.getMeasuredHeight();
|
||||||
final int iconWidth = mIconView.getMeasuredWidth();
|
final int iconWidth = mIconView.getMeasuredWidth();
|
||||||
final int hCenter = (r - l) / 2;
|
final int hCenter = (r - l) / 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user