am bf184875: Merge "Fix adjustViewBounds handling for ImageView" into jb-mr1-dev

* commit 'bf184875ef4dc41024474840641c6fc9d3a9e975':
  Fix adjustViewBounds handling for ImageView
This commit is contained in:
Adam Powell
2012-09-26 15:30:46 -07:00
committed by Android Git Automerger

View File

@@ -789,6 +789,7 @@ public class ImageView extends View {
if (resizeWidth) {
int newWidth = (int)(desiredAspect * (heightSize - ptop - pbottom)) +
pleft + pright;
widthSize = resolveAdjustedSize(newWidth, mMaxWidth, widthMeasureSpec);
if (newWidth <= widthSize) {
widthSize = newWidth;
done = true;
@@ -799,6 +800,7 @@ public class ImageView extends View {
if (!done && resizeHeight) {
int newHeight = (int)((widthSize - pleft - pright) / desiredAspect) +
ptop + pbottom;
heightSize = resolveAdjustedSize(newHeight, mMaxHeight, heightMeasureSpec);
if (newHeight <= heightSize) {
heightSize = newHeight;
}