Merge "Ensure ImageView.setImageResource() always resolves Drawable" into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a9ba2cdfc1
@@ -386,7 +386,8 @@ public class ImageView extends View {
|
|||||||
*/
|
*/
|
||||||
@android.view.RemotableViewMethod
|
@android.view.RemotableViewMethod
|
||||||
public void setImageResource(int resId) {
|
public void setImageResource(int resId) {
|
||||||
if (mUri != null || mResource != resId) {
|
// The resource configuration may have changed, so we should always
|
||||||
|
// try to load the resource even if the resId hasn't changed.
|
||||||
final int oldWidth = mDrawableWidth;
|
final int oldWidth = mDrawableWidth;
|
||||||
final int oldHeight = mDrawableHeight;
|
final int oldHeight = mDrawableHeight;
|
||||||
|
|
||||||
@@ -401,7 +402,6 @@ public class ImageView extends View {
|
|||||||
}
|
}
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the content of this ImageView to the specified Uri.
|
* Sets the content of this ImageView to the specified Uri.
|
||||||
|
|||||||
Reference in New Issue
Block a user