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

Commit e9234dd1 authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am 075bb6b3: Merge "DO NOT MERGE - Revert fixes for...

am 075bb6b3: Merge "DO NOT MERGE - Revert fixes for ImageView/MeasureSpec/RelativeLayout" into jb-mr1-dev

* commit '075bb6b3':
  DO NOT MERGE - Revert fixes for ImageView/MeasureSpec/RelativeLayout
parents ba66dc3b 075bb6b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17234,7 +17234,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
         * @return the measure specification based on size and mode
         */
        public static int makeMeasureSpec(int size, int mode) {
            return (size & ~MODE_MASK) | (mode & MODE_MASK);
            return size + mode;
        }
        /**
+0 −13
Original line number Diff line number Diff line
@@ -789,12 +789,6 @@ public class ImageView extends View {
                    if (resizeWidth) {
                        int newWidth = (int)(desiredAspect * (heightSize - ptop - pbottom)) +
                                pleft + pright;

                        // Allow the width to outgrow its original estimate if height is fixed.
                        if (!resizeHeight) {
                            widthSize = resolveAdjustedSize(newWidth, mMaxWidth, widthMeasureSpec);
                        }

                        if (newWidth <= widthSize) {
                            widthSize = newWidth;
                            done = true;
@@ -805,13 +799,6 @@ public class ImageView extends View {
                    if (!done && resizeHeight) {
                        int newHeight = (int)((widthSize - pleft - pright) / desiredAspect) +
                                ptop + pbottom;

                        // Allow the height to outgrow its original estimate if width is fixed.
                        if (!resizeWidth) {
                            heightSize = resolveAdjustedSize(newHeight, mMaxHeight,
                                    heightMeasureSpec);
                        }

                        if (newHeight <= heightSize) {
                            heightSize = newHeight;
                        }
+5 −17
Original line number Diff line number Diff line
@@ -369,10 +369,10 @@ public class RelativeLayout extends ViewGroup {
        int width = 0;
        int height = 0;

        final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
        final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
        final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
        final int heightSize = MeasureSpec.getSize(heightMeasureSpec);
        int widthMode = MeasureSpec.getMode(widthMeasureSpec);
        int heightMode = MeasureSpec.getMode(heightMeasureSpec);
        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
        int heightSize = MeasureSpec.getSize(heightMeasureSpec);

        // Record our dimensions if they are known;
        if (widthMode != MeasureSpec.UNSPECIFIED) {
@@ -637,12 +637,7 @@ public class RelativeLayout extends ViewGroup {
                mPaddingLeft, mPaddingRight,
                myWidth);
        int childHeightMeasureSpec;
        if (myHeight < 0) {
            // Negative values in a mySize/myWidth/myWidth value in RelativeLayout measurement
            // is code for, "we got an unspecified mode in the RelativeLayout's measurespec."
            // Carry it forward.
            childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
        } else if (params.width == LayoutParams.MATCH_PARENT) {
        if (params.width == LayoutParams.MATCH_PARENT) {
            childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(myHeight, MeasureSpec.EXACTLY);
        } else {
            childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(myHeight, MeasureSpec.AT_MOST);
@@ -669,13 +664,6 @@ public class RelativeLayout extends ViewGroup {
    private int getChildMeasureSpec(int childStart, int childEnd,
            int childSize, int startMargin, int endMargin, int startPadding,
            int endPadding, int mySize) {
        if (mySize < 0) {
            // Negative values in a mySize/myWidth/myWidth value in RelativeLayout measurement
            // is code for, "we got an unspecified mode in the RelativeLayout's measurespec."
            // Carry it forward.
            return MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
        }

        int childSpecMode = 0;
        int childSpecSize = 0;