Skip to content

Commit bf18487

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Fix adjustViewBounds handling for ImageView" into jb-mr1-dev
2 parents 51ce160 + b1271ac commit bf18487

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/java/android/widget/ImageView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
789789
if (resizeWidth) {
790790
int newWidth = (int)(desiredAspect * (heightSize - ptop - pbottom)) +
791791
pleft + pright;
792+
widthSize = resolveAdjustedSize(newWidth, mMaxWidth, widthMeasureSpec);
792793
if (newWidth <= widthSize) {
793794
widthSize = newWidth;
794795
done = true;
@@ -799,6 +800,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
799800
if (!done && resizeHeight) {
800801
int newHeight = (int)((widthSize - pleft - pright) / desiredAspect) +
801802
ptop + pbottom;
803+
heightSize = resolveAdjustedSize(newHeight, mMaxHeight, heightMeasureSpec);
802804
if (newHeight <= heightSize) {
803805
heightSize = newHeight;
804806
}

0 commit comments

Comments
 (0)