package com.google.android.material.theme;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import com.google.android.gms.common.R;
import com.google.android.material.button.MaterialButton;
import o.AbstractC2378rs0;
import o.AbstractC2461sm0;
import o.C0901cO;
import o.C1074e8;
import o.C1284gO;
import o.C2594u7;
import o.C2784w7;
import o.C2974y7;
import o.C80;
import o.E8;
import o.KN;
import o.M8;
import o.XZ;
import o.YN;
import o.YT;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public class MaterialComponentsViewInflater extends M8 {
    @Override // o.M8
    public final C2594u7 a(Context context, AttributeSet attributeSet) {
        return new KN(context, attributeSet);
    }

    @Override // o.M8
    public final C2784w7 b(Context context, AttributeSet attributeSet) {
        return new MaterialButton(context, attributeSet);
    }

    @Override // o.M8
    public final C2974y7 c(Context context, AttributeSet attributeSet) {
        return new YN(context, attributeSet);
    }

    @Override // o.M8
    public final C1074e8 d(Context context, AttributeSet attributeSet) {
        C0901cO c0901cO = new C0901cO(AbstractC2378rs0.n0(context, attributeSet, R.attr.radioButtonStyle, R.style.Widget_MaterialComponents_CompoundButton_RadioButton), attributeSet);
        Context context2 = c0901cO.getContext();
        TypedArray typedArrayI = YT.I(context2, attributeSet, XZ.f409o, R.attr.radioButtonStyle, R.style.Widget_MaterialComponents_CompoundButton_RadioButton, new int[0]);
        if (typedArrayI.hasValue(0)) {
            c0901cO.setButtonTintList(AbstractC2461sm0.q(context2, typedArrayI, 0));
        }
        c0901cO.q = typedArrayI.getBoolean(1, false);
        typedArrayI.recycle();
        return c0901cO;
    }

    @Override // o.M8
    public final E8 e(Context context, AttributeSet attributeSet) throws Resources.NotFoundException {
        C1284gO c1284gO = new C1284gO(AbstractC2378rs0.n0(context, attributeSet, android.R.attr.textViewStyle, 0), attributeSet, android.R.attr.textViewStyle);
        Context context2 = c1284gO.getContext();
        if (C80.U(context2, R.attr.textAppearanceLineHeightEnabled, true)) {
            Resources.Theme theme = context2.getTheme();
            int[] iArr = XZ.r;
            TypedArray typedArrayObtainStyledAttributes = theme.obtainStyledAttributes(attributeSet, iArr, android.R.attr.textViewStyle, 0);
            int iG = C1284gO.g(context2, typedArrayObtainStyledAttributes, 1, 2);
            typedArrayObtainStyledAttributes.recycle();
            if (iG == -1) {
                TypedArray typedArrayObtainStyledAttributes2 = theme.obtainStyledAttributes(attributeSet, iArr, android.R.attr.textViewStyle, 0);
                int resourceId = typedArrayObtainStyledAttributes2.getResourceId(0, -1);
                typedArrayObtainStyledAttributes2.recycle();
                if (resourceId != -1) {
                    TypedArray typedArrayObtainStyledAttributes3 = theme.obtainStyledAttributes(resourceId, XZ.q);
                    int iG2 = C1284gO.g(c1284gO.getContext(), typedArrayObtainStyledAttributes3, 1, 2);
                    typedArrayObtainStyledAttributes3.recycle();
                    if (iG2 >= 0) {
                        c1284gO.setLineHeight(iG2);
                    }
                }
            }
        }
        return c1284gO;
    }
}
