package y0;

import android.R;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import androidx.appcompat.widget.v;
import androidx.core.widget.d;
import com.google.android.material.internal.m;
import l0.b;
import l0.j;
import l0.k;
import z0.c;

/* JADX INFO: compiled from: MaterialRadioButton.java */
/* JADX INFO: loaded from: classes.dex */
public class a extends v {

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private static final int f5945k = j.f5455j;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private static final int[][] f5946l = {new int[]{R.attr.state_enabled, R.attr.state_checked}, new int[]{R.attr.state_enabled, -16842912}, new int[]{-16842910, R.attr.state_checked}, new int[]{-16842910, -16842912}};

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private ColorStateList f5947i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private boolean f5948j;

    public a(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, b.f5342y);
    }

    private ColorStateList getMaterialThemeColorsTintList() {
        if (this.f5947i == null) {
            int iD = r0.a.d(this, b.f5323f);
            int iD2 = r0.a.d(this, b.f5325h);
            int iD3 = r0.a.d(this, b.f5328k);
            int[][] iArr = f5946l;
            int[] iArr2 = new int[iArr.length];
            iArr2[0] = r0.a.h(iD3, iD, 1.0f);
            iArr2[1] = r0.a.h(iD3, iD2, 0.54f);
            iArr2[2] = r0.a.h(iD3, iD2, 0.38f);
            iArr2[3] = r0.a.h(iD3, iD2, 0.38f);
            this.f5947i = new ColorStateList(iArr, iArr2);
        }
        return this.f5947i;
    }

    @Override // android.widget.TextView, android.view.View
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (this.f5948j && d.b(this) == null) {
            setUseMaterialThemeColors(true);
        }
    }

    public void setUseMaterialThemeColors(boolean z2) {
        this.f5948j = z2;
        if (z2) {
            d.c(this, getMaterialThemeColorsTintList());
        } else {
            d.c(this, null);
        }
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public a(Context context, AttributeSet attributeSet, int i3) {
        int i4 = f5945k;
        super(e1.a.c(context, attributeSet, i3, i4), attributeSet, i3);
        Context context2 = getContext();
        TypedArray typedArrayH = m.h(context2, attributeSet, k.R1, i3, i4, new int[0]);
        int i5 = k.S1;
        if (typedArrayH.hasValue(i5)) {
            d.c(this, c.a(context2, typedArrayH, i5));
        }
        this.f5948j = typedArrayH.getBoolean(k.T1, false);
        typedArrayH.recycle();
    }
}
