package a3;

import android.R;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.util.SparseArray;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.core.view.s1;
import androidx.recyclerview.widget.j2;

/* JADX INFO: loaded from: classes.dex */
public final class i0 extends j2 {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final ColorStateList f266b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final SparseArray f267c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f268d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f269e;

    @Nullable
    private final Drawable mBackground;

    public i0(View view) {
        super(view);
        SparseArray sparseArray = new SparseArray(4);
        this.f267c = sparseArray;
        TextView textView = (TextView) view.findViewById(R.id.title);
        sparseArray.put(R.id.title, textView);
        sparseArray.put(R.id.summary, view.findViewById(R.id.summary));
        sparseArray.put(R.id.icon, view.findViewById(R.id.icon));
        int i10 = l0.icon_frame;
        sparseArray.put(i10, view.findViewById(i10));
        sparseArray.put(R.id.icon_frame, view.findViewById(R.id.icon_frame));
        this.mBackground = view.getBackground();
        if (textView != null) {
            this.f266b = textView.getTextColors();
        }
    }

    public final View a(int i10) {
        SparseArray sparseArray = this.f267c;
        View view = (View) sparseArray.get(i10);
        if (view != null) {
            return view;
        }
        View viewFindViewById = this.itemView.findViewById(i10);
        if (viewFindViewById != null) {
            sparseArray.put(i10, viewFindViewById);
        }
        return viewFindViewById;
    }

    public final void b() {
        ColorStateList colorStateList;
        Drawable background = this.itemView.getBackground();
        Drawable drawable = this.mBackground;
        if (background != drawable) {
            s1.setBackground(this.itemView, drawable);
        }
        TextView textView = (TextView) a(R.id.title);
        if (textView == null || (colorStateList = this.f266b) == null || textView.getTextColors().equals(colorStateList)) {
            return;
        }
        textView.setTextColor(colorStateList);
    }
}
