package u0;

import P.C0158b;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import androidx.recyclerview.widget.RecyclerView;

/* JADX INFO: loaded from: classes.dex */
public final class X extends C0158b {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final RecyclerView f10135d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final W f10136e;

    public X(RecyclerView recyclerView) {
        this.f10135d = recyclerView;
        W w5 = this.f10136e;
        if (w5 != null) {
            this.f10136e = w5;
        } else {
            this.f10136e = new W(this);
        }
    }

    @Override // P.C0158b
    public final void c(View view, AccessibilityEvent accessibilityEvent) {
        super.c(view, accessibilityEvent);
        if (!(view instanceof RecyclerView) || this.f10135d.J()) {
            return;
        }
        RecyclerView recyclerView = (RecyclerView) view;
        if (recyclerView.getLayoutManager() != null) {
            recyclerView.getLayoutManager().P(accessibilityEvent);
        }
    }

    @Override // P.C0158b
    public final void d(View view, Q.e eVar) {
        View.AccessibilityDelegate accessibilityDelegate = this.f2424a;
        AccessibilityNodeInfo accessibilityNodeInfo = eVar.f2579a;
        accessibilityDelegate.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfo);
        RecyclerView recyclerView = this.f10135d;
        if (recyclerView.J() || recyclerView.getLayoutManager() == null) {
            return;
        }
        AbstractC1035G layoutManager = recyclerView.getLayoutManager();
        RecyclerView recyclerView2 = layoutManager.f10060b;
        M m5 = recyclerView2.f4571l;
        if (recyclerView2.canScrollVertically(-1) || layoutManager.f10060b.canScrollHorizontally(-1)) {
            eVar.a(8192);
            accessibilityNodeInfo.setScrollable(true);
        }
        if (layoutManager.f10060b.canScrollVertically(1) || layoutManager.f10060b.canScrollHorizontally(1)) {
            eVar.a(4096);
            accessibilityNodeInfo.setScrollable(true);
        }
        S s5 = recyclerView2.f4573m0;
        accessibilityNodeInfo.setCollectionInfo(AccessibilityNodeInfo.CollectionInfo.obtain(layoutManager.G(m5, s5), layoutManager.x(m5, s5), false, 0));
    }

    /* JADX WARN: Removed duplicated region for block: B:21:0x0056 A[PHI: r0
      0x0056: PHI (r0v8 int) = (r0v4 int), (r0v12 int) binds: [B:27:0x0073, B:19:0x0046] A[DONT_GENERATE, DONT_INLINE]] */
    @Override // P.C0158b
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public final boolean g(android.view.View r4, int r5, android.os.Bundle r6) {
        /*
            r3 = this;
            boolean r4 = super.g(r4, r5, r6)
            r6 = 1
            if (r4 == 0) goto L8
            return r6
        L8:
            androidx.recyclerview.widget.RecyclerView r4 = r3.f10135d
            boolean r0 = r4.J()
            r1 = 0
            if (r0 != 0) goto L8c
            u0.G r0 = r4.getLayoutManager()
            if (r0 == 0) goto L8c
            u0.G r4 = r4.getLayoutManager()
            androidx.recyclerview.widget.RecyclerView r0 = r4.f10060b
            u0.M r2 = r0.f4571l
            r2 = 4096(0x1000, float:5.74E-42)
            if (r5 == r2) goto L58
            r2 = 8192(0x2000, float:1.148E-41)
            if (r5 == r2) goto L2a
            r5 = r1
            r0 = r5
            goto L81
        L2a:
            r5 = -1
            boolean r0 = r0.canScrollVertically(r5)
            if (r0 == 0) goto L3f
            int r0 = r4.f10072o
            int r2 = r4.D()
            int r0 = r0 - r2
            int r2 = r4.A()
            int r0 = r0 - r2
            int r0 = -r0
            goto L40
        L3f:
            r0 = r1
        L40:
            androidx.recyclerview.widget.RecyclerView r2 = r4.f10060b
            boolean r5 = r2.canScrollHorizontally(r5)
            if (r5 == 0) goto L56
            int r5 = r4.f10071n
            int r2 = r4.B()
            int r5 = r5 - r2
            int r2 = r4.C()
            int r5 = r5 - r2
            int r5 = -r5
            goto L81
        L56:
            r5 = r1
            goto L81
        L58:
            boolean r5 = r0.canScrollVertically(r6)
            if (r5 == 0) goto L6c
            int r5 = r4.f10072o
            int r0 = r4.D()
            int r5 = r5 - r0
            int r0 = r4.A()
            int r5 = r5 - r0
            r0 = r5
            goto L6d
        L6c:
            r0 = r1
        L6d:
            androidx.recyclerview.widget.RecyclerView r5 = r4.f10060b
            boolean r5 = r5.canScrollHorizontally(r6)
            if (r5 == 0) goto L56
            int r5 = r4.f10071n
            int r2 = r4.B()
            int r5 = r5 - r2
            int r2 = r4.C()
            int r5 = r5 - r2
        L81:
            if (r0 != 0) goto L86
            if (r5 != 0) goto L86
            goto L8c
        L86:
            androidx.recyclerview.widget.RecyclerView r4 = r4.f10060b
            r4.Y(r5, r6, r0)
            return r6
        L8c:
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: u0.X.g(android.view.View, int, android.os.Bundle):boolean");
    }
}
