package defpackage;

import android.R;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
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;

/* JADX INFO: renamed from: ˆᵱᵖᵶ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0898 extends ArrayAdapter {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public ColorStateList f3966;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final /* synthetic */ C2312 f3967;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public ColorStateList f3968;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0898(C2312 c2312, Context context, int i, String[] strArr) {
        super(context, i, strArr);
        this.f3967 = c2312;
        m3135();
    }

    @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;
            C2312 c2312 = this.f3967;
            Drawable drawable = null;
            if (c2312.getText().toString().contentEquals(textView.getText()) && c2312.f9088 != 0) {
                ColorDrawable colorDrawable = new ColorDrawable(c2312.f9088);
                if (this.f3966 != null) {
                    colorDrawable.setTintList(this.f3968);
                    RippleDrawable rippleDrawable = new RippleDrawable(this.f3966, colorDrawable, null);
                    FocusRingDrawable focusRingDrawableM823 = FocusRingDrawable.m823(getContext(), rippleDrawable);
                    if (focusRingDrawableM823 != null) {
                        focusRingDrawableM823.f1052.f3560 = c2312.f9089;
                    }
                    drawable = rippleDrawable;
                } else {
                    drawable = colorDrawable;
                }
            }
            textView.setBackground(drawable);
        }
        return view2;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final void m3135() {
        ColorStateList colorStateList;
        C2312 c2312 = this.f3967;
        ColorStateList colorStateList2 = c2312.f9092;
        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.f3966 = colorStateList;
        if (c2312.f9088 != 0 && c2312.f9092 != 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[]{AbstractC2434.m6170(c2312.f9092.getColorForState(iArr3, 0), c2312.f9088), AbstractC2434.m6170(c2312.f9092.getColorForState(iArr2, 0), c2312.f9088), c2312.f9088});
        }
        this.f3968 = colorStateList3;
    }
}
