package pf;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import ie.n2;
import java.util.List;
import org.drive_hunter.R;
import xyz.stream.api.entity.SeasonCollectionBeaEntity;
import xyz.stream.view.OnItemListener;
import xyz.stream.view.SingleTypeAdapter;

/* JADX INFO: loaded from: classes3.dex */
public final class d extends SingleTypeAdapter {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f31964b;

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

    public d(List list, Activity activity) {
        super(list, activity);
        this.f31964b = 0;
        this.f31965c = true;
    }

    public static void e(d dVar, int i10, n2 n2Var, View view, boolean z10) {
        int color;
        if (z10) {
            OnItemListener onItemListener = dVar.onItemListener;
            if (onItemListener != null) {
                onItemListener.onItemFocus(view, i10);
            }
            n2Var.f27257c.setBackgroundResource(R.drawable.shape_category_focus);
            Activity activity = dVar.context;
            Object obj = g0.d.f26125a;
            int color2 = activity.getColor(R.color.black);
            TextView textView = n2Var.f27257c;
            textView.setTextColor(color2);
            textView.setTypeface(null, dVar.f31964b == i10 ? 1 : 0);
            return;
        }
        dVar.getClass();
        n2Var.f27257c.setBackgroundResource(R.color.transparent);
        if (dVar.f31964b == i10) {
            Activity activity2 = dVar.context;
            Object obj2 = g0.d.f26125a;
            color = activity2.getColor(R.color.white);
        } else {
            Activity activity3 = dVar.context;
            Object obj3 = g0.d.f26125a;
            color = activity3.getColor(R.color.black_9);
        }
        TextView textView2 = n2Var.f27257c;
        textView2.setTextColor(color);
        textView2.setTypeface(null, dVar.f31964b == i10 ? 1 : 0);
    }

    @Override // xyz.stream.view.SingleTypeAdapter
    public final v3.a createBinding(ViewGroup viewGroup) {
        return n2.inflate(LayoutInflater.from(this.context), viewGroup, false);
    }

    @Override // xyz.stream.view.SingleTypeAdapter
    public final void onBindData(v3.a aVar, Object obj, int i10) {
        int color;
        n2 n2Var = (n2) aVar;
        n2Var.f27257c.setText(this.context.getString(R.string.season) + " " + ((SeasonCollectionBeaEntity) obj).getSeasonNumber());
        oe.h hVar = new oe.h(this, i10, n2Var, 29);
        LinearLayout linearLayout = n2Var.f27255a;
        linearLayout.setOnFocusChangeListener(hVar);
        if (xyz.stream.utils.e.d().f36118g) {
            linearLayout.setFocusable(this.f31965c);
            linearLayout.setFocusableInTouchMode(this.f31965c);
        }
        if (this.f31964b == i10) {
            Activity activity = this.context;
            int i11 = linearLayout.isFocused() ? R.color.black : R.color.white;
            Object obj2 = g0.d.f26125a;
            color = activity.getColor(i11);
        } else {
            Activity activity2 = this.context;
            Object obj3 = g0.d.f26125a;
            color = activity2.getColor(R.color.black_9);
        }
        TextView textView = n2Var.f27257c;
        textView.setTextColor(color);
        textView.setTypeface(null, this.f31964b == i10 ? 1 : 0);
        int i12 = this.f31964b != i10 ? 4 : 0;
        View view = n2Var.f27256b;
        view.setVisibility(i12);
        view.setBackgroundColor(this.context.getColor(R.color.main_color));
    }
}
