package w8;

import android.view.View;
import androidx.recyclerview.widget.RecyclerView;

/* loaded from: classes.dex */
public class u {

    /* renamed from: a, reason: collision with root package name */
    private final RecyclerView f41005a;

    /* renamed from: b, reason: collision with root package name */
    private d f41006b;

    /* renamed from: c, reason: collision with root package name */
    private View.OnClickListener f41007c = new a();

    /* renamed from: d, reason: collision with root package name */
    private View.OnLongClickListener f41008d = new b();

    /* renamed from: e, reason: collision with root package name */
    private RecyclerView.r f41009e = new c();

    /* loaded from: classes.dex */
    class a implements View.OnClickListener {
        a() {
        }

        @Override // android.view.View.OnClickListener
        public void onClick(View view) {
            if (u.this.f41006b != null) {
                u.this.f41006b.a(u.this.f41005a, u.this.f41005a.g0(view).k(), view);
            }
        }
    }

    /* loaded from: classes.dex */
    class b implements View.OnLongClickListener {
        b() {
        }

        @Override // android.view.View.OnLongClickListener
        public boolean onLongClick(View view) {
            u.c(u.this);
            return false;
        }
    }

    /* loaded from: classes.dex */
    class c implements RecyclerView.r {
        c() {
        }

        @Override // androidx.recyclerview.widget.RecyclerView.r
        public void a(View view) {
        }

        @Override // androidx.recyclerview.widget.RecyclerView.r
        public void b(View view) {
            if (u.this.f41006b != null) {
                view.setOnClickListener(u.this.f41007c);
            }
            u.c(u.this);
        }
    }

    /* loaded from: classes.dex */
    public interface d {
        void a(RecyclerView recyclerView, int i10, View view);
    }

    /* loaded from: classes.dex */
    public interface e {
    }

    private u(RecyclerView recyclerView) {
        this.f41005a = recyclerView;
        recyclerView.setTag(h7.i.D, this);
        recyclerView.j(this.f41009e);
    }

    static /* bridge */ /* synthetic */ e c(u uVar) {
        uVar.getClass();
        return null;
    }

    public static u e(RecyclerView recyclerView) {
        u uVar = (u) recyclerView.getTag(h7.i.D);
        return uVar == null ? new u(recyclerView) : uVar;
    }

    public u f(d dVar) {
        this.f41006b = dVar;
        return this;
    }
}
