Merge "Fix adjustViewBounds handling for ImageView" into jb-mr1-dev
This commit is contained in:
@@ -789,6 +789,7 @@ public class ImageView extends View {
|
|||||||
if (resizeWidth) {
|
if (resizeWidth) {
|
||||||
int newWidth = (int)(desiredAspect * (heightSize - ptop - pbottom)) +
|
int newWidth = (int)(desiredAspect * (heightSize - ptop - pbottom)) +
|
||||||
pleft + pright;
|
pleft + pright;
|
||||||
|
widthSize = resolveAdjustedSize(newWidth, mMaxWidth, widthMeasureSpec);
|
||||||
if (newWidth <= widthSize) {
|
if (newWidth <= widthSize) {
|
||||||
widthSize = newWidth;
|
widthSize = newWidth;
|
||||||
done = true;
|
done = true;
|
||||||
@@ -799,6 +800,7 @@ public class ImageView extends View {
|
|||||||
if (!done && resizeHeight) {
|
if (!done && resizeHeight) {
|
||||||
int newHeight = (int)((widthSize - pleft - pright) / desiredAspect) +
|
int newHeight = (int)((widthSize - pleft - pright) / desiredAspect) +
|
||||||
ptop + pbottom;
|
ptop + pbottom;
|
||||||
|
heightSize = resolveAdjustedSize(newHeight, mMaxHeight, heightMeasureSpec);
|
||||||
if (newHeight <= heightSize) {
|
if (newHeight <= heightSize) {
|
||||||
heightSize = newHeight;
|
heightSize = newHeight;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user