you can check that Loader display image for ImageAware finally
the code displayImage(String,ImageView) is below
public void displayImage(String uri, ImageView imageView) {
this.displayImage(uri, (ImageAware)(new ImageViewAware(imageView)), (DisplayImageOptions)null, (ImageLoadingListener)null, (ImageLoadingProgressListener)null);
}
And the ImageAware extends the abstract class ViewAware,here is the two important methods in it
protected abstract void setImageDrawableInto(Drawable var1, View var2);
protected abstract void setImageBitmapInto(Bitmap var1, View var2);
check the two method implement by ImageAware
protected void setImageDrawableInto(Drawable drawable, View view) {
((ImageView)view).setImageDrawable(drawable);
if(drawable instanceof AnimationDrawable) {
((AnimationDrawable)drawable).start();
}
}
protected void setImageBitmapInto(Bitmap bitmap, View view) {
((ImageView)view).setImageBitmap(bitmap);
}
so you can see that the ImageView use setImageBitmap to display bitmap,while the other view will use setBackground,here is my class for other view
public class CustomViewAware extends ViewAware {
public CustomViewAware(View view) {
super(view);
}
@Override
protected void setImageDrawableInto(Drawable drawable, View view) {
view.setBackgroundDrawable(drawable);
}
@Override
protected void setImageBitmapInto(Bitmap bitmap, View view) {
view.setBackgroundDrawable(new BitmapDrawable(bitmap));
}