FileDocCategorySizeDatePackage
TintImageView.javaAPI DocAndroid 5.1 API2137Thu Mar 12 22:22:56 GMT 2015android.support.v7.internal.widget

TintImageView

public class TintImageView extends android.widget.ImageView
An tint aware {@link android.widget.ImageView}
hide

Fields Summary
private static final int[]
TINT_ATTRS
private final TintManager
mTintManager
Constructors Summary
public TintImageView(android.content.Context context)


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

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

        super(context, attrs, defStyleAttr);

        TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs, TINT_ATTRS,
                defStyleAttr, 0);
        if (a.length() > 0) {
            if (a.hasValue(0)) {
                setBackgroundDrawable(a.getDrawable(0));
            }
            if (a.hasValue(1)) {
                setImageDrawable(a.getDrawable(1));
            }
        }
        a.recycle();

        // Keep the TintManager in case we need it later
        mTintManager = a.getTintManager();
    
Methods Summary
public voidsetImageResource(int resId)

        // Intercept this call and instead retrieve the Drawable via the tint manager
        setImageDrawable(mTintManager.getDrawable(resId));