package defpackage;

import android.R;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.RippleDrawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.google.android.material.focus.FocusRingDrawable;

/* renamed from: ᵥˊ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3499 extends ArrayAdapter {

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final /* synthetic */ C2821 f13100;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public ColorStateList f13101;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public ColorStateList f13102;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C3499(C2821 c2821, Context context, int i, String[] strArr) {
        super(context, i, strArr);
        this.f13100 = c2821;
        m7976();
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // android.widget.ArrayAdapter, android.widget.Adapter
    public final View getView(int i, View view, ViewGroup viewGroup) {
        View view2 = super.getView(i, view, viewGroup);
        if (view2 instanceof TextView) {
            TextView textView = (TextView) view2;
            C2821 c2821 = this.f13100;
            ColorDrawable colorDrawable = null;
            if (c2821.getText().toString().contentEquals(textView.getText()) && c2821.f10870 != 0) {
                ColorDrawable colorDrawable2 = new ColorDrawable(c2821.f10870);
                if (this.f13102 != null) {
                    colorDrawable2.setTintList(this.f13101);
                    RippleDrawable rippleDrawable = new RippleDrawable(this.f13102, colorDrawable2, null);
                    FocusRingDrawable focusRingDrawableM821 = FocusRingDrawable.m821(getContext(), rippleDrawable);
                    if (focusRingDrawableM821 != null) {
                        focusRingDrawableM821.f1062.f17353 = c2821.f10863;
                    }
                    colorDrawable = rippleDrawable;
                } else {
                    colorDrawable = colorDrawable2;
                }
            }
            textView.setBackground(colorDrawable);
        }
        return view2;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final void m7976() {
        ColorStateList colorStateList;
        C2821 c2821 = this.f13100;
        ColorStateList colorStateList2 = c2821.f10869;
        ColorStateList colorStateList3 = null;
        if (colorStateList2 != null) {
            int[] iArr = {R.attr.state_pressed};
            colorStateList = new ColorStateList(new int[][]{iArr, new int[0]}, new int[]{colorStateList2.getColorForState(iArr, 0), 0});
        } else {
            colorStateList = null;
        }
        this.f13102 = colorStateList;
        if (c2821.f10870 != 0 && c2821.f10869 != null) {
            int[] iArr2 = {R.attr.state_hovered, -16842919};
            int[] iArr3 = {R.attr.state_selected, -16842919};
            colorStateList3 = new ColorStateList(new int[][]{iArr3, iArr2, new int[0]}, new int[]{AbstractC1814.m5136(c2821.f10869.getColorForState(iArr3, 0), c2821.f10870), AbstractC1814.m5136(c2821.f10869.getColorForState(iArr2, 0), c2821.f10870), c2821.f10870});
        }
        this.f13101 = colorStateList3;
    }
}
