package androidx.appcompat.widget;

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;
import g.e.d.c.f;

/* JADX INFO: compiled from: TintTypedArray.java */
/* JADX INFO: loaded from: classes.dex */
public class t0 {
    private final Context a;
    private final TypedArray b;
    private TypedValue c;

    private t0(Context context, TypedArray typedArray) {
        this.a = context;
        this.b = typedArray;
    }

    public static t0 r(Context context, int i2, int[] iArr) {
        return new t0(context, context.obtainStyledAttributes(i2, iArr));
    }

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

    public static t0 t(Context context, AttributeSet attributeSet, int[] iArr, int i2, int i3) {
        return new t0(context, context.obtainStyledAttributes(attributeSet, iArr, i2, i3));
    }

    public boolean a(int i2, boolean z) {
        return this.b.getBoolean(i2, z);
    }

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

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

    public int d(int i2, int i3) {
        return this.b.getDimensionPixelOffset(i2, i3);
    }

    public int e(int i2, int i3) {
        return this.b.getDimensionPixelSize(i2, i3);
    }

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

    public Drawable g(int i2) {
        int resourceId;
        if (!this.b.hasValue(i2) || (resourceId = this.b.getResourceId(i2, 0)) == 0) {
            return null;
        }
        return j.n().q(this.a, resourceId, true);
    }

    public float h(int i2, float f) {
        return this.b.getFloat(i2, f);
    }

    public Typeface i(int i2, int i3, f.a aVar) {
        int resourceId = this.b.getResourceId(i2, 0);
        if (resourceId == 0) {
            return null;
        }
        if (this.c == null) {
            this.c = new TypedValue();
        }
        return g.e.d.c.f.b(this.a, resourceId, this.c, i3, aVar);
    }

    public int j(int i2, int i3) {
        return this.b.getInt(i2, i3);
    }

    public int k(int i2, int i3) {
        return this.b.getInteger(i2, i3);
    }

    public int l(int i2, int i3) {
        return this.b.getLayoutDimension(i2, i3);
    }

    public int m(int i2, int i3) {
        return this.b.getResourceId(i2, i3);
    }

    public String n(int i2) {
        return this.b.getString(i2);
    }

    public CharSequence o(int i2) {
        return this.b.getText(i2);
    }

    public CharSequence[] p(int i2) {
        return this.b.getTextArray(i2);
    }

    public boolean q(int i2) {
        return this.b.hasValue(i2);
    }

    public void u() {
        this.b.recycle();
    }
}
