package androidx.appcompat.widget;

import a.c.c.b.f;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.TypedValue;

/* JADX INFO: compiled from: TintTypedArray.java */
/* JADX INFO: loaded from: classes.dex */
public class i0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final Context f605a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final TypedArray f606b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private TypedValue f607c;

    private i0(Context context, TypedArray typedArray) {
        this.f605a = context;
        this.f606b = typedArray;
    }

    public static i0 q(Context context, int i, int[] iArr) {
        return new i0(context, context.obtainStyledAttributes(i, iArr));
    }

    public static i0 r(Context context, AttributeSet attributeSet, int[] iArr) {
        return new i0(context, context.obtainStyledAttributes(attributeSet, iArr));
    }

    public static i0 s(Context context, AttributeSet attributeSet, int[] iArr, int i, int i2) {
        return new i0(context, context.obtainStyledAttributes(attributeSet, iArr, i, i2));
    }

    public boolean a(int i, boolean z) {
        return this.f606b.getBoolean(i, z);
    }

    public int b(int i, int i2) {
        return this.f606b.getColor(i, i2);
    }

    public ColorStateList c(int i) {
        int resourceId;
        ColorStateList colorStateListC;
        return (!this.f606b.hasValue(i) || (resourceId = this.f606b.getResourceId(i, 0)) == 0 || (colorStateListC = a.a.k.a.a.c(this.f605a, resourceId)) == null) ? this.f606b.getColorStateList(i) : colorStateListC;
    }

    public int d(int i, int i2) {
        return this.f606b.getDimensionPixelOffset(i, i2);
    }

    public int e(int i, int i2) {
        return this.f606b.getDimensionPixelSize(i, i2);
    }

    public Drawable f(int i) {
        int resourceId;
        return (!this.f606b.hasValue(i) || (resourceId = this.f606b.getResourceId(i, 0)) == 0) ? this.f606b.getDrawable(i) : a.a.k.a.a.d(this.f605a, resourceId);
    }

    public float g(int i, float f2) {
        return this.f606b.getFloat(i, f2);
    }

    public Typeface h(int i, int i2, f.a aVar) {
        int resourceId = this.f606b.getResourceId(i, 0);
        if (resourceId == 0) {
            return null;
        }
        if (this.f607c == null) {
            this.f607c = new TypedValue();
        }
        return a.c.c.b.f.b(this.f605a, resourceId, this.f607c, i2, aVar);
    }

    public int i(int i, int i2) {
        return this.f606b.getInt(i, i2);
    }

    public int j(int i, int i2) {
        return this.f606b.getInteger(i, i2);
    }

    public int k(int i, int i2) {
        return this.f606b.getLayoutDimension(i, i2);
    }

    public int l(int i, int i2) {
        return this.f606b.getResourceId(i, i2);
    }

    public String m(int i) {
        return this.f606b.getString(i);
    }

    public CharSequence n(int i) {
        return this.f606b.getText(i);
    }

    public CharSequence[] o(int i) {
        return this.f606b.getTextArray(i);
    }

    public boolean p(int i) {
        return this.f606b.hasValue(i);
    }

    public void t() {
        this.f606b.recycle();
    }
}
