From b6ec2afe9710112214d79b36b2233fef6a52845a Mon Sep 17 00:00:00 2001 From: Mark Wei Date: Sun, 8 Dec 2013 04:34:27 -0800 Subject: Allow placeholder drawable to be sized by the client. First try to use the bounds, then try to use the intrinsic bounds. When a key is null, set load state to FAILED instead of UNINITIALIZED. The difference is that FAILED shows the placeholder as a static image while UNINITIALIZED hides it. Fix bug in BitmapDrawableImageView where detaching from the window would set its drawable to null, throwing away state. Change-Id: I0b3f6c931d750ec4042e13bc1cbcf2d63e260168 --- src/com/android/bitmap/view/BitmapDrawableImageView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/com/android/bitmap/view') diff --git a/src/com/android/bitmap/view/BitmapDrawableImageView.java b/src/com/android/bitmap/view/BitmapDrawableImageView.java index a55b864..b776c34 100644 --- a/src/com/android/bitmap/view/BitmapDrawableImageView.java +++ b/src/com/android/bitmap/view/BitmapDrawableImageView.java @@ -67,7 +67,6 @@ public class BitmapDrawableImageView extends ImageView { private void unbindDrawable() { if (mDrawable != null) { mDrawable.unbind(); - mDrawable = null; } } @@ -75,24 +74,28 @@ public class BitmapDrawableImageView extends ImageView { public void setImageResource(final int resId) { super.setImageResource(resId); unbindDrawable(); + mDrawable = null; } @Override public void setImageURI(final Uri uri) { super.setImageURI(uri); unbindDrawable(); + mDrawable = null; } @Override public void setImageDrawable(final Drawable drawable) { super.setImageDrawable(drawable); unbindDrawable(); + mDrawable = null; } @Override public void setImageBitmap(final Bitmap bm) { super.setImageBitmap(bm); unbindDrawable(); + mDrawable = null; } @Override -- cgit v1.2.3