Back to project page webimageloader.
The source code is released under:
Apache License
If you think the Android project webimageloader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.webimageloader.sample; /* ww w . j av a 2 s .com*/ import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.ImageView; /** * An ImageView that does not request a layout pass when an image is set. This should * only be used when the view is of fixed size and images can not change the layout. * * See this post for more info: https://plus.google.com/113058165720861374515/posts/iTk4PjgeAWX */ public class FastImageView extends ImageView { private boolean blockLayout; public FastImageView(Context context) { super(context); } public FastImageView(Context context, AttributeSet attrs) { super(context, attrs); } public FastImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public void setImageBitmap(Bitmap bm) { blockLayout = true; super.setImageBitmap(bm); blockLayout = false; } @Override public void setImageDrawable(Drawable drawable) { blockLayout = true; super.setImageDrawable(drawable); blockLayout = false; } @Override public void setImageResource(int resId) { blockLayout = true; super.setImageResource(resId); blockLayout = false; } @Override public void requestLayout() { if (!blockLayout) { super.requestLayout(); } } }