FileDocCategorySizeDatePackage
FixedSizeImageView.javaAPI DocAndroid 5.1 API2345Thu Mar 12 22:22:42 GMT 2015com.android.systemui.recents.views

FixedSizeImageView

public class FixedSizeImageView extends android.widget.ImageView
This is an optimized ImageView that does not trigger a requestLayout() or invalidate() when setting the image to Null.

Fields Summary
boolean
mAllowRelayout
boolean
mAllowInvalidate
Constructors Summary
public FixedSizeImageView(android.content.Context context)


       
        this(context, null);
    
public FixedSizeImageView(android.content.Context context, android.util.AttributeSet attrs)

        this(context, attrs, 0);
    
public FixedSizeImageView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)

        this(context, attrs, defStyleAttr, 0);
    
public FixedSizeImageView(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)

        super(context, attrs, defStyleAttr, defStyleRes);
    
Methods Summary
public voidinvalidate()

        if (mAllowInvalidate) {
            super.invalidate();
        }
    
public voidrequestLayout()

        if (mAllowRelayout) {
            super.requestLayout();
        }
    
public voidsetImageDrawable(android.graphics.drawable.Drawable drawable)

        boolean isNullBitmapDrawable = (drawable instanceof BitmapDrawable) &&
                (((BitmapDrawable) drawable).getBitmap() == null);
        if (drawable == null || isNullBitmapDrawable) {
            mAllowRelayout = false;
            mAllowInvalidate = false;
        }
        super.setImageDrawable(drawable);
        mAllowRelayout = true;
        mAllowInvalidate = true;