package N1;

import androidx.recyclerview.widget.RecyclerView;
import com.rubensousa.dpadrecyclerview.DpadRecyclerView;
import java.lang.reflect.Field;
import java.util.ArrayList;

/* JADX INFO: loaded from: classes.dex */
public final class k0 extends V {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f4574a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ RecyclerView f4575b;

    public /* synthetic */ k0(RecyclerView recyclerView, int i) {
        this.f4574a = i;
        this.f4575b = recyclerView;
    }

    @Override // N1.V
    public void a() {
        switch (this.f4574a) {
            case n4.u0.f15495q /* 0 */:
                RecyclerView recyclerView = this.f4575b;
                recyclerView.j(null);
                recyclerView.f9087y0.f4619f = true;
                recyclerView.b0(true);
                if (!recyclerView.f9078u.m()) {
                    recyclerView.requestLayout();
                }
                break;
        }
    }

    @Override // N1.V
    public void b(int i, int i5, Object obj) {
        switch (this.f4574a) {
            case n4.u0.f15495q /* 0 */:
                RecyclerView recyclerView = this.f4575b;
                recyclerView.j(null);
                C0198b c0198b = recyclerView.f9078u;
                if (i5 >= 1) {
                    ArrayList arrayList = (ArrayList) c0198b.f4506c;
                    arrayList.add(c0198b.o(obj, 4, i, i5));
                    c0198b.f4504a |= 4;
                    if (arrayList.size() == 1) {
                        f();
                    }
                } else {
                    c0198b.getClass();
                }
                break;
        }
    }

    @Override // N1.V
    public final void c(int i, int i5) {
        RecyclerView recyclerView = this.f4575b;
        switch (this.f4574a) {
            case n4.u0.f15495q /* 0 */:
                recyclerView.j(null);
                C0198b c0198b = recyclerView.f9078u;
                if (i5 >= 1) {
                    ArrayList arrayList = (ArrayList) c0198b.f4506c;
                    arrayList.add(c0198b.o(null, 1, i, i5));
                    c0198b.f4504a |= 1;
                    if (arrayList.size() == 1) {
                        f();
                    }
                } else {
                    c0198b.getClass();
                }
                break;
            default:
                int i8 = DpadRecyclerView.p1;
                ((DpadRecyclerView) recyclerView).x0();
                break;
        }
    }

    @Override // N1.V
    public final void d(int i, int i5) {
        RecyclerView recyclerView = this.f4575b;
        switch (this.f4574a) {
            case n4.u0.f15495q /* 0 */:
                recyclerView.j(null);
                C0198b c0198b = recyclerView.f9078u;
                c0198b.getClass();
                if (i != i5) {
                    ArrayList arrayList = (ArrayList) c0198b.f4506c;
                    arrayList.add(c0198b.o(null, 8, i, i5));
                    c0198b.f4504a |= 8;
                    if (arrayList.size() == 1) {
                        f();
                    }
                    break;
                }
                break;
            default:
                int i8 = DpadRecyclerView.p1;
                ((DpadRecyclerView) recyclerView).x0();
                break;
        }
    }

    @Override // N1.V
    public final void e(int i, int i5) {
        RecyclerView recyclerView = this.f4575b;
        switch (this.f4574a) {
            case n4.u0.f15495q /* 0 */:
                recyclerView.j(null);
                C0198b c0198b = recyclerView.f9078u;
                if (i5 >= 1) {
                    ArrayList arrayList = (ArrayList) c0198b.f4506c;
                    arrayList.add(c0198b.o(null, 2, i, i5));
                    c0198b.f4504a |= 2;
                    if (arrayList.size() == 1) {
                        f();
                    }
                } else {
                    c0198b.getClass();
                }
                break;
            default:
                int i8 = DpadRecyclerView.p1;
                ((DpadRecyclerView) recyclerView).x0();
                break;
        }
    }

    public void f() {
        RecyclerView recyclerView = this.f4575b;
        if (recyclerView.f9033K && recyclerView.f9031J) {
            Field field = M.J.f4065a;
            recyclerView.postOnAnimation(recyclerView.f9086y);
        } else {
            recyclerView.f9046R = true;
            recyclerView.requestLayout();
        }
    }
}
