Loading core/java/android/view/View.java +1 −1 Original line number Diff line number Diff line Loading @@ -17208,7 +17208,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; return (size & ~MODE_MASK) | (mode & MODE_MASK); } /** core/java/android/widget/ImageView.java +13 −0 Original line number Diff line number Diff line Loading @@ -789,6 +789,12 @@ 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; Loading @@ -799,6 +805,13 @@ 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; } Loading Loading
core/java/android/view/View.java +1 −1 Original line number Diff line number Diff line Loading @@ -17208,7 +17208,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; return (size & ~MODE_MASK) | (mode & MODE_MASK); } /**
core/java/android/widget/ImageView.java +13 −0 Original line number Diff line number Diff line Loading @@ -789,6 +789,12 @@ 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; Loading @@ -799,6 +805,13 @@ 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; } Loading