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

TintTypedArray

public class TintTypedArray extends Object
A class that wraps a {@link android.content.res.TypedArray} and provides the same public API surface. The purpose of this class is so that we can intercept the {@link #getDrawable(int)} call and tint the result.
hide

Fields Summary
private final android.content.Context
mContext
private final android.content.res.TypedArray
mWrapped
private TintManager
mTintManager
Constructors Summary
private TintTypedArray(android.content.Context context, android.content.res.TypedArray array)

        mContext = context;
        mWrapped = array;
    
Methods Summary
public booleangetBoolean(int index, boolean defValue)

        return mWrapped.getBoolean(index, defValue);
    
public intgetChangingConfigurations()

        return mWrapped.getChangingConfigurations();
    
public intgetColor(int index, int defValue)

        return mWrapped.getColor(index, defValue);
    
public android.content.res.ColorStateListgetColorStateList(int index)

        return mWrapped.getColorStateList(index);
    
public floatgetDimension(int index, float defValue)

        return mWrapped.getDimension(index, defValue);
    
public intgetDimensionPixelOffset(int index, int defValue)

        return mWrapped.getDimensionPixelOffset(index, defValue);
    
public intgetDimensionPixelSize(int index, int defValue)

        return mWrapped.getDimensionPixelSize(index, defValue);
    
public android.graphics.drawable.DrawablegetDrawable(int index)

        if (mWrapped.hasValue(index)) {
            final int resourceId = mWrapped.getResourceId(index, 0);
            if (resourceId != 0) {
                return getTintManager().getDrawable(resourceId);
            }
        }
        return mWrapped.getDrawable(index);
    
public floatgetFloat(int index, float defValue)

        return mWrapped.getFloat(index, defValue);
    
public floatgetFraction(int index, int base, int pbase, float defValue)

        return mWrapped.getFraction(index, base, pbase, defValue);
    
public intgetIndex(int at)

        return mWrapped.getIndex(at);
    
public intgetIndexCount()

        return mWrapped.getIndexCount();
    
public intgetInt(int index, int defValue)

        return mWrapped.getInt(index, defValue);
    
public intgetInteger(int index, int defValue)

        return mWrapped.getInteger(index, defValue);
    
public intgetLayoutDimension(int index, java.lang.String name)

        return mWrapped.getLayoutDimension(index, name);
    
public intgetLayoutDimension(int index, int defValue)

        return mWrapped.getLayoutDimension(index, defValue);
    
public java.lang.StringgetNonResourceString(int index)

        return mWrapped.getNonResourceString(index);
    
public java.lang.StringgetPositionDescription()

        return mWrapped.getPositionDescription();
    
public intgetResourceId(int index, int defValue)

        return mWrapped.getResourceId(index, defValue);
    
public android.content.res.ResourcesgetResources()

        return mWrapped.getResources();
    
public java.lang.StringgetString(int index)

        return mWrapped.getString(index);
    
public java.lang.CharSequencegetText(int index)

        return mWrapped.getText(index);
    
public java.lang.CharSequence[]getTextArray(int index)

        return mWrapped.getTextArray(index);
    
public TintManagergetTintManager()

        if (mTintManager == null) {
            mTintManager = new TintManager(mContext);
        }
        return mTintManager;
    
public intgetType(int index)

        return mWrapped.getType(index);
    
public booleangetValue(int index, android.util.TypedValue outValue)

        return mWrapped.getValue(index, outValue);
    
public booleanhasValue(int index)

        return mWrapped.hasValue(index);
    
public intlength()

        return mWrapped.length();
    
public static android.support.v7.internal.widget.TintTypedArrayobtainStyledAttributes(android.content.Context context, android.util.AttributeSet set, int[] attrs)

        TypedArray array = context.obtainStyledAttributes(set, attrs);
        return new TintTypedArray(context, array);
    
public static android.support.v7.internal.widget.TintTypedArrayobtainStyledAttributes(android.content.Context context, android.util.AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes)

        TypedArray array = context.obtainStyledAttributes(set, attrs, defStyleAttr, defStyleRes);
        return new TintTypedArray(context, array);
    
public android.util.TypedValuepeekValue(int index)

        return mWrapped.peekValue(index);
    
public voidrecycle()

        mWrapped.recycle();