package X6FRs_4.IMuAHx_6.X6FRs_4.PGPF6hQ_2;

import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.TypedValue;
import com.google.android.material.chip.Chip;
import org.xmlpull.v1.XmlPullParser;
/* compiled from: TypedArrayUtils.java */
/* loaded from: classes.dex */
public class IMuAHx_6 {
    public static boolean KQgRr5e_0(XmlPullParser xmlPullParser, String str) {
        return xmlPullParser.getAttributeValue(Chip.NAMESPACE_ANDROID, str) != null;
    }

    public static int PGPF6hQ_2(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
        return !KQgRr5e_0(xmlPullParser, str) ? i2 : typedArray.getResourceId(i, i2);
    }

    public static int QxJ9d_1(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
        return !KQgRr5e_0(xmlPullParser, str) ? i2 : typedArray.getInt(i, i2);
    }

    public static float KQgRr5e_0(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, float f) {
        return !KQgRr5e_0(xmlPullParser, str) ? f : typedArray.getFloat(i, f);
    }

    public static boolean KQgRr5e_0(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, boolean z) {
        return !KQgRr5e_0(xmlPullParser, str) ? z : typedArray.getBoolean(i, z);
    }

    public static int KQgRr5e_0(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i, int i2) {
        return !KQgRr5e_0(xmlPullParser, str) ? i2 : typedArray.getColor(i, i2);
    }

    public static QxJ9d_1 KQgRr5e_0(TypedArray typedArray, XmlPullParser xmlPullParser, Resources.Theme theme, String str, int i, int i2) {
        if (KQgRr5e_0(xmlPullParser, str)) {
            TypedValue typedValue = new TypedValue();
            typedArray.getValue(i, typedValue);
            int i3 = typedValue.type;
            if (i3 >= 28 && i3 <= 31) {
                return QxJ9d_1.KQgRr5e_0(typedValue.data);
            }
            QxJ9d_1 QxJ9d_1 = QxJ9d_1.QxJ9d_1(typedArray.getResources(), typedArray.getResourceId(i, 0), theme);
            if (QxJ9d_1 != null) {
                return QxJ9d_1;
            }
        }
        return QxJ9d_1.KQgRr5e_0(i2);
    }

    /* renamed from: KQgRr5e_0  reason: collision with other method in class */
    public static String m334KQgRr5e_0(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i) {
        if (KQgRr5e_0(xmlPullParser, str)) {
            return typedArray.getString(i);
        }
        return null;
    }

    public static TypedValue KQgRr5e_0(TypedArray typedArray, XmlPullParser xmlPullParser, String str, int i) {
        if (KQgRr5e_0(xmlPullParser, str)) {
            return typedArray.peekValue(i);
        }
        return null;
    }

    public static TypedArray KQgRr5e_0(Resources resources, Resources.Theme theme, AttributeSet attributeSet, int[] iArr) {
        if (theme == null) {
            return resources.obtainAttributes(attributeSet, iArr);
        }
        return theme.obtainStyledAttributes(attributeSet, iArr, 0, 0);
    }
}
