package com.google.android.material.resources;

import X6FRs_4.KQgRr5e_0.KNBe_11.KQgRr5e_0.KQgRr5e_0;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
/* loaded from: classes.dex */
public class MaterialResources {
    public static ColorStateList getColorStateList(Context context, TypedArray typedArray, int i) {
        int resourceId;
        ColorStateList QxJ9d_1;
        return (!typedArray.hasValue(i) || (resourceId = typedArray.getResourceId(i, 0)) == 0 || (QxJ9d_1 = KQgRr5e_0.QxJ9d_1(context, resourceId)) == null) ? typedArray.getColorStateList(i) : QxJ9d_1;
    }

    public static Drawable getDrawable(Context context, TypedArray typedArray, int i) {
        int resourceId;
        Drawable m380KQgRr5e_0;
        return (!typedArray.hasValue(i) || (resourceId = typedArray.getResourceId(i, 0)) == 0 || (m380KQgRr5e_0 = KQgRr5e_0.m380KQgRr5e_0(context, resourceId)) == null) ? typedArray.getDrawable(i) : m380KQgRr5e_0;
    }

    public static int getIndexWithValue(TypedArray typedArray, int i, int i2) {
        return typedArray.hasValue(i) ? i : i2;
    }

    public static TextAppearance getTextAppearance(Context context, TypedArray typedArray, int i) {
        int resourceId;
        if (!typedArray.hasValue(i) || (resourceId = typedArray.getResourceId(i, 0)) == 0) {
            return null;
        }
        return new TextAppearance(context, resourceId);
    }
}
