Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb4b6016 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Revert "Fix bug #7325234 LayoutParams are not resolved correctly (Settings...

Revert "Fix bug #7325234 LayoutParams are not resolved correctly (Settings apps looks broken on Manta in Arabic)"

This reverts commit 6bf6eb7d.
and also fbc21e12

I have also removed all unnecessary calls to resolveLayoutDirection(int). This is possible as
we are resolving layout params on every child of a ViewGroup as of commit
fcc3348f

Change-Id: I262a375b03fcc3c9261cbe2edebb6ec42ec2e186
parent f704e9f6
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -4817,8 +4817,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
+0 −5
Original line number Diff line number Diff line
@@ -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,
+0 −6
Original line number Diff line number Diff line
@@ -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;
            
+2 −5
Original line number Diff line number Diff line
@@ -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
@@ -730,7 +729,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
@@ -984,7 +982,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);
            }
        }
+0 −2
Original line number Diff line number Diff line
@@ -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);
Loading