package androidx.recyclerview.widget;

import F1.AbstractC0195y;
import F1.C0184m;
import F1.C0186o;
import I0.C0;
import J0.f1;
import V.C0629x;
import android.R;
import android.animation.LayoutTransition;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Build;
import android.os.Parcelable;
import android.os.SystemClock;
import android.os.Trace;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.Display;
import android.view.FocusFinder;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.widget.EdgeEffect;
import android.widget.OverScroller;
import androidx.leanback.widget.AbstractC1080l;
import androidx.media3.extractor.ts.TsExtractor;
import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import m2.AbstractC2465a;
import n.C2592t;
import x4.AbstractC3252r;

/* JADX INFO: loaded from: classes.dex */
public class RecyclerView extends ViewGroup {

    /* JADX INFO: renamed from: C0, reason: collision with root package name */
    public static final int[] f12890C0 = {R.attr.nestedScrollingEnabled};

    /* JADX INFO: renamed from: D0, reason: collision with root package name */
    public static final float f12891D0 = (float) (Math.log(0.78d) / Math.log(0.9d));
    public static final boolean E0 = true;

    /* JADX INFO: renamed from: F0, reason: collision with root package name */
    public static final boolean f12892F0 = true;

    /* JADX INFO: renamed from: G0, reason: collision with root package name */
    public static final boolean f12893G0 = true;

    /* JADX INFO: renamed from: H0, reason: collision with root package name */
    public static final Class[] f12894H0;

    /* JADX INFO: renamed from: I0, reason: collision with root package name */
    public static final InterpolatorC1174y f12895I0;

    /* JADX INFO: renamed from: J0, reason: collision with root package name */
    public static final W f12896J0;

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

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

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

    /* JADX INFO: renamed from: B0, reason: collision with root package name */
    public final C1175z f12900B0;

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

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

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

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public final AccessibilityManager f12904F;

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

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

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

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

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public F f12909K;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public EdgeEffect f12910L;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    public EdgeEffect f12911M;

    /* JADX INFO: renamed from: N, reason: collision with root package name */
    public EdgeEffect f12912N;

    /* JADX INFO: renamed from: O, reason: collision with root package name */
    public EdgeEffect f12913O;

    /* JADX INFO: renamed from: P, reason: collision with root package name */
    public G f12914P;

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

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

    /* JADX INFO: renamed from: S, reason: collision with root package name */
    public VelocityTracker f12917S;

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

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

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

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final float f12922a;

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

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

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public final int f12925b0;

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

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public final int f12927c0;

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

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public final float f12929d0;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final C0 f12930e;
    public final float e0;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final C4.f f12931f;
    public boolean f0;
    public final Y g0;
    public RunnableC1166p h0;

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    public final C0629x f12932i0;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final i0 f12933j;

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    public final V f12934j0;

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

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    public M f12936k0;
    public final RunnableC1173x l;

    /* JADX INFO: renamed from: l0, reason: collision with root package name */
    public ArrayList f12937l0;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final Rect f12938m;

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

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final Rect f12940n;

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

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public final RectF f12942o;

    /* JADX INFO: renamed from: o0, reason: collision with root package name */
    public final C1175z f12943o0;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public B f12944p;

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

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public J f12946q;

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    public b0 f12947q0;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public Q f12948r;

    /* JADX INFO: renamed from: r0, reason: collision with root package name */
    public final int[] f12949r0;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final ArrayList f12950s;

    /* JADX INFO: renamed from: s0, reason: collision with root package name */
    public C0184m f12951s0;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final ArrayList f12952t;

    /* JADX INFO: renamed from: t0, reason: collision with root package name */
    public final int[] f12953t0;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final ArrayList f12954u;

    /* JADX INFO: renamed from: u0, reason: collision with root package name */
    public final int[] f12955u0;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public C1164n f12956v;

    /* JADX INFO: renamed from: v0, reason: collision with root package name */
    public final int[] f12957v0;

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

    /* JADX INFO: renamed from: w0, reason: collision with root package name */
    public final ArrayList f12959w0;

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

    /* JADX INFO: renamed from: x0, reason: collision with root package name */
    public final RunnableC1173x f12961x0;

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

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

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

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

    static {
        Class cls = Integer.TYPE;
        f12894H0 = new Class[]{Context.class, AttributeSet.class, cls, cls};
        f12895I0 = new InterpolatorC1174y();
        f12896J0 = new W();
    }

    public RecyclerView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, com.debridstream.tv.R.attr.recyclerViewStyle);
    }

    public static RecyclerView B(View view) {
        if (!(view instanceof ViewGroup)) {
            return null;
        }
        if (view instanceof RecyclerView) {
            return (RecyclerView) view;
        }
        ViewGroup viewGroup = (ViewGroup) view;
        int childCount = viewGroup.getChildCount();
        for (int i6 = 0; i6 < childCount; i6++) {
            RecyclerView recyclerViewB = B(viewGroup.getChildAt(i6));
            if (recyclerViewB != null) {
                return recyclerViewB;
            }
        }
        return null;
    }

    public static Z G(View view) {
        if (view == null) {
            return null;
        }
        return ((K) view.getLayoutParams()).f12856a;
    }

    public static void g(Z z6) {
        WeakReference<RecyclerView> weakReference = z6.mNestedRecyclerView;
        if (weakReference != null) {
            RecyclerView recyclerView = weakReference.get();
            while (recyclerView != null) {
                if (recyclerView == z6.itemView) {
                    return;
                }
                Object parent = recyclerView.getParent();
                recyclerView = parent instanceof View ? (View) parent : null;
            }
            z6.mNestedRecyclerView = null;
        }
    }

    private C0184m getScrollingChildHelper() {
        if (this.f12951s0 == null) {
            this.f12951s0 = new C0184m(this);
        }
        return this.f12951s0;
    }

    public static int j(int i6, EdgeEffect edgeEffect, EdgeEffect edgeEffect2, int i7) {
        if (i6 > 0 && edgeEffect != null && L4.a.J(edgeEffect) != 0.0f) {
            int iRound = Math.round(L4.a.b0(edgeEffect, ((-i6) * 4.0f) / i7, 0.5f) * ((-i7) / 4.0f));
            if (iRound != i6) {
                edgeEffect.finish();
            }
            return i6 - iRound;
        }
        if (i6 >= 0 || edgeEffect2 == null || L4.a.J(edgeEffect2) == 0.0f) {
            return i6;
        }
        float f6 = i7;
        int iRound2 = Math.round(L4.a.b0(edgeEffect2, (i6 * 4.0f) / f6, 0.5f) * (f6 / 4.0f));
        if (iRound2 != i6) {
            edgeEffect2.finish();
        }
        return i6 - iRound2;
    }

    public final void A(int[] iArr) {
        int iU = this.f12931f.u();
        if (iU == 0) {
            iArr[0] = -1;
            iArr[1] = -1;
            return;
        }
        int i6 = Integer.MAX_VALUE;
        int i7 = Integer.MIN_VALUE;
        for (int i8 = 0; i8 < iU; i8++) {
            Z zG = G(this.f12931f.t(i8));
            if (!zG.shouldIgnore()) {
                int layoutPosition = zG.getLayoutPosition();
                if (layoutPosition < i6) {
                    i6 = layoutPosition;
                }
                if (layoutPosition > i7) {
                    i7 = layoutPosition;
                }
            }
        }
        iArr[0] = i6;
        iArr[1] = i7;
    }

    public final Z C(int i6) {
        Z z6 = null;
        if (this.f12905G) {
            return null;
        }
        int iD = this.f12931f.D();
        for (int i7 = 0; i7 < iD; i7++) {
            Z zG = G(this.f12931f.C(i7));
            if (zG != null && !zG.isRemoved() && D(zG) == i6) {
                C4.f fVar = this.f12931f;
                if (!((ArrayList) fVar.f743d).contains(zG.itemView)) {
                    return zG;
                }
                z6 = zG;
            }
        }
        return z6;
    }

    public final int D(Z z6) {
        if (z6.hasAnyOfTheFlags(524) || !z6.isBound()) {
            return -1;
        }
        C0 c02 = this.f12930e;
        int i6 = z6.mPosition;
        ArrayList arrayList = (ArrayList) c02.f2132c;
        int size = arrayList.size();
        for (int i7 = 0; i7 < size; i7++) {
            C1151a c1151a = (C1151a) arrayList.get(i7);
            int i8 = c1151a.f13019a;
            if (i8 != 1) {
                if (i8 == 2) {
                    int i9 = c1151a.f13020b;
                    if (i9 <= i6) {
                        int i10 = c1151a.f13022d;
                        if (i9 + i10 > i6) {
                            return -1;
                        }
                        i6 -= i10;
                    } else {
                        continue;
                    }
                } else if (i8 == 8) {
                    int i11 = c1151a.f13020b;
                    if (i11 == i6) {
                        i6 = c1151a.f13022d;
                    } else {
                        if (i11 < i6) {
                            i6--;
                        }
                        if (c1151a.f13022d <= i6) {
                            i6++;
                        }
                    }
                }
            } else if (c1151a.f13020b <= i6) {
                i6 += c1151a.f13022d;
            }
        }
        return i6;
    }

    public final long E(Z z6) {
        return this.f12944p.hasStableIds() ? z6.getItemId() : z6.mPosition;
    }

    public final Z F(View view) {
        ViewParent parent = view.getParent();
        if (parent == null || parent == this) {
            return G(view);
        }
        throw new IllegalArgumentException("View " + view + " is not a direct child of " + this);
    }

    public final Rect H(View view) {
        K k6 = (K) view.getLayoutParams();
        boolean z6 = k6.f12858c;
        Rect rect = k6.f12857b;
        if (!z6 || (this.f12934j0.f13003g && (k6.f12856a.isUpdated() || k6.f12856a.isInvalid()))) {
            return rect;
        }
        rect.set(0, 0, 0, 0);
        ArrayList arrayList = this.f12952t;
        int size = arrayList.size();
        for (int i6 = 0; i6 < size; i6++) {
            Rect rect2 = this.f12938m;
            rect2.set(0, 0, 0, 0);
            ((C1164n) arrayList.get(i6)).getClass();
            ((K) view.getLayoutParams()).f12856a.getLayoutPosition();
            rect2.set(0, 0, 0, 0);
            rect.left += rect2.left;
            rect.top += rect2.top;
            rect.right += rect2.right;
            rect.bottom += rect2.bottom;
        }
        k6.f12858c = false;
        return rect;
    }

    public final boolean I() {
        return !this.f12962y || this.f12905G || this.f12930e.g();
    }

    public boolean J() {
        return isChildrenDrawingOrderEnabled();
    }

    public final boolean K() {
        return this.f12907I > 0;
    }

    public final void L(int i6) {
        if (this.f12946q == null) {
            return;
        }
        setScrollState(2);
        this.f12946q.B0(i6);
        awakenScrollBars();
    }

    public final void M() {
        int iD = this.f12931f.D();
        for (int i6 = 0; i6 < iD; i6++) {
            ((K) this.f12931f.C(i6).getLayoutParams()).f12858c = true;
        }
        ArrayList arrayList = this.f12926c.f12884c;
        int size = arrayList.size();
        for (int i7 = 0; i7 < size; i7++) {
            K k6 = (K) ((Z) arrayList.get(i7)).itemView.getLayoutParams();
            if (k6 != null) {
                k6.f12858c = true;
            }
        }
    }

    public final void N(int i6, int i7, boolean z6) {
        int i8 = i6 + i7;
        int iD = this.f12931f.D();
        for (int i9 = 0; i9 < iD; i9++) {
            Z zG = G(this.f12931f.C(i9));
            if (zG != null && !zG.shouldIgnore()) {
                int i10 = zG.mPosition;
                V v3 = this.f12934j0;
                if (i10 >= i8) {
                    zG.offsetPosition(-i7, z6);
                    v3.f13002f = true;
                } else if (i10 >= i6) {
                    zG.flagRemovedAndOffsetPosition(i6 - 1, -i7, z6);
                    v3.f13002f = true;
                }
            }
        }
        P p6 = this.f12926c;
        ArrayList arrayList = p6.f12884c;
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            Z z7 = (Z) arrayList.get(size);
            if (z7 != null) {
                int i11 = z7.mPosition;
                if (i11 >= i8) {
                    z7.offsetPosition(-i7, z6);
                } else if (i11 >= i6) {
                    z7.addFlags(8);
                    p6.h(size);
                }
            }
        }
        requestLayout();
    }

    public final void O() {
        this.f12907I++;
    }

    public final void P(boolean z6) {
        int i6;
        AccessibilityManager accessibilityManager;
        int i7 = this.f12907I - 1;
        this.f12907I = i7;
        if (i7 < 1) {
            this.f12907I = 0;
            if (z6) {
                int i8 = this.f12902D;
                this.f12902D = 0;
                if (i8 != 0 && (accessibilityManager = this.f12904F) != null && accessibilityManager.isEnabled()) {
                    AccessibilityEvent accessibilityEventObtain = AccessibilityEvent.obtain();
                    accessibilityEventObtain.setEventType(2048);
                    accessibilityEventObtain.setContentChangeTypes(i8);
                    sendAccessibilityEventUnchecked(accessibilityEventObtain);
                }
                ArrayList arrayList = this.f12959w0;
                for (int size = arrayList.size() - 1; size >= 0; size--) {
                    Z z7 = (Z) arrayList.get(size);
                    if (z7.itemView.getParent() == this && !z7.shouldIgnore() && (i6 = z7.mPendingAccessibilityState) != -1) {
                        View view = z7.itemView;
                        Field field = F1.F.f1367a;
                        view.setImportantForAccessibility(i6);
                        z7.mPendingAccessibilityState = -1;
                    }
                }
                arrayList.clear();
            }
        }
    }

    public final void Q(MotionEvent motionEvent) {
        int actionIndex = motionEvent.getActionIndex();
        if (motionEvent.getPointerId(actionIndex) == this.f12916R) {
            int i6 = actionIndex == 0 ? 1 : 0;
            this.f12916R = motionEvent.getPointerId(i6);
            int x6 = (int) (motionEvent.getX(i6) + 0.5f);
            this.f12920V = x6;
            this.f12918T = x6;
            int y6 = (int) (motionEvent.getY(i6) + 0.5f);
            this.f12921W = y6;
            this.f12919U = y6;
        }
    }

    public final void R() {
        if (this.f12945p0 || !this.f12958w) {
            return;
        }
        Field field = F1.F.f1367a;
        postOnAnimation(this.f12961x0);
        this.f12945p0 = true;
    }

    public final void S() {
        boolean z6;
        boolean z7 = false;
        if (this.f12905G) {
            C0 c02 = this.f12930e;
            c02.k((ArrayList) c02.f2132c);
            c02.k((ArrayList) c02.f2133d);
            c02.f2130a = 0;
            if (this.f12906H) {
                this.f12946q.f0();
            }
        }
        if (this.f12914P == null || !this.f12946q.L0()) {
            this.f12930e.c();
        } else {
            this.f12930e.j();
        }
        boolean z8 = this.f12939m0 || this.f12941n0;
        boolean z9 = this.f12962y && this.f12914P != null && ((z6 = this.f12905G) || z8 || this.f12946q.f12847f) && (!z6 || this.f12944p.hasStableIds());
        V v3 = this.f12934j0;
        v3.f13006j = z9;
        if (z9 && z8 && !this.f12905G && this.f12914P != null && this.f12946q.L0()) {
            z7 = true;
        }
        v3.f13007k = z7;
    }

    public final void T(boolean z6) {
        this.f12906H = z6 | this.f12906H;
        this.f12905G = true;
        int iD = this.f12931f.D();
        for (int i6 = 0; i6 < iD; i6++) {
            Z zG = G(this.f12931f.C(i6));
            if (zG != null && !zG.shouldIgnore()) {
                zG.addFlags(6);
            }
        }
        M();
        P p6 = this.f12926c;
        ArrayList arrayList = p6.f12884c;
        int size = arrayList.size();
        for (int i7 = 0; i7 < size; i7++) {
            Z z7 = (Z) arrayList.get(i7);
            if (z7 != null) {
                z7.addFlags(6);
                z7.addChangePayload(null);
            }
        }
        B b5 = p6.f12889h.f12944p;
        if (b5 == null || !b5.hasStableIds()) {
            p6.g();
        }
    }

    public final void U(Z z6, C0186o c0186o) {
        z6.setFlags(0, 8192);
        boolean z7 = this.f12934j0.f13004h;
        i0 i0Var = this.f12933j;
        if (z7 && z6.isUpdated() && !z6.isRemoved() && !z6.shouldIgnore()) {
            ((C2592t) i0Var.f13106c).e(E(z6), z6);
        }
        n.d0 d0Var = (n.d0) i0Var.f13105b;
        j0 j0VarA = (j0) d0Var.get(z6);
        if (j0VarA == null) {
            j0VarA = j0.a();
            d0Var.put(z6, j0VarA);
        }
        j0VarA.f13111b = c0186o;
        j0VarA.f13110a |= 4;
    }

    public final int V(float f6, int i6) {
        float height = f6 / getHeight();
        float width = i6 / getWidth();
        EdgeEffect edgeEffect = this.f12910L;
        float f7 = 0.0f;
        if (edgeEffect == null || L4.a.J(edgeEffect) == 0.0f) {
            EdgeEffect edgeEffect2 = this.f12912N;
            if (edgeEffect2 != null && L4.a.J(edgeEffect2) != 0.0f) {
                if (canScrollHorizontally(1)) {
                    this.f12912N.onRelease();
                } else {
                    float fB0 = L4.a.b0(this.f12912N, width, height);
                    if (L4.a.J(this.f12912N) == 0.0f) {
                        this.f12912N.onRelease();
                    }
                    f7 = fB0;
                }
                invalidate();
            }
        } else {
            if (canScrollHorizontally(-1)) {
                this.f12910L.onRelease();
            } else {
                float f8 = -L4.a.b0(this.f12910L, -width, 1.0f - height);
                if (L4.a.J(this.f12910L) == 0.0f) {
                    this.f12910L.onRelease();
                }
                f7 = f8;
            }
            invalidate();
        }
        return Math.round(f7 * getWidth());
    }

    public final int W(float f6, int i6) {
        float width = f6 / getWidth();
        float height = i6 / getHeight();
        EdgeEffect edgeEffect = this.f12911M;
        float f7 = 0.0f;
        if (edgeEffect == null || L4.a.J(edgeEffect) == 0.0f) {
            EdgeEffect edgeEffect2 = this.f12913O;
            if (edgeEffect2 != null && L4.a.J(edgeEffect2) != 0.0f) {
                if (canScrollVertically(1)) {
                    this.f12913O.onRelease();
                } else {
                    float fB0 = L4.a.b0(this.f12913O, height, 1.0f - width);
                    if (L4.a.J(this.f12913O) == 0.0f) {
                        this.f12913O.onRelease();
                    }
                    f7 = fB0;
                }
                invalidate();
            }
        } else {
            if (canScrollVertically(-1)) {
                this.f12911M.onRelease();
            } else {
                float f8 = -L4.a.b0(this.f12911M, -height, width);
                if (L4.a.J(this.f12911M) == 0.0f) {
                    this.f12911M.onRelease();
                }
                f7 = f8;
            }
            invalidate();
        }
        return Math.round(f7 * getHeight());
    }

    public final void X(View view, View view2) {
        View view3 = view2 != null ? view2 : view;
        int width = view3.getWidth();
        int height = view3.getHeight();
        Rect rect = this.f12938m;
        rect.set(0, 0, width, height);
        ViewGroup.LayoutParams layoutParams = view3.getLayoutParams();
        if (layoutParams instanceof K) {
            K k6 = (K) layoutParams;
            if (!k6.f12858c) {
                int i6 = rect.left;
                Rect rect2 = k6.f12857b;
                rect.left = i6 - rect2.left;
                rect.right += rect2.right;
                rect.top -= rect2.top;
                rect.bottom += rect2.bottom;
            }
        }
        if (view2 != null) {
            offsetDescendantRectToMyCoords(view2, rect);
            offsetRectIntoDescendantCoords(view, rect);
        }
        this.f12946q.x0(this, view, this.f12938m, !this.f12962y, view2 == null);
    }

    public final void Y() {
        VelocityTracker velocityTracker = this.f12917S;
        if (velocityTracker != null) {
            velocityTracker.clear();
        }
        boolean zIsFinished = false;
        f0(0);
        EdgeEffect edgeEffect = this.f12910L;
        if (edgeEffect != null) {
            edgeEffect.onRelease();
            zIsFinished = this.f12910L.isFinished();
        }
        EdgeEffect edgeEffect2 = this.f12911M;
        if (edgeEffect2 != null) {
            edgeEffect2.onRelease();
            zIsFinished |= this.f12911M.isFinished();
        }
        EdgeEffect edgeEffect3 = this.f12912N;
        if (edgeEffect3 != null) {
            edgeEffect3.onRelease();
            zIsFinished |= this.f12912N.isFinished();
        }
        EdgeEffect edgeEffect4 = this.f12913O;
        if (edgeEffect4 != null) {
            edgeEffect4.onRelease();
            zIsFinished |= this.f12913O.isFinished();
        }
        if (zIsFinished) {
            Field field = F1.F.f1367a;
            postInvalidateOnAnimation();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x00c9  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x00e1  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00fe  */
    /* JADX WARN: Removed duplicated region for block: B:41:0x0106  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean Z(int i6, int i7, MotionEvent motionEvent, int i8) {
        int i9;
        int i10;
        int i11;
        int i12;
        boolean z6;
        boolean z7;
        k();
        B b5 = this.f12944p;
        int[] iArr = this.f12957v0;
        if (b5 != null) {
            iArr[0] = 0;
            iArr[1] = 0;
            a0(i6, i7, iArr);
            i9 = iArr[0];
            i10 = iArr[1];
            i11 = i6 - i9;
            i12 = i7 - i10;
        } else {
            i9 = 0;
            i10 = 0;
            i11 = 0;
            i12 = 0;
        }
        if (!this.f12952t.isEmpty()) {
            invalidate();
        }
        iArr[0] = 0;
        iArr[1] = 0;
        q(i9, i10, i11, i12, this.f12953t0, i8, iArr);
        int i13 = iArr[0];
        int i14 = i11 - i13;
        int i15 = iArr[1];
        int i16 = i12 - i15;
        boolean z8 = (i13 == 0 && i15 == 0) ? false : true;
        int i17 = this.f12920V;
        int[] iArr2 = this.f12953t0;
        int i18 = iArr2[0];
        this.f12920V = i17 - i18;
        int i19 = this.f12921W;
        int i20 = iArr2[1];
        this.f12921W = i19 - i20;
        int[] iArr3 = this.f12955u0;
        iArr3[0] = iArr3[0] + i18;
        iArr3[1] = iArr3[1] + i20;
        if (getOverScrollMode() != 2) {
            if (motionEvent == null || (motionEvent.getSource() & 8194) == 8194) {
                z6 = true;
            } else {
                float x6 = motionEvent.getX();
                float f6 = i14;
                float y6 = motionEvent.getY();
                float f7 = i16;
                if (f6 < 0.0f) {
                    t();
                    z6 = true;
                    L4.a.b0(this.f12910L, (-f6) / getWidth(), 1.0f - (y6 / getHeight()));
                } else {
                    z6 = true;
                    if (f6 > 0.0f) {
                        u();
                        L4.a.b0(this.f12912N, f6 / getWidth(), y6 / getHeight());
                    } else {
                        z7 = false;
                        if (f7 >= 0.0f) {
                            v();
                            L4.a.b0(this.f12911M, (-f7) / getHeight(), x6 / getWidth());
                        } else {
                            if (f7 > 0.0f) {
                                s();
                                L4.a.b0(this.f12913O, f7 / getHeight(), 1.0f - (x6 / getWidth()));
                            }
                            if (z7 || f6 != 0.0f || f7 != 0.0f) {
                                Field field = F1.F.f1367a;
                                postInvalidateOnAnimation();
                            }
                        }
                        z7 = z6;
                        if (z7) {
                            Field field2 = F1.F.f1367a;
                            postInvalidateOnAnimation();
                        }
                    }
                }
                z7 = z6;
                if (f7 >= 0.0f) {
                }
                z7 = z6;
                if (z7) {
                }
            }
            i(i6, i7);
        } else {
            z6 = true;
        }
        if (i9 != 0 || i10 != 0) {
            r(i9, i10);
        }
        if (!awakenScrollBars()) {
            invalidate();
        }
        if (!z8 && i9 == 0 && i10 == 0) {
            return false;
        }
        return z6;
    }

    public final void a0(int i6, int i7, int[] iArr) {
        Z z6;
        C4.f fVar = this.f12931f;
        d0();
        O();
        int i8 = B1.i.f450a;
        Trace.beginSection("RV Scroll");
        V v3 = this.f12934j0;
        x(v3);
        P p6 = this.f12926c;
        int iA0 = i6 != 0 ? this.f12946q.A0(i6, p6, v3) : 0;
        int iC0 = i7 != 0 ? this.f12946q.C0(i7, p6, v3) : 0;
        Trace.endSection();
        int iU = fVar.u();
        for (int i9 = 0; i9 < iU; i9++) {
            View viewT = fVar.t(i9);
            Z zF = F(viewT);
            if (zF != null && (z6 = zF.mShadowingHolder) != null) {
                View view = z6.itemView;
                int left = viewT.getLeft();
                int top = viewT.getTop();
                if (left != view.getLeft() || top != view.getTop()) {
                    view.layout(left, top, view.getWidth() + left, view.getHeight() + top);
                }
            }
        }
        P(true);
        e0(false);
        if (iArr != null) {
            iArr[0] = iA0;
            iArr[1] = iC0;
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void addFocusables(ArrayList arrayList, int i6, int i7) {
        J j4 = this.f12946q;
        if (j4 == null || !j4.W(this, arrayList, i6, i7)) {
            super.addFocusables(arrayList, i6, i7);
        }
    }

    public final boolean b0(EdgeEffect edgeEffect, int i6, int i7) {
        if (i6 > 0) {
            return true;
        }
        float fJ = L4.a.J(edgeEffect) * i7;
        float fAbs = Math.abs(-i6) * 0.35f;
        float f6 = this.f12922a * 0.015f;
        double dLog = Math.log(fAbs / f6);
        double d6 = f12891D0;
        return ((float) (Math.exp((d6 / (d6 - 1.0d)) * dLog) * ((double) f6))) < fJ;
    }

    public final void c0(int i6, int i7, boolean z6) {
        J j4 = this.f12946q;
        if (j4 == null) {
            Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.f12899B) {
            return;
        }
        if (!j4.d()) {
            i6 = 0;
        }
        if (!this.f12946q.e()) {
            i7 = 0;
        }
        if (i6 == 0 && i7 == 0) {
            return;
        }
        if (z6) {
            int i8 = i6 != 0 ? 1 : 0;
            if (i7 != 0) {
                i8 |= 2;
            }
            getScrollingChildHelper().d(i8, 1);
        }
        this.g0.c(i6, i7, Integer.MIN_VALUE, null);
    }

    @Override // android.view.ViewGroup
    public final boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return (layoutParams instanceof K) && this.f12946q.f((K) layoutParams);
    }

    @Override // android.view.View
    public final int computeHorizontalScrollExtent() {
        J j4 = this.f12946q;
        if (j4 != null && j4.d()) {
            return this.f12946q.j(this.f12934j0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeHorizontalScrollOffset() {
        J j4 = this.f12946q;
        if (j4 != null && j4.d()) {
            return this.f12946q.k(this.f12934j0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeHorizontalScrollRange() {
        J j4 = this.f12946q;
        if (j4 != null && j4.d()) {
            return this.f12946q.l(this.f12934j0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeVerticalScrollExtent() {
        J j4 = this.f12946q;
        if (j4 != null && j4.e()) {
            return this.f12946q.m(this.f12934j0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeVerticalScrollOffset() {
        J j4 = this.f12946q;
        if (j4 != null && j4.e()) {
            return this.f12946q.n(this.f12934j0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeVerticalScrollRange() {
        J j4 = this.f12946q;
        if (j4 != null && j4.e()) {
            return this.f12946q.o(this.f12934j0);
        }
        return 0;
    }

    public final void d0() {
        int i6 = this.f12964z + 1;
        this.f12964z = i6;
        if (i6 != 1 || this.f12899B) {
            return;
        }
        this.f12897A = false;
    }

    @Override // android.view.View
    public final boolean dispatchNestedFling(float f6, float f7, boolean z6) {
        ViewParent viewParentC;
        C0184m scrollingChildHelper = getScrollingChildHelper();
        if (scrollingChildHelper.f1455d && (viewParentC = scrollingChildHelper.c(0)) != null) {
            try {
                return viewParentC.onNestedFling(scrollingChildHelper.f1454c, f6, f7, z6);
            } catch (AbstractMethodError e6) {
                Log.e("ViewParentCompat", "ViewParent " + viewParentC + " does not implement interface method onNestedFling", e6);
            }
        }
        return false;
    }

    @Override // android.view.View
    public final boolean dispatchNestedPreFling(float f6, float f7) {
        ViewParent viewParentC;
        C0184m scrollingChildHelper = getScrollingChildHelper();
        if (scrollingChildHelper.f1455d && (viewParentC = scrollingChildHelper.c(0)) != null) {
            try {
                return viewParentC.onNestedPreFling(scrollingChildHelper.f1454c, f6, f7);
            } catch (AbstractMethodError e6) {
                Log.e("ViewParentCompat", "ViewParent " + viewParentC + " does not implement interface method onNestedPreFling", e6);
            }
        }
        return false;
    }

    @Override // android.view.View
    public final boolean dispatchNestedPreScroll(int i6, int i7, int[] iArr, int[] iArr2) {
        return getScrollingChildHelper().a(i6, i7, 0, iArr, iArr2);
    }

    @Override // android.view.View
    public final boolean dispatchNestedScroll(int i6, int i7, int i8, int i9, int[] iArr) {
        return getScrollingChildHelper().b(i6, i7, i8, i9, iArr, 0, null);
    }

    @Override // android.view.View
    public final boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        onPopulateAccessibilityEvent(accessibilityEvent);
        return true;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void dispatchRestoreInstanceState(SparseArray sparseArray) {
        dispatchThawSelfOnly(sparseArray);
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void dispatchSaveInstanceState(SparseArray sparseArray) {
        dispatchFreezeSelfOnly(sparseArray);
    }

    @Override // android.view.View
    public void draw(Canvas canvas) {
        boolean z6;
        super.draw(canvas);
        ArrayList arrayList = this.f12952t;
        int size = arrayList.size();
        boolean z7 = false;
        for (int i6 = 0; i6 < size; i6++) {
            C1164n c1164n = (C1164n) arrayList.get(i6);
            if (c1164n.f13136q != c1164n.f13138s.getWidth() || c1164n.f13137r != c1164n.f13138s.getHeight()) {
                c1164n.f13136q = c1164n.f13138s.getWidth();
                c1164n.f13137r = c1164n.f13138s.getHeight();
                c1164n.d(0);
            } else if (c1164n.f13119A != 0) {
                if (c1164n.f13139t) {
                    int i7 = c1164n.f13136q;
                    int i8 = c1164n.f13125e;
                    int i9 = i7 - i8;
                    int i10 = c1164n.l;
                    int i11 = c1164n.f13131k;
                    int i12 = i10 - (i11 / 2);
                    StateListDrawable stateListDrawable = c1164n.f13123c;
                    stateListDrawable.setBounds(0, 0, i8, i11);
                    int i13 = c1164n.f13137r;
                    Drawable drawable = c1164n.f13124d;
                    drawable.setBounds(0, 0, c1164n.f13126f, i13);
                    RecyclerView recyclerView = c1164n.f13138s;
                    Field field = F1.F.f1367a;
                    if (recyclerView.getLayoutDirection() == 1) {
                        drawable.draw(canvas);
                        canvas.translate(i8, i12);
                        canvas.scale(-1.0f, 1.0f);
                        stateListDrawable.draw(canvas);
                        canvas.scale(-1.0f, 1.0f);
                        canvas.translate(-i8, -i12);
                    } else {
                        canvas.translate(i9, 0.0f);
                        drawable.draw(canvas);
                        canvas.translate(0.0f, i12);
                        stateListDrawable.draw(canvas);
                        canvas.translate(-i9, -i12);
                    }
                }
                if (c1164n.f13140u) {
                    int i14 = c1164n.f13137r;
                    int i15 = c1164n.f13129i;
                    int i16 = i14 - i15;
                    int i17 = c1164n.f13134o;
                    int i18 = c1164n.f13133n;
                    int i19 = i17 - (i18 / 2);
                    StateListDrawable stateListDrawable2 = c1164n.f13127g;
                    stateListDrawable2.setBounds(0, 0, i18, i15);
                    int i20 = c1164n.f13136q;
                    Drawable drawable2 = c1164n.f13128h;
                    drawable2.setBounds(0, 0, i20, c1164n.f13130j);
                    canvas.translate(0.0f, i16);
                    drawable2.draw(canvas);
                    canvas.translate(i19, 0.0f);
                    stateListDrawable2.draw(canvas);
                    canvas.translate(-i19, -i16);
                }
            }
        }
        EdgeEffect edgeEffect = this.f12910L;
        if (edgeEffect == null || edgeEffect.isFinished()) {
            z6 = false;
        } else {
            int iSave = canvas.save();
            int paddingBottom = this.f12935k ? getPaddingBottom() : 0;
            canvas.rotate(270.0f);
            canvas.translate((-getHeight()) + paddingBottom, 0.0f);
            EdgeEffect edgeEffect2 = this.f12910L;
            z6 = edgeEffect2 != null && edgeEffect2.draw(canvas);
            canvas.restoreToCount(iSave);
        }
        EdgeEffect edgeEffect3 = this.f12911M;
        if (edgeEffect3 != null && !edgeEffect3.isFinished()) {
            int iSave2 = canvas.save();
            if (this.f12935k) {
                canvas.translate(getPaddingLeft(), getPaddingTop());
            }
            EdgeEffect edgeEffect4 = this.f12911M;
            z6 |= edgeEffect4 != null && edgeEffect4.draw(canvas);
            canvas.restoreToCount(iSave2);
        }
        EdgeEffect edgeEffect5 = this.f12912N;
        if (edgeEffect5 != null && !edgeEffect5.isFinished()) {
            int iSave3 = canvas.save();
            int width = getWidth();
            int paddingTop = this.f12935k ? getPaddingTop() : 0;
            canvas.rotate(90.0f);
            canvas.translate(paddingTop, -width);
            EdgeEffect edgeEffect6 = this.f12912N;
            z6 |= edgeEffect6 != null && edgeEffect6.draw(canvas);
            canvas.restoreToCount(iSave3);
        }
        EdgeEffect edgeEffect7 = this.f12913O;
        if (edgeEffect7 != null && !edgeEffect7.isFinished()) {
            int iSave4 = canvas.save();
            canvas.rotate(180.0f);
            if (this.f12935k) {
                canvas.translate(getPaddingRight() + (-getWidth()), getPaddingBottom() + (-getHeight()));
            } else {
                canvas.translate(-getWidth(), -getHeight());
            }
            EdgeEffect edgeEffect8 = this.f12913O;
            if (edgeEffect8 != null && edgeEffect8.draw(canvas)) {
                z7 = true;
            }
            z6 |= z7;
            canvas.restoreToCount(iSave4);
        }
        if ((z6 || this.f12914P == null || arrayList.size() <= 0 || !this.f12914P.f()) ? z6 : true) {
            Field field2 = F1.F.f1367a;
            postInvalidateOnAnimation();
        }
    }

    @Override // android.view.ViewGroup
    public final boolean drawChild(Canvas canvas, View view, long j4) {
        return super.drawChild(canvas, view, j4);
    }

    public final void e(Z z6) {
        View view = z6.itemView;
        boolean z7 = view.getParent() == this;
        this.f12926c.m(F(view));
        if (z6.isTmpDetached()) {
            this.f12931f.i(view, -1, view.getLayoutParams(), true);
            return;
        }
        if (!z7) {
            this.f12931f.g(view, -1, true);
            return;
        }
        C4.f fVar = this.f12931f;
        int iIndexOfChild = ((C1175z) fVar.f741b).f13194a.indexOfChild(view);
        if (iIndexOfChild >= 0) {
            ((C1152b) fVar.f742c).j(iIndexOfChild);
            fVar.F(view);
        } else {
            throw new IllegalArgumentException("view is not a child, cannot hide " + view);
        }
    }

    public final void e0(boolean z6) {
        if (this.f12964z < 1) {
            this.f12964z = 1;
        }
        if (!z6 && !this.f12899B) {
            this.f12897A = false;
        }
        if (this.f12964z == 1) {
            if (z6 && this.f12897A && !this.f12899B && this.f12946q != null && this.f12944p != null) {
                m();
            }
            if (!this.f12899B) {
                this.f12897A = false;
            }
        }
        this.f12964z--;
    }

    public final void f(String str) {
        if (K()) {
            if (str != null) {
                throw new IllegalStateException(str);
            }
            throw new IllegalStateException("Cannot call this method while RecyclerView is computing a layout or scrolling" + w());
        }
        if (this.f12908J > 0) {
            Log.w("RecyclerView", "Cannot call this method in a scroll callback. Scroll callbacks mightbe run during a measure & layout pass where you cannot change theRecyclerView data. Any method call that might change the structureof the RecyclerView or the adapter contents should be postponed tothe next frame.", new IllegalStateException("" + w()));
        }
    }

    public final void f0(int i6) {
        getScrollingChildHelper().e(i6);
    }

    /* JADX WARN: Removed duplicated region for block: B:121:0x0167  */
    /* JADX WARN: Removed duplicated region for block: B:140:0x019e A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:141:0x019f  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x0063  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0065  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0068  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x006a  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x006e  */
    /* JADX WARN: Removed duplicated region for block: B:41:0x0071  */
    /* JADX WARN: Removed duplicated region for block: B:44:0x0078  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x007a  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x007d  */
    /* JADX WARN: Removed duplicated region for block: B:61:0x00b9  */
    /* JADX WARN: Removed duplicated region for block: B:70:0x00d0 A[ADDED_TO_REGION] */
    @Override // android.view.ViewGroup, android.view.ViewParent
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final View focusSearch(View view, int i6) {
        View viewY;
        int i7;
        byte b5;
        boolean z6;
        View viewD0 = this.f12946q.d0(i6, view);
        if (viewD0 != null) {
            return viewD0;
        }
        boolean z7 = true;
        boolean z8 = (this.f12944p == null || this.f12946q == null || K() || this.f12899B) ? false : true;
        FocusFinder focusFinder = FocusFinder.getInstance();
        V v3 = this.f12934j0;
        P p6 = this.f12926c;
        if (!z8 || (i6 != 2 && i6 != 1)) {
            View viewFindNextFocus = focusFinder.findNextFocus(this, view, i6);
            if (viewFindNextFocus == null && z8) {
                k();
                if (y(view) != null) {
                    d0();
                    viewY = this.f12946q.Y(view, i6, p6, v3);
                    e0(false);
                }
                return null;
            }
            viewY = viewFindNextFocus;
            if (viewY == null && !viewY.hasFocusable()) {
                if (getFocusedChild() == null) {
                    return super.focusSearch(view, i6);
                }
                X(viewY, null);
                return view;
            }
            if (viewY == null || viewY == this || viewY == view) {
                z7 = false;
            } else if (y(viewY) == null) {
                z7 = false;
            } else if (view != null && y(view) != null) {
                int width = view.getWidth();
                int height = view.getHeight();
                Rect rect = this.f12938m;
                rect.set(0, 0, width, height);
                int width2 = viewY.getWidth();
                int height2 = viewY.getHeight();
                Rect rect2 = this.f12940n;
                rect2.set(0, 0, width2, height2);
                offsetDescendantRectToMyCoords(view, rect);
                offsetDescendantRectToMyCoords(viewY, rect2);
                int i8 = this.f12946q.G() == 1 ? -1 : 1;
                int i9 = rect.left;
                int i10 = rect2.left;
                if ((i9 < i10 || rect.right <= i10) && rect.right < rect2.right) {
                    i7 = 1;
                } else {
                    int i11 = rect.right;
                    int i12 = rect2.right;
                    i7 = ((i11 > i12 || i9 >= i12) && i9 > i10) ? -1 : 0;
                }
                int i13 = rect.top;
                int i14 = rect2.top;
                if ((i13 < i14 || rect.bottom <= i14) && rect.bottom < rect2.bottom) {
                    b5 = 1;
                } else {
                    int i15 = rect.bottom;
                    int i16 = rect2.bottom;
                    b5 = ((i15 > i16 || i13 >= i16) && i13 > i14) ? (byte) -1 : (byte) 0;
                }
                if (i6 != 1) {
                    if (i6 != 2) {
                        if (i6 != 17) {
                            if (i6 != 33) {
                                if (i6 != 66) {
                                    if (i6 != 130) {
                                        throw new IllegalArgumentException("Invalid direction: " + i6 + w());
                                    }
                                    if (b5 <= 0) {
                                    }
                                } else if (i7 <= 0) {
                                }
                            } else if (b5 >= 0) {
                            }
                        } else if (i7 >= 0) {
                        }
                    } else if (b5 <= 0 && (b5 != 0 || i7 * i8 <= 0)) {
                    }
                } else if (b5 >= 0 && (b5 != 0 || i7 * i8 >= 0)) {
                }
            }
            return z7 ? viewY : super.focusSearch(view, i6);
        }
        if (this.f12946q.e()) {
            if (focusFinder.findNextFocus(this, view, i6 == 2 ? TsExtractor.TS_STREAM_TYPE_HDMV_DTS : 33) == null) {
                z6 = true;
            }
            if (!z6 && this.f12946q.d()) {
                z6 = focusFinder.findNextFocus(this, view, !((this.f12946q.G() != 1) ^ (i6 != 2)) ? 66 : 17) != null;
            }
            if (z6) {
                k();
                if (y(view) != null) {
                    d0();
                    this.f12946q.Y(view, i6, p6, v3);
                    e0(false);
                }
                return null;
            }
            viewY = focusFinder.findNextFocus(this, view, i6);
            if (viewY == null) {
            }
            if (viewY == null) {
                z7 = false;
            }
            if (z7) {
            }
        }
        z6 = false;
        if (!z6) {
            if (focusFinder.findNextFocus(this, view, !((this.f12946q.G() != 1) ^ (i6 != 2)) ? 66 : 17) != null) {
            }
        }
        if (z6) {
        }
        viewY = focusFinder.findNextFocus(this, view, i6);
        if (viewY == null) {
        }
        if (viewY == null) {
        }
        if (z7) {
        }
    }

    @Override // android.view.ViewGroup
    public final ViewGroup.LayoutParams generateDefaultLayoutParams() {
        J j4 = this.f12946q;
        if (j4 != null) {
            return j4.s();
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + w());
    }

    @Override // android.view.ViewGroup
    public final ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        J j4 = this.f12946q;
        if (j4 != null) {
            return j4.t(getContext(), attributeSet);
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + w());
    }

    @Override // android.view.ViewGroup, android.view.View
    public CharSequence getAccessibilityClassName() {
        return "androidx.recyclerview.widget.RecyclerView";
    }

    public B getAdapter() {
        return this.f12944p;
    }

    @Override // android.view.View
    public int getBaseline() {
        J j4 = this.f12946q;
        if (j4 == null) {
            return super.getBaseline();
        }
        j4.getClass();
        return -1;
    }

    @Override // android.view.ViewGroup
    public int getChildDrawingOrder(int i6, int i7) {
        return super.getChildDrawingOrder(i6, i7);
    }

    @Override // android.view.ViewGroup
    public boolean getClipToPadding() {
        return this.f12935k;
    }

    public b0 getCompatAccessibilityDelegate() {
        return this.f12947q0;
    }

    public F getEdgeEffectFactory() {
        return this.f12909K;
    }

    public G getItemAnimator() {
        return this.f12914P;
    }

    public int getItemDecorationCount() {
        return this.f12952t.size();
    }

    public J getLayoutManager() {
        return this.f12946q;
    }

    public int getMaxFlingVelocity() {
        return this.f12927c0;
    }

    public int getMinFlingVelocity() {
        return this.f12925b0;
    }

    public long getNanoTime() {
        if (f12893G0) {
            return System.nanoTime();
        }
        return 0L;
    }

    public L getOnFlingListener() {
        return null;
    }

    public boolean getPreserveFocusAfterLayout() {
        return this.f0;
    }

    public O getRecycledViewPool() {
        return this.f12926c.c();
    }

    public int getScrollState() {
        return this.f12915Q;
    }

    public final void h() {
        int iD = this.f12931f.D();
        for (int i6 = 0; i6 < iD; i6++) {
            Z zG = G(this.f12931f.C(i6));
            if (!zG.shouldIgnore()) {
                zG.clearOldPosition();
            }
        }
        P p6 = this.f12926c;
        ArrayList arrayList = p6.f12884c;
        int size = arrayList.size();
        for (int i7 = 0; i7 < size; i7++) {
            ((Z) arrayList.get(i7)).clearOldPosition();
        }
        ArrayList arrayList2 = p6.f12882a;
        int size2 = arrayList2.size();
        for (int i8 = 0; i8 < size2; i8++) {
            ((Z) arrayList2.get(i8)).clearOldPosition();
        }
        ArrayList arrayList3 = p6.f12883b;
        if (arrayList3 != null) {
            int size3 = arrayList3.size();
            for (int i9 = 0; i9 < size3; i9++) {
                ((Z) p6.f12883b.get(i9)).clearOldPosition();
            }
        }
    }

    @Override // android.view.View
    public final boolean hasNestedScrollingParent() {
        return getScrollingChildHelper().c(0) != null;
    }

    public final void i(int i6, int i7) {
        boolean zIsFinished;
        EdgeEffect edgeEffect = this.f12910L;
        if (edgeEffect == null || edgeEffect.isFinished() || i6 <= 0) {
            zIsFinished = false;
        } else {
            this.f12910L.onRelease();
            zIsFinished = this.f12910L.isFinished();
        }
        EdgeEffect edgeEffect2 = this.f12912N;
        if (edgeEffect2 != null && !edgeEffect2.isFinished() && i6 < 0) {
            this.f12912N.onRelease();
            zIsFinished |= this.f12912N.isFinished();
        }
        EdgeEffect edgeEffect3 = this.f12911M;
        if (edgeEffect3 != null && !edgeEffect3.isFinished() && i7 > 0) {
            this.f12911M.onRelease();
            zIsFinished |= this.f12911M.isFinished();
        }
        EdgeEffect edgeEffect4 = this.f12913O;
        if (edgeEffect4 != null && !edgeEffect4.isFinished() && i7 < 0) {
            this.f12913O.onRelease();
            zIsFinished |= this.f12913O.isFinished();
        }
        if (zIsFinished) {
            Field field = F1.F.f1367a;
            postInvalidateOnAnimation();
        }
    }

    @Override // android.view.View
    public final boolean isAttachedToWindow() {
        return this.f12958w;
    }

    @Override // android.view.ViewGroup
    public final boolean isLayoutSuppressed() {
        return this.f12899B;
    }

    @Override // android.view.View
    public final boolean isNestedScrollingEnabled() {
        return getScrollingChildHelper().f1455d;
    }

    public final void k() {
        C4.f fVar = this.f12931f;
        C0 c02 = this.f12930e;
        if (!this.f12962y || this.f12905G) {
            int i6 = B1.i.f450a;
            Trace.beginSection("RV FullInvalidate");
            m();
            Trace.endSection();
            return;
        }
        if (c02.g()) {
            int i7 = c02.f2130a;
            if ((i7 & 4) == 0 || (i7 & 11) != 0) {
                if (c02.g()) {
                    int i8 = B1.i.f450a;
                    Trace.beginSection("RV FullInvalidate");
                    m();
                    Trace.endSection();
                    return;
                }
                return;
            }
            int i9 = B1.i.f450a;
            Trace.beginSection("RV PartialInvalidate");
            d0();
            O();
            c02.j();
            if (!this.f12897A) {
                int iU = fVar.u();
                int i10 = 0;
                while (true) {
                    if (i10 < iU) {
                        Z zG = G(fVar.t(i10));
                        if (zG != null && !zG.shouldIgnore() && zG.isUpdated()) {
                            m();
                            break;
                        }
                        i10++;
                    } else {
                        c02.b();
                        break;
                    }
                }
            }
            e0(true);
            P(true);
            Trace.endSection();
        }
    }

    public final void l(int i6, int i7) {
        int paddingRight = getPaddingRight() + getPaddingLeft();
        Field field = F1.F.f1367a;
        setMeasuredDimension(J.g(i6, paddingRight, getMinimumWidth()), J.g(i7, getPaddingBottom() + getPaddingTop(), getMinimumHeight()));
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:166:0x035c  */
    /* JADX WARN: Removed duplicated region for block: B:188:0x03b0  */
    /* JADX WARN: Removed duplicated region for block: B:190:0x03b3  */
    /* JADX WARN: Removed duplicated region for block: B:196:0x03cd  */
    /* JADX WARN: Type inference failed for: r3v11 */
    /* JADX WARN: Type inference failed for: r3v18 */
    /* JADX WARN: Type inference failed for: r3v19, types: [int] */
    /* JADX WARN: Type inference failed for: r3v22 */
    /* JADX WARN: Type inference failed for: r3v25 */
    /* JADX WARN: Type inference failed for: r3v26 */
    /* JADX WARN: Type inference failed for: r3v27 */
    /* JADX WARN: Type inference failed for: r3v28 */
    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$UnknownArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m() {
        boolean z6;
        Z z7;
        View viewFindViewById;
        C0186o c0186o;
        ?? r32;
        RecyclerView recyclerView;
        boolean zG;
        boolean z8;
        if (this.f12944p == null) {
            Log.w("RecyclerView", "No adapter attached; skipping layout");
            return;
        }
        if (this.f12946q == null) {
            Log.e("RecyclerView", "No layout manager attached; skipping layout");
            return;
        }
        V v3 = this.f12934j0;
        boolean z9 = false;
        v3.f13005i = false;
        boolean z10 = true;
        boolean z11 = this.f12963y0 && !(this.f12965z0 == getWidth() && this.f12898A0 == getHeight());
        this.f12965z0 = 0;
        this.f12898A0 = 0;
        this.f12963y0 = false;
        if (v3.f13000d == 1) {
            n();
            this.f12946q.D0(this);
            o();
        } else {
            C0 c02 = this.f12930e;
            if ((((ArrayList) c02.f2133d).isEmpty() || ((ArrayList) c02.f2132c).isEmpty()) && !z11 && this.f12946q.f12854n == getWidth() && this.f12946q.f12855o == getHeight()) {
                this.f12946q.D0(this);
            } else {
                this.f12946q.D0(this);
                o();
            }
        }
        v3.a(4);
        d0();
        O();
        v3.f13000d = 1;
        boolean z12 = v3.f13006j;
        P p6 = this.f12926c;
        i0 i0Var = this.f12933j;
        if (z12) {
            int iU = this.f12931f.u() - 1;
            while (iU >= 0) {
                Z zG2 = G(this.f12931f.t(iU));
                if (zG2.shouldIgnore()) {
                    z8 = z10;
                } else {
                    long jE = E(zG2);
                    this.f12914P.getClass();
                    C0186o c0186o2 = new C0186o();
                    c0186o2.a(zG2);
                    Z z13 = (Z) ((C2592t) i0Var.f13106c).b(jE);
                    if (z13 == null || z13.shouldIgnore()) {
                        z8 = z10;
                        i0Var.b(zG2, c0186o2);
                    } else {
                        n.d0 d0Var = (n.d0) i0Var.f13105b;
                        z8 = z10;
                        j0 j0Var = (j0) d0Var.get(z13);
                        boolean z14 = (j0Var == null || (j0Var.f13110a & 1) == 0) ? false : z8;
                        j0 j0Var2 = (j0) d0Var.get(zG2);
                        boolean z15 = (j0Var2 == null || (j0Var2.f13110a & 1) == 0) ? false : z8;
                        if (z14 && z13 == zG2) {
                            i0Var.b(zG2, c0186o2);
                        } else {
                            C0186o c0186oQ = i0Var.q(z13, 4);
                            i0Var.b(zG2, c0186o2);
                            C0186o c0186oQ2 = i0Var.q(zG2, 8);
                            if (c0186oQ == null) {
                                int iU2 = this.f12931f.u();
                                for (int i6 = 0; i6 < iU2; i6++) {
                                    Z zG3 = G(this.f12931f.t(i6));
                                    if (zG3 != zG2 && E(zG3) == jE) {
                                        B b5 = this.f12944p;
                                        if (b5 == null || !b5.hasStableIds()) {
                                            throw new IllegalStateException("Two different ViewHolders have the same change ID. This might happen due to inconsistent Adapter update events or if the LayoutManager lays out the same View multiple times.\n ViewHolder 1:" + zG3 + " \n View Holder 2:" + zG2 + w());
                                        }
                                        throw new IllegalStateException("Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.\n ViewHolder 1:" + zG3 + " \n View Holder 2:" + zG2 + w());
                                    }
                                }
                                Log.e("RecyclerView", "Problem while matching changed view holders with the newones. The pre-layout information for the change holder " + z13 + " cannot be found but it is necessary for " + zG2 + w());
                            } else {
                                z13.setIsRecyclable(false);
                                if (z14) {
                                    e(z13);
                                }
                                if (z13 != zG2) {
                                    if (z15) {
                                        e(zG2);
                                    }
                                    z13.mShadowedHolder = zG2;
                                    e(z13);
                                    p6.m(z13);
                                    zG2.setIsRecyclable(false);
                                    zG2.mShadowingHolder = z13;
                                }
                                if (this.f12914P.a(z13, zG2, c0186oQ, c0186oQ2)) {
                                    R();
                                }
                            }
                        }
                    }
                }
                iU--;
                z10 = z8;
            }
            z6 = z10;
            n.d0 d0Var2 = (n.d0) i0Var.f13105b;
            int i7 = d0Var2.f21416c - 1;
            while (i7 >= 0) {
                Z z16 = (Z) d0Var2.g(i7);
                j0 j0Var3 = (j0) d0Var2.h(i7);
                int i8 = j0Var3.f13110a;
                int i9 = i8 & 3;
                C1175z c1175z = this.f12900B0;
                if (i9 == 3) {
                    RecyclerView recyclerView2 = c1175z.f13194a;
                    recyclerView2.f12946q.u0(z16.itemView, recyclerView2.f12926c);
                    r32 = z9;
                } else if ((i8 & 1) != 0) {
                    C0186o c0186o3 = j0Var3.f13111b;
                    if (c0186o3 == null) {
                        RecyclerView recyclerView3 = c1175z.f13194a;
                        recyclerView3.f12946q.u0(z16.itemView, recyclerView3.f12926c);
                        r32 = z9;
                    } else {
                        c1175z.g(z16, c0186o3, j0Var3.f13112c);
                        r32 = z9;
                    }
                } else if ((i8 & 14) == 14) {
                    c1175z.f(z16, j0Var3.f13111b, j0Var3.f13112c);
                    r32 = z9;
                } else if ((i8 & 12) == 12) {
                    C0186o c0186o4 = j0Var3.f13111b;
                    C0186o c0186o5 = j0Var3.f13112c;
                    c1175z.getClass();
                    z16.setIsRecyclable(z9);
                    RecyclerView recyclerView4 = c1175z.f13194a;
                    if (!recyclerView4.f12905G) {
                        C1159i c1159i = (C1159i) recyclerView4.f12914P;
                        c1159i.getClass();
                        int i10 = c0186o4.f1462a;
                        int i11 = c0186o5.f1462a;
                        if (i10 == i11 && c0186o4.f1463b == c0186o5.f1463b) {
                            c1159i.c(z16);
                            recyclerView = recyclerView4;
                            zG = false;
                        } else {
                            recyclerView = recyclerView4;
                            zG = c1159i.g(z16, i10, c0186o4.f1463b, i11, c0186o5.f1463b);
                        }
                        if (zG) {
                            recyclerView.R();
                        }
                    } else if (recyclerView4.f12914P.a(z16, z16, c0186o4, c0186o5)) {
                        recyclerView4.R();
                    }
                    r32 = 0;
                } else {
                    if ((i8 & 4) != 0) {
                        c0186o = null;
                        c1175z.g(z16, j0Var3.f13111b, null);
                    } else {
                        c0186o = null;
                        if ((i8 & 8) != 0) {
                            c1175z.f(z16, j0Var3.f13111b, j0Var3.f13112c);
                        }
                    }
                    r32 = 0;
                    j0Var3.f13110a = r32;
                    j0Var3.f13111b = c0186o;
                    j0Var3.f13112c = c0186o;
                    j0.f13109d.b(j0Var3);
                    i7--;
                    z9 = false;
                }
                c0186o = null;
                j0Var3.f13110a = r32;
                j0Var3.f13111b = c0186o;
                j0Var3.f13112c = c0186o;
                j0.f13109d.b(j0Var3);
                i7--;
                z9 = false;
            }
        } else {
            z6 = true;
        }
        View view = null;
        this.f12946q.t0(p6);
        v3.f12998b = v3.f13001e;
        this.f12905G = false;
        this.f12906H = false;
        v3.f13006j = false;
        v3.f13007k = false;
        this.f12946q.f12847f = false;
        ArrayList arrayList = p6.f12883b;
        if (arrayList != null) {
            arrayList.clear();
        }
        J j4 = this.f12946q;
        if (j4.f12852k) {
            j4.f12851j = 0;
            j4.f12852k = false;
            p6.n();
        }
        this.f12946q.l0(v3);
        P(z6);
        e0(false);
        ((n.d0) i0Var.f13105b).clear();
        ((C2592t) i0Var.f13106c).a();
        int[] iArr = this.f12949r0;
        int i12 = iArr[0];
        int i13 = iArr[1];
        A(iArr);
        if ((iArr[0] == i12 && iArr[1] == i13) ? false : true) {
            r(0, 0);
        }
        if (this.f0 && this.f12944p != null && hasFocus() && getDescendantFocusability() != 393216 && (getDescendantFocusability() != 131072 || !isFocused())) {
            if (!isFocused()) {
                if (((ArrayList) this.f12931f.f743d).contains(getFocusedChild())) {
                    if (v3.f13008m == -1 || !this.f12944p.hasStableIds()) {
                        z7 = null;
                        if (z7 == null) {
                            if (!((ArrayList) this.f12931f.f743d).contains(z7.itemView) && z7.itemView.hasFocusable()) {
                                view = z7.itemView;
                            } else if (this.f12931f.u() > 0) {
                                int i14 = v3.l;
                                int i15 = i14 != -1 ? i14 : 0;
                                int iB = v3.b();
                                for (int i16 = i15; i16 < iB; i16++) {
                                    Z zC = C(i16);
                                    if (zC == null) {
                                        break;
                                    }
                                    if (zC.itemView.hasFocusable()) {
                                        view = zC.itemView;
                                        break;
                                    }
                                }
                                int iMin = Math.min(iB, i15) - 1;
                                while (true) {
                                    if (iMin < 0) {
                                        break;
                                    }
                                    Z zC2 = C(iMin);
                                    if (zC2 == null) {
                                        break;
                                    }
                                    if (zC2.itemView.hasFocusable()) {
                                        view = zC2.itemView;
                                        break;
                                    }
                                    iMin--;
                                }
                            }
                            if (view != null) {
                                int i17 = v3.f13009n;
                                if (i17 != -1 && (viewFindViewById = view.findViewById(i17)) != null && viewFindViewById.isFocusable()) {
                                    view = viewFindViewById;
                                }
                                view.requestFocus();
                            }
                        }
                    } else {
                        long j6 = v3.f13008m;
                        B b6 = this.f12944p;
                        if (b6 != null && b6.hasStableIds()) {
                            int iD = this.f12931f.D();
                            int i18 = 0;
                            z7 = null;
                            while (true) {
                                if (i18 >= iD) {
                                    break;
                                }
                                Z zG4 = G(this.f12931f.C(i18));
                                if (zG4 != null && !zG4.isRemoved() && zG4.getItemId() == j6) {
                                    if (!((ArrayList) this.f12931f.f743d).contains(zG4.itemView)) {
                                        z7 = zG4;
                                        break;
                                    }
                                    z7 = zG4;
                                }
                                i18++;
                            }
                        }
                        if (z7 == null) {
                        }
                    }
                }
            }
        }
        v3.f13008m = -1L;
        v3.l = -1;
        v3.f13009n = -1;
    }

    public final void n() {
        j0 j0Var;
        View viewY;
        V v3 = this.f12934j0;
        v3.a(1);
        x(v3);
        v3.f13005i = false;
        d0();
        i0 i0Var = this.f12933j;
        ((n.d0) i0Var.f13105b).clear();
        C2592t c2592t = (C2592t) i0Var.f13106c;
        c2592t.a();
        O();
        S();
        Z zF = null;
        View focusedChild = (this.f0 && hasFocus() && this.f12944p != null) ? getFocusedChild() : null;
        if (focusedChild != null && (viewY = y(focusedChild)) != null) {
            zF = F(viewY);
        }
        if (zF == null) {
            v3.f13008m = -1L;
            v3.l = -1;
            v3.f13009n = -1;
        } else {
            v3.f13008m = this.f12944p.hasStableIds() ? zF.getItemId() : -1L;
            v3.l = this.f12905G ? -1 : zF.isRemoved() ? zF.mOldPosition : zF.getAbsoluteAdapterPosition();
            View focusedChild2 = zF.itemView;
            int id = focusedChild2.getId();
            while (!focusedChild2.isFocused() && (focusedChild2 instanceof ViewGroup) && focusedChild2.hasFocus()) {
                focusedChild2 = ((ViewGroup) focusedChild2).getFocusedChild();
                if (focusedChild2.getId() != -1) {
                    id = focusedChild2.getId();
                }
            }
            v3.f13009n = id;
        }
        v3.f13004h = v3.f13006j && this.f12941n0;
        this.f12941n0 = false;
        this.f12939m0 = false;
        v3.f13003g = v3.f13007k;
        v3.f13001e = this.f12944p.getItemCount();
        A(this.f12949r0);
        boolean z6 = v3.f13006j;
        n.d0 d0Var = (n.d0) i0Var.f13105b;
        if (z6) {
            int iU = this.f12931f.u();
            for (int i6 = 0; i6 < iU; i6++) {
                Z zG = G(this.f12931f.t(i6));
                if (!zG.shouldIgnore() && (!zG.isInvalid() || this.f12944p.hasStableIds())) {
                    G g6 = this.f12914P;
                    G.b(zG);
                    zG.getUnmodifiedPayloads();
                    g6.getClass();
                    C0186o c0186o = new C0186o();
                    c0186o.a(zG);
                    j0 j0VarA = (j0) d0Var.get(zG);
                    if (j0VarA == null) {
                        j0VarA = j0.a();
                        d0Var.put(zG, j0VarA);
                    }
                    j0VarA.f13111b = c0186o;
                    j0VarA.f13110a |= 4;
                    if (v3.f13004h && zG.isUpdated() && !zG.isRemoved() && !zG.shouldIgnore() && !zG.isInvalid()) {
                        c2592t.e(E(zG), zG);
                    }
                }
            }
        }
        if (v3.f13007k) {
            int iD = this.f12931f.D();
            for (int i7 = 0; i7 < iD; i7++) {
                Z zG2 = G(this.f12931f.C(i7));
                if (!zG2.shouldIgnore()) {
                    zG2.saveOldPosition();
                }
            }
            boolean z7 = v3.f13002f;
            v3.f13002f = false;
            this.f12946q.k0(this.f12926c, v3);
            v3.f13002f = z7;
            for (int i8 = 0; i8 < this.f12931f.u(); i8++) {
                Z zG3 = G(this.f12931f.t(i8));
                if (!zG3.shouldIgnore() && ((j0Var = (j0) d0Var.get(zG3)) == null || (j0Var.f13110a & 4) == 0)) {
                    G.b(zG3);
                    boolean zHasAnyOfTheFlags = zG3.hasAnyOfTheFlags(8192);
                    G g7 = this.f12914P;
                    zG3.getUnmodifiedPayloads();
                    g7.getClass();
                    C0186o c0186o2 = new C0186o();
                    c0186o2.a(zG3);
                    if (zHasAnyOfTheFlags) {
                        U(zG3, c0186o2);
                    } else {
                        j0 j0VarA2 = (j0) d0Var.get(zG3);
                        if (j0VarA2 == null) {
                            j0VarA2 = j0.a();
                            d0Var.put(zG3, j0VarA2);
                        }
                        j0VarA2.f13110a |= 2;
                        j0VarA2.f13111b = c0186o2;
                    }
                }
            }
            h();
        } else {
            h();
        }
        P(true);
        e0(false);
        v3.f13000d = 2;
    }

    public final void o() {
        d0();
        O();
        V v3 = this.f12934j0;
        v3.a(6);
        this.f12930e.c();
        v3.f13001e = this.f12944p.getItemCount();
        v3.f12999c = 0;
        if (this.f12928d != null && this.f12944p.canRestoreState()) {
            Parcelable parcelable = this.f12928d.f12989c;
            if (parcelable != null) {
                this.f12946q.o0(parcelable);
            }
            this.f12928d = null;
        }
        v3.f13003g = false;
        this.f12946q.k0(this.f12926c, v3);
        v3.f13002f = false;
        v3.f13006j = v3.f13006j && this.f12914P != null;
        v3.f13000d = 4;
        P(true);
        e0(false);
    }

    /* JADX WARN: Removed duplicated region for block: B:21:0x0063  */
    @Override // android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void onAttachedToWindow() {
        float refreshRate;
        super.onAttachedToWindow();
        this.f12907I = 0;
        this.f12958w = true;
        this.f12962y = this.f12962y && !isLayoutRequested();
        this.f12926c.e();
        J j4 = this.f12946q;
        if (j4 != null) {
            j4.f12848g = true;
        }
        this.f12945p0 = false;
        if (f12893G0) {
            ThreadLocal threadLocal = RunnableC1166p.f13151e;
            RunnableC1166p runnableC1166p = (RunnableC1166p) threadLocal.get();
            this.h0 = runnableC1166p;
            if (runnableC1166p == null) {
                RunnableC1166p runnableC1166p2 = new RunnableC1166p();
                runnableC1166p2.f13153a = new ArrayList();
                runnableC1166p2.f13156d = new ArrayList();
                this.h0 = runnableC1166p2;
                Field field = F1.F.f1367a;
                Display display = getDisplay();
                if (isInEditMode() || display == null) {
                    refreshRate = 60.0f;
                    RunnableC1166p runnableC1166p3 = this.h0;
                    runnableC1166p3.f13155c = (long) (1.0E9f / refreshRate);
                    threadLocal.set(runnableC1166p3);
                } else {
                    refreshRate = display.getRefreshRate();
                    if (refreshRate < 30.0f) {
                    }
                    RunnableC1166p runnableC1166p32 = this.h0;
                    runnableC1166p32.f13155c = (long) (1.0E9f / refreshRate);
                    threadLocal.set(runnableC1166p32);
                }
            }
            this.h0.f13153a.add(this);
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onDetachedFromWindow() {
        P p6;
        RunnableC1166p runnableC1166p;
        AbstractC1080l abstractC1080l;
        super.onDetachedFromWindow();
        G g6 = this.f12914P;
        if (g6 != null) {
            g6.e();
        }
        int i6 = 0;
        setScrollState(0);
        Y y6 = this.g0;
        y6.f13018j.removeCallbacks(y6);
        y6.f13014c.abortAnimation();
        J j4 = this.f12946q;
        if (j4 != null && (abstractC1080l = j4.f12846e) != null) {
            abstractC1080l.e();
        }
        this.f12958w = false;
        J j6 = this.f12946q;
        if (j6 != null) {
            j6.f12848g = false;
            j6.X(this);
        }
        this.f12959w0.clear();
        removeCallbacks(this.f12961x0);
        this.f12933j.getClass();
        while (j0.f13109d.a() != null) {
        }
        int i7 = 0;
        while (true) {
            p6 = this.f12926c;
            ArrayList arrayList = p6.f12884c;
            if (i7 >= arrayList.size()) {
                break;
            }
            L4.a.q(((Z) arrayList.get(i7)).itemView);
            i7++;
        }
        p6.f(p6.f12889h.f12944p, false);
        while (i6 < getChildCount()) {
            int i8 = i6 + 1;
            View childAt = getChildAt(i6);
            if (childAt == null) {
                throw new IndexOutOfBoundsException();
            }
            ArrayList arrayList2 = L4.a.N(childAt).f4200a;
            for (int iA = AbstractC3252r.A(arrayList2); -1 < iA; iA--) {
                ((f1) arrayList2.get(iA)).f3015a.disposeComposition();
            }
            i6 = i8;
        }
        if (!f12893G0 || (runnableC1166p = this.h0) == null) {
            return;
        }
        runnableC1166p.f13153a.remove(this);
        this.h0 = null;
    }

    @Override // android.view.View
    public final void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        ArrayList arrayList = this.f12952t;
        int size = arrayList.size();
        for (int i6 = 0; i6 < size; i6++) {
            ((C1164n) arrayList.get(i6)).getClass();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:28:0x0064  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x006a  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x006e  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x007a  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x0082  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean onGenericMotionEvent(MotionEvent motionEvent) {
        float f6;
        float axisValue;
        J j4;
        if (this.f12946q != null && !this.f12899B && motionEvent.getAction() == 8) {
            if ((motionEvent.getSource() & 2) != 0) {
                f6 = this.f12946q.e() ? -motionEvent.getAxisValue(9) : 0.0f;
                axisValue = this.f12946q.d() ? motionEvent.getAxisValue(10) : 0.0f;
                if (f6 != 0.0f || axisValue != 0.0f) {
                    int i6 = (int) (axisValue * this.f12929d0);
                    int i7 = (int) (f6 * this.e0);
                    j4 = this.f12946q;
                    if (j4 != null) {
                        Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
                        return false;
                    }
                    if (!this.f12899B) {
                        int[] iArr = this.f12957v0;
                        iArr[0] = 0;
                        iArr[1] = 0;
                        boolean zD = j4.d();
                        boolean zE = this.f12946q.e();
                        int i8 = zE ? (zD ? 1 : 0) | 2 : zD ? 1 : 0;
                        float y6 = motionEvent.getY();
                        float x6 = motionEvent.getX();
                        int iV = i6 - V(y6, i6);
                        int iW = i7 - W(x6, i7);
                        getScrollingChildHelper().d(i8, 1);
                        if (p(zD ? iV : 0, zE ? iW : 0, 1, this.f12957v0, this.f12953t0)) {
                            iV -= iArr[0];
                            iW -= iArr[1];
                        }
                        Z(zD ? iV : 0, zE ? iW : 0, motionEvent, 1);
                        RunnableC1166p runnableC1166p = this.h0;
                        if (runnableC1166p != null && (iV != 0 || iW != 0)) {
                            runnableC1166p.a(this, iV, iW);
                        }
                        f0(1);
                    }
                }
            } else if ((motionEvent.getSource() & 4194304) != 0) {
                float axisValue2 = motionEvent.getAxisValue(26);
                if (this.f12946q.e()) {
                    f6 = -axisValue2;
                    if (f6 != 0.0f) {
                        int i62 = (int) (axisValue * this.f12929d0);
                        int i72 = (int) (f6 * this.e0);
                        j4 = this.f12946q;
                        if (j4 != null) {
                        }
                    }
                } else {
                    if (this.f12946q.d()) {
                        axisValue = axisValue2;
                        f6 = 0.0f;
                    } else {
                        f6 = 0.0f;
                        axisValue = 0.0f;
                    }
                    if (f6 != 0.0f) {
                    }
                }
            }
        }
        return false;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // android.view.ViewGroup
    public final boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        boolean z6;
        boolean z7;
        if (!this.f12899B) {
            this.f12956v = null;
            if (z(motionEvent)) {
                Y();
                setScrollState(0);
                return true;
            }
            J j4 = this.f12946q;
            if (j4 != null) {
                boolean zD = j4.d();
                boolean zE = this.f12946q.e();
                if (this.f12917S == null) {
                    this.f12917S = VelocityTracker.obtain();
                }
                this.f12917S.addMovement(motionEvent);
                int actionMasked = motionEvent.getActionMasked();
                int actionIndex = motionEvent.getActionIndex();
                if (actionMasked == 0) {
                    if (this.f12901C) {
                        this.f12901C = false;
                    }
                    this.f12916R = motionEvent.getPointerId(0);
                    int x6 = (int) (motionEvent.getX() + 0.5f);
                    this.f12920V = x6;
                    this.f12918T = x6;
                    int y6 = (int) (motionEvent.getY() + 0.5f);
                    this.f12921W = y6;
                    this.f12919U = y6;
                    EdgeEffect edgeEffect = this.f12910L;
                    if (edgeEffect == null || L4.a.J(edgeEffect) == 0.0f || canScrollHorizontally(-1)) {
                        z6 = false;
                    } else {
                        L4.a.b0(this.f12910L, 0.0f, 1.0f - (motionEvent.getY() / getHeight()));
                        z6 = true;
                    }
                    EdgeEffect edgeEffect2 = this.f12912N;
                    boolean z8 = z6;
                    if (edgeEffect2 != null) {
                        z8 = z6;
                        if (L4.a.J(edgeEffect2) != 0.0f) {
                            z8 = z6;
                            if (!canScrollHorizontally(1)) {
                                L4.a.b0(this.f12912N, 0.0f, motionEvent.getY() / getHeight());
                                z8 = true;
                            }
                        }
                    }
                    EdgeEffect edgeEffect3 = this.f12911M;
                    boolean z9 = z8;
                    if (edgeEffect3 != null) {
                        z9 = z8;
                        if (L4.a.J(edgeEffect3) != 0.0f) {
                            z9 = z8;
                            if (!canScrollVertically(-1)) {
                                L4.a.b0(this.f12911M, 0.0f, motionEvent.getX() / getWidth());
                                z9 = true;
                            }
                        }
                    }
                    EdgeEffect edgeEffect4 = this.f12913O;
                    boolean z10 = z9;
                    if (edgeEffect4 != null) {
                        z10 = z9;
                        if (L4.a.J(edgeEffect4) != 0.0f) {
                            z10 = z9;
                            if (!canScrollVertically(1)) {
                                L4.a.b0(this.f12913O, 0.0f, 1.0f - (motionEvent.getX() / getWidth()));
                                z10 = true;
                            }
                        }
                    }
                    if (z10 || this.f12915Q == 2) {
                        getParent().requestDisallowInterceptTouchEvent(true);
                        setScrollState(1);
                        f0(1);
                    }
                    int[] iArr = this.f12955u0;
                    iArr[1] = 0;
                    iArr[0] = 0;
                    int i6 = zD;
                    if (zE) {
                        i6 = (zD ? 1 : 0) | 2;
                    }
                    getScrollingChildHelper().d(i6, 0);
                } else if (actionMasked == 1) {
                    this.f12917S.clear();
                    f0(0);
                } else if (actionMasked == 2) {
                    int iFindPointerIndex = motionEvent.findPointerIndex(this.f12916R);
                    if (iFindPointerIndex < 0) {
                        Log.e("RecyclerView", "Error processing scroll; pointer index for id " + this.f12916R + " not found. Did any MotionEvents get skipped?");
                        return false;
                    }
                    int x7 = (int) (motionEvent.getX(iFindPointerIndex) + 0.5f);
                    int y7 = (int) (motionEvent.getY(iFindPointerIndex) + 0.5f);
                    if (this.f12915Q != 1) {
                        int i7 = x7 - this.f12918T;
                        int i8 = y7 - this.f12919U;
                        if (!zD || Math.abs(i7) <= this.f12923a0) {
                            z7 = false;
                        } else {
                            this.f12920V = x7;
                            z7 = true;
                        }
                        if (zE && Math.abs(i8) > this.f12923a0) {
                            this.f12921W = y7;
                            z7 = true;
                        }
                        if (z7) {
                            setScrollState(1);
                        }
                    }
                } else if (actionMasked == 3) {
                    Y();
                    setScrollState(0);
                } else if (actionMasked == 5) {
                    this.f12916R = motionEvent.getPointerId(actionIndex);
                    int x8 = (int) (motionEvent.getX(actionIndex) + 0.5f);
                    this.f12920V = x8;
                    this.f12918T = x8;
                    int y8 = (int) (motionEvent.getY(actionIndex) + 0.5f);
                    this.f12921W = y8;
                    this.f12919U = y8;
                } else if (actionMasked == 6) {
                    Q(motionEvent);
                }
                if (this.f12915Q == 1) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onLayout(boolean z6, int i6, int i7, int i8, int i9) {
        int i10 = B1.i.f450a;
        Trace.beginSection("RV OnLayout");
        m();
        Trace.endSection();
        this.f12962y = true;
    }

    @Override // android.view.View
    public final void onMeasure(int i6, int i7) {
        J j4 = this.f12946q;
        if (j4 == null) {
            l(i6, i7);
            return;
        }
        boolean zQ = j4.Q();
        P p6 = this.f12926c;
        boolean z6 = false;
        V v3 = this.f12934j0;
        if (zQ) {
            int mode = View.MeasureSpec.getMode(i6);
            int mode2 = View.MeasureSpec.getMode(i7);
            this.f12946q.m0(p6, v3, i6, i7);
            if (mode == 1073741824 && mode2 == 1073741824) {
                z6 = true;
            }
            this.f12963y0 = z6;
            if (z6 || this.f12944p == null) {
                return;
            }
            if (v3.f13000d == 1) {
                n();
            }
            this.f12946q.E0(i6, i7);
            v3.f13005i = true;
            o();
            this.f12946q.G0(i6, i7);
            if (this.f12946q.J0()) {
                this.f12946q.E0(View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), 1073741824));
                v3.f13005i = true;
                o();
                this.f12946q.G0(i6, i7);
            }
            this.f12965z0 = getMeasuredWidth();
            this.f12898A0 = getMeasuredHeight();
            return;
        }
        if (this.f12960x) {
            this.f12946q.m0(p6, v3, i6, i7);
            return;
        }
        if (this.f12903E) {
            d0();
            O();
            S();
            P(true);
            if (v3.f13007k) {
                v3.f13003g = true;
            } else {
                this.f12930e.c();
                v3.f13003g = false;
            }
            this.f12903E = false;
            e0(false);
        } else if (v3.f13007k) {
            setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight());
            return;
        }
        B b5 = this.f12944p;
        if (b5 != null) {
            v3.f13001e = b5.getItemCount();
        } else {
            v3.f13001e = 0;
        }
        d0();
        this.f12946q.m0(p6, v3, i6, i7);
        e0(false);
        v3.f13003g = false;
    }

    @Override // android.view.ViewGroup
    public boolean onRequestFocusInDescendants(int i6, Rect rect) {
        if (K()) {
            return false;
        }
        return super.onRequestFocusInDescendants(i6, rect);
    }

    @Override // android.view.View
    public final void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof T)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        T t6 = (T) parcelable;
        this.f12928d = t6;
        super.onRestoreInstanceState(t6.f5128a);
        requestLayout();
    }

    @Override // android.view.View
    public final Parcelable onSaveInstanceState() {
        T t6 = new T(super.onSaveInstanceState());
        T t7 = this.f12928d;
        if (t7 != null) {
            t6.f12989c = t7.f12989c;
            return t6;
        }
        J j4 = this.f12946q;
        if (j4 != null) {
            t6.f12989c = j4.p0();
            return t6;
        }
        t6.f12989c = null;
        return t6;
    }

    @Override // android.view.View
    public final void onSizeChanged(int i6, int i7, int i8, int i9) {
        super.onSizeChanged(i6, i7, i8, i9);
        if (i6 == i8 && i7 == i9) {
            return;
        }
        this.f12913O = null;
        this.f12911M = null;
        this.f12912N = null;
        this.f12910L = null;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:104:0x0210  */
    /* JADX WARN: Removed duplicated region for block: B:180:0x0346  */
    /* JADX WARN: Removed duplicated region for block: B:196:0x0385  */
    /* JADX WARN: Removed duplicated region for block: B:199:0x038b A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:200:0x038d  */
    /* JADX WARN: Removed duplicated region for block: B:206:0x03aa  */
    /* JADX WARN: Removed duplicated region for block: B:208:0x03b2  */
    /* JADX WARN: Removed duplicated region for block: B:96:0x01f7 A[PHI: r1
      0x01f7: PHI (r1v59 int) = (r1v43 int), (r1v63 int) binds: [B:90:0x01e0, B:94:0x01f3] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:98:0x01fa  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean onTouchEvent(MotionEvent motionEvent) {
        boolean z6;
        int iMax;
        int i6;
        Y y6;
        float f6;
        float f7;
        boolean z7;
        if (!this.f12899B && !this.f12901C) {
            C1164n c1164n = this.f12956v;
            if (c1164n == null) {
                z6 = motionEvent.getAction() == 0 ? false : z(motionEvent);
            } else {
                if (c1164n.f13141v != 0) {
                    if (motionEvent.getAction() == 0) {
                        boolean zB = c1164n.b(motionEvent.getX(), motionEvent.getY());
                        boolean zA = c1164n.a(motionEvent.getX(), motionEvent.getY());
                        if (zB || zA) {
                            if (zA) {
                                c1164n.f13142w = 1;
                                c1164n.f13135p = (int) motionEvent.getX();
                            } else if (zB) {
                                c1164n.f13142w = 2;
                                c1164n.f13132m = (int) motionEvent.getY();
                            }
                            c1164n.d(2);
                        }
                    } else if (motionEvent.getAction() == 1 && c1164n.f13141v == 2) {
                        c1164n.f13132m = 0.0f;
                        c1164n.f13135p = 0.0f;
                        c1164n.d(1);
                        c1164n.f13142w = 0;
                    } else if (motionEvent.getAction() == 2 && c1164n.f13141v == 2) {
                        c1164n.e();
                        int i7 = c1164n.f13142w;
                        int i8 = c1164n.f13122b;
                        if (i7 == 1) {
                            float x6 = motionEvent.getX();
                            int[] iArr = c1164n.f13144y;
                            iArr[0] = i8;
                            int i9 = c1164n.f13136q - i8;
                            iArr[1] = i9;
                            float fMax = Math.max(i8, Math.min(i9, x6));
                            if (Math.abs(c1164n.f13134o - fMax) >= 2.0f) {
                                int iC = C1164n.c(c1164n.f13135p, fMax, iArr, c1164n.f13138s.computeHorizontalScrollRange(), c1164n.f13138s.computeHorizontalScrollOffset(), c1164n.f13136q);
                                if (iC != 0) {
                                    c1164n.f13138s.scrollBy(iC, 0);
                                }
                                c1164n.f13135p = fMax;
                            }
                        }
                        if (c1164n.f13142w == 2) {
                            float y7 = motionEvent.getY();
                            int[] iArr2 = c1164n.f13143x;
                            iArr2[0] = i8;
                            int i10 = c1164n.f13137r - i8;
                            iArr2[1] = i10;
                            float fMax2 = Math.max(i8, Math.min(i10, y7));
                            if (Math.abs(c1164n.l - fMax2) >= 2.0f) {
                                int iC2 = C1164n.c(c1164n.f13132m, fMax2, iArr2, c1164n.f13138s.computeVerticalScrollRange(), c1164n.f13138s.computeVerticalScrollOffset(), c1164n.f13137r);
                                if (iC2 != 0) {
                                    c1164n.f13138s.scrollBy(0, iC2);
                                }
                                c1164n.f13132m = fMax2;
                            }
                        }
                    }
                }
                int action = motionEvent.getAction();
                if (action == 3 || action == 1) {
                    this.f12956v = null;
                }
                z6 = true;
            }
            if (z6) {
                Y();
                setScrollState(0);
                return true;
            }
            J j4 = this.f12946q;
            if (j4 != null) {
                boolean zD = j4.d();
                boolean zE = this.f12946q.e();
                if (this.f12917S == null) {
                    this.f12917S = VelocityTracker.obtain();
                }
                int actionMasked = motionEvent.getActionMasked();
                int actionIndex = motionEvent.getActionIndex();
                int[] iArr3 = this.f12955u0;
                if (actionMasked == 0) {
                    iArr3[1] = 0;
                    iArr3[0] = 0;
                }
                MotionEvent motionEventObtain = MotionEvent.obtain(motionEvent);
                motionEventObtain.offsetLocation(iArr3[0], iArr3[1]);
                if (actionMasked == 0) {
                    this.f12916R = motionEvent.getPointerId(0);
                    int x7 = (int) (motionEvent.getX() + 0.5f);
                    this.f12920V = x7;
                    this.f12918T = x7;
                    int y8 = (int) (motionEvent.getY() + 0.5f);
                    this.f12921W = y8;
                    this.f12919U = y8;
                    int i11 = zD;
                    if (zE) {
                        i11 = (zD ? 1 : 0) | 2;
                    }
                    getScrollingChildHelper().d(i11, 0);
                } else {
                    if (actionMasked == 1) {
                        this.f12917S.addMovement(motionEventObtain);
                        VelocityTracker velocityTracker = this.f12917S;
                        int i12 = this.f12927c0;
                        velocityTracker.computeCurrentVelocity(1000, i12);
                        float f8 = zD ? -this.f12917S.getXVelocity(this.f12916R) : 0.0f;
                        float f9 = zE ? -this.f12917S.getYVelocity(this.f12916R) : 0.0f;
                        if (f8 == 0.0f && f9 == 0.0f) {
                            setScrollState(0);
                            Y();
                        } else {
                            int i13 = (int) f8;
                            int iMax2 = (int) f9;
                            J j6 = this.f12946q;
                            if (j6 == null) {
                                Log.e("RecyclerView", "Cannot fling without a LayoutManager set. Call setLayoutManager with a non-null argument.");
                            } else if (!this.f12899B) {
                                boolean zD2 = j6.d();
                                boolean zE2 = this.f12946q.e();
                                int i14 = this.f12925b0;
                                if (!zD2 || Math.abs(i13) < i14) {
                                    i13 = 0;
                                }
                                if (!zE2 || Math.abs(iMax2) < i14) {
                                    iMax2 = 0;
                                }
                                if (i13 != 0 || iMax2 != 0) {
                                    if (i13 == 0) {
                                        iMax = 0;
                                        if (iMax2 == 0) {
                                            i6 = iMax2;
                                            iMax2 = 0;
                                            y6 = this.g0;
                                            if (iMax == 0 || iMax2 != 0) {
                                                int i15 = -i12;
                                                iMax = Math.max(i15, Math.min(iMax, i12));
                                                iMax2 = Math.max(i15, Math.min(iMax2, i12));
                                                y6.a(iMax, iMax2);
                                            }
                                            if (i13 == 0 || i6 != 0) {
                                                f6 = i13;
                                                f7 = i6;
                                                if (!dispatchNestedPreFling(f6, f7)) {
                                                    boolean z8 = zD2 || zE2;
                                                    dispatchNestedFling(f6, f7, z8);
                                                    int i16 = zD2;
                                                    if (z8) {
                                                        if (zE2) {
                                                            i16 = (zD2 ? 1 : 0) | 2;
                                                        }
                                                        getScrollingChildHelper().d(i16, 1);
                                                        int i17 = -i12;
                                                        y6.a(Math.max(i17, Math.min(i13, i12)), Math.max(i17, Math.min(i6, i12)));
                                                    }
                                                    Y();
                                                }
                                            } else {
                                                if (iMax == 0 && iMax2 == 0) {
                                                }
                                                Y();
                                            }
                                        } else {
                                            EdgeEffect edgeEffect = this.f12911M;
                                            if (edgeEffect == null || L4.a.J(edgeEffect) == 0.0f) {
                                                EdgeEffect edgeEffect2 = this.f12913O;
                                                if (edgeEffect2 != null && L4.a.J(edgeEffect2) != 0.0f) {
                                                    if (b0(this.f12913O, iMax2, getHeight())) {
                                                        this.f12913O.onAbsorb(iMax2);
                                                        iMax2 = 0;
                                                    }
                                                    i6 = 0;
                                                    y6 = this.g0;
                                                    if (iMax == 0) {
                                                        int i152 = -i12;
                                                        iMax = Math.max(i152, Math.min(iMax, i12));
                                                        iMax2 = Math.max(i152, Math.min(iMax2, i12));
                                                        y6.a(iMax, iMax2);
                                                        if (i13 == 0) {
                                                            f6 = i13;
                                                            f7 = i6;
                                                            if (!dispatchNestedPreFling(f6, f7)) {
                                                            }
                                                        }
                                                    }
                                                }
                                                i6 = iMax2;
                                                iMax2 = 0;
                                                y6 = this.g0;
                                                if (iMax == 0) {
                                                }
                                            } else {
                                                int i18 = -iMax2;
                                                if (b0(this.f12911M, i18, getHeight())) {
                                                    this.f12911M.onAbsorb(i18);
                                                    iMax2 = 0;
                                                }
                                                i6 = 0;
                                                y6 = this.g0;
                                                if (iMax == 0) {
                                                }
                                            }
                                        }
                                    } else {
                                        EdgeEffect edgeEffect3 = this.f12910L;
                                        if (edgeEffect3 == null || L4.a.J(edgeEffect3) == 0.0f) {
                                            EdgeEffect edgeEffect4 = this.f12912N;
                                            if (edgeEffect4 != null && L4.a.J(edgeEffect4) != 0.0f) {
                                                if (b0(this.f12912N, i13, getWidth())) {
                                                    this.f12912N.onAbsorb(i13);
                                                    i13 = 0;
                                                }
                                                iMax = i13;
                                                i13 = 0;
                                                if (iMax2 == 0) {
                                                }
                                            }
                                            iMax = 0;
                                            if (iMax2 == 0) {
                                            }
                                        } else {
                                            int i19 = -i13;
                                            if (b0(this.f12910L, i19, getWidth())) {
                                                this.f12910L.onAbsorb(i19);
                                                i13 = 0;
                                            }
                                            iMax = i13;
                                            i13 = 0;
                                            if (iMax2 == 0) {
                                            }
                                        }
                                    }
                                }
                            }
                            setScrollState(0);
                            Y();
                        }
                        motionEventObtain.recycle();
                        return true;
                    }
                    if (actionMasked == 2) {
                        int iFindPointerIndex = motionEvent.findPointerIndex(this.f12916R);
                        if (iFindPointerIndex < 0) {
                            Log.e("RecyclerView", "Error processing scroll; pointer index for id " + this.f12916R + " not found. Did any MotionEvents get skipped?");
                            return false;
                        }
                        int x8 = (int) (motionEvent.getX(iFindPointerIndex) + 0.5f);
                        int y9 = (int) (motionEvent.getY(iFindPointerIndex) + 0.5f);
                        int iMax3 = this.f12920V - x8;
                        int iMax4 = this.f12921W - y9;
                        if (this.f12915Q != 1) {
                            if (zD) {
                                iMax3 = iMax3 > 0 ? Math.max(0, iMax3 - this.f12923a0) : Math.min(0, iMax3 + this.f12923a0);
                                if (iMax3 != 0) {
                                    z7 = true;
                                }
                                if (zE) {
                                }
                                if (z7) {
                                }
                            } else {
                                z7 = false;
                                if (zE) {
                                    iMax4 = iMax4 > 0 ? Math.max(0, iMax4 - this.f12923a0) : Math.min(0, iMax4 + this.f12923a0);
                                    if (iMax4 != 0) {
                                        z7 = true;
                                    }
                                }
                                if (z7) {
                                    setScrollState(1);
                                }
                            }
                            motionEventObtain.recycle();
                            return true;
                        }
                        if (this.f12915Q == 1) {
                            int[] iArr4 = this.f12957v0;
                            iArr4[0] = 0;
                            iArr4[1] = 0;
                            int iV = iMax3 - V(motionEvent.getY(), iMax3);
                            int iW = iMax4 - W(motionEvent.getX(), iMax4);
                            boolean zP = p(zD ? iV : 0, zE ? iW : 0, 0, this.f12957v0, this.f12953t0);
                            int[] iArr5 = this.f12953t0;
                            if (zP) {
                                iV -= iArr4[0];
                                iW -= iArr4[1];
                                iArr3[0] = iArr3[0] + iArr5[0];
                                iArr3[1] = iArr3[1] + iArr5[1];
                                getParent().requestDisallowInterceptTouchEvent(true);
                            }
                            int i20 = iV;
                            int i21 = iW;
                            this.f12920V = x8 - iArr5[0];
                            this.f12921W = y9 - iArr5[1];
                            if (Z(zD ? i20 : 0, zE ? i21 : 0, motionEvent, 0)) {
                                getParent().requestDisallowInterceptTouchEvent(true);
                            }
                            RunnableC1166p runnableC1166p = this.h0;
                            if (runnableC1166p != null && (i20 != 0 || i21 != 0)) {
                                runnableC1166p.a(this, i20, i21);
                            }
                        }
                    } else if (actionMasked == 3) {
                        Y();
                        setScrollState(0);
                    } else if (actionMasked == 5) {
                        this.f12916R = motionEvent.getPointerId(actionIndex);
                        int x9 = (int) (motionEvent.getX(actionIndex) + 0.5f);
                        this.f12920V = x9;
                        this.f12918T = x9;
                        int y10 = (int) (motionEvent.getY(actionIndex) + 0.5f);
                        this.f12921W = y10;
                        this.f12919U = y10;
                    } else if (actionMasked == 6) {
                        Q(motionEvent);
                    }
                }
                this.f12917S.addMovement(motionEventObtain);
                motionEventObtain.recycle();
                return true;
            }
        }
        return false;
    }

    public final boolean p(int i6, int i7, int i8, int[] iArr, int[] iArr2) {
        return getScrollingChildHelper().a(i6, i7, i8, iArr, iArr2);
    }

    public final void q(int i6, int i7, int i8, int i9, int[] iArr, int i10, int[] iArr2) {
        getScrollingChildHelper().b(i6, i7, i8, i9, iArr, i10, iArr2);
    }

    public final void r(int i6, int i7) {
        this.f12908J++;
        int scrollX = getScrollX();
        int scrollY = getScrollY();
        onScrollChanged(scrollX, scrollY, scrollX - i6, scrollY - i7);
        M m6 = this.f12936k0;
        if (m6 != null) {
            m6.a(this);
        }
        ArrayList arrayList = this.f12937l0;
        if (arrayList != null) {
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                ((M) this.f12937l0.get(size)).a(this);
            }
        }
        this.f12908J--;
    }

    @Override // android.view.ViewGroup
    public final void removeDetachedView(View view, boolean z6) {
        Z zG = G(view);
        if (zG != null) {
            if (zG.isTmpDetached()) {
                zG.clearTmpDetachFlag();
            } else if (!zG.shouldIgnore()) {
                throw new IllegalArgumentException("Called removeDetachedView with a view which is not flagged as tmp detached." + zG + w());
            }
        }
        view.clearAnimation();
        Z zG2 = G(view);
        B b5 = this.f12944p;
        if (b5 != null && zG2 != null) {
            b5.onViewDetachedFromWindow(zG2);
        }
        super.removeDetachedView(view, z6);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void requestChildFocus(View view, View view2) {
        if (!this.f12946q.n0(this, view, view2) && view2 != null) {
            X(view, view2);
        }
        super.requestChildFocus(view, view2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean requestChildRectangleOnScreen(View view, Rect rect, boolean z6) {
        return this.f12946q.w0(this, view, rect, z6);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void requestDisallowInterceptTouchEvent(boolean z6) {
        ArrayList arrayList = this.f12954u;
        int size = arrayList.size();
        for (int i6 = 0; i6 < size; i6++) {
            ((C1164n) arrayList.get(i6)).getClass();
        }
        super.requestDisallowInterceptTouchEvent(z6);
    }

    @Override // android.view.View, android.view.ViewParent
    public final void requestLayout() {
        if (this.f12964z != 0 || this.f12899B) {
            this.f12897A = true;
        } else {
            super.requestLayout();
        }
    }

    public final void s() {
        if (this.f12913O != null) {
            return;
        }
        ((W) this.f12909K).getClass();
        EdgeEffect edgeEffect = new EdgeEffect(getContext());
        this.f12913O = edgeEffect;
        if (this.f12935k) {
            edgeEffect.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffect.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    @Override // android.view.View
    public final void scrollBy(int i6, int i7) {
        J j4 = this.f12946q;
        if (j4 == null) {
            Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.f12899B) {
            return;
        }
        boolean zD = j4.d();
        boolean zE = this.f12946q.e();
        if (zD || zE) {
            if (!zD) {
                i6 = 0;
            }
            if (!zE) {
                i7 = 0;
            }
            Z(i6, i7, null, 0);
        }
    }

    @Override // android.view.View
    public final void scrollTo(int i6, int i7) {
        Log.w("RecyclerView", "RecyclerView does not support scrolling to an absolute position. Use scrollToPosition instead");
    }

    @Override // android.view.View, android.view.accessibility.AccessibilityEventSource
    public final void sendAccessibilityEventUnchecked(AccessibilityEvent accessibilityEvent) {
        if (!K()) {
            super.sendAccessibilityEventUnchecked(accessibilityEvent);
        } else {
            int contentChangeTypes = accessibilityEvent != null ? accessibilityEvent.getContentChangeTypes() : 0;
            this.f12902D |= contentChangeTypes != 0 ? contentChangeTypes : 0;
        }
    }

    public void setAccessibilityDelegateCompat(b0 b0Var) {
        this.f12947q0 = b0Var;
        F1.F.d(this, b0Var);
    }

    public void setAdapter(B b5) {
        setLayoutFrozen(false);
        B b6 = this.f12944p;
        S s6 = this.f12924b;
        if (b6 != null) {
            b6.unregisterAdapterDataObserver(s6);
            this.f12944p.onDetachedFromRecyclerView(this);
        }
        G g6 = this.f12914P;
        if (g6 != null) {
            g6.e();
        }
        J j4 = this.f12946q;
        P p6 = this.f12926c;
        if (j4 != null) {
            j4.s0(p6);
            this.f12946q.t0(p6);
        }
        p6.f12882a.clear();
        p6.g();
        C0 c02 = this.f12930e;
        c02.k((ArrayList) c02.f2132c);
        c02.k((ArrayList) c02.f2133d);
        c02.f2130a = 0;
        B b7 = this.f12944p;
        this.f12944p = b5;
        if (b5 != null) {
            b5.registerAdapterDataObserver(s6);
            b5.onAttachedToRecyclerView(this);
        }
        J j6 = this.f12946q;
        if (j6 != null) {
            j6.V(b7);
        }
        B b8 = this.f12944p;
        p6.f12882a.clear();
        p6.g();
        p6.f(b7, true);
        O oC = p6.c();
        if (b7 != null) {
            oC.f12880b--;
        }
        if (oC.f12880b == 0) {
            int i6 = 0;
            while (true) {
                SparseArray sparseArray = oC.f12879a;
                if (i6 >= sparseArray.size()) {
                    break;
                }
                N n6 = (N) sparseArray.valueAt(i6);
                Iterator it = n6.f12875a.iterator();
                while (it.hasNext()) {
                    L4.a.q(((Z) it.next()).itemView);
                }
                n6.f12875a.clear();
                i6++;
            }
        }
        if (b8 != null) {
            oC.f12880b++;
        }
        p6.e();
        this.f12934j0.f13002f = true;
        T(false);
        requestLayout();
    }

    public void setChildDrawingOrderCallback(E e6) {
        if (e6 == null) {
            return;
        }
        setChildrenDrawingOrderEnabled(false);
    }

    @Override // android.view.ViewGroup
    public void setClipToPadding(boolean z6) {
        if (z6 != this.f12935k) {
            this.f12913O = null;
            this.f12911M = null;
            this.f12912N = null;
            this.f12910L = null;
        }
        this.f12935k = z6;
        super.setClipToPadding(z6);
        if (this.f12962y) {
            requestLayout();
        }
    }

    public void setEdgeEffectFactory(F f6) {
        f6.getClass();
        this.f12909K = f6;
        this.f12913O = null;
        this.f12911M = null;
        this.f12912N = null;
        this.f12910L = null;
    }

    public void setHasFixedSize(boolean z6) {
        this.f12960x = z6;
    }

    public void setItemAnimator(G g6) {
        G g7 = this.f12914P;
        if (g7 != null) {
            g7.e();
            this.f12914P.f12822a = null;
        }
        this.f12914P = g6;
        if (g6 != null) {
            g6.f12822a = this.f12943o0;
        }
    }

    public void setItemViewCacheSize(int i6) {
        P p6 = this.f12926c;
        p6.f12886e = i6;
        p6.n();
    }

    @Deprecated
    public void setLayoutFrozen(boolean z6) {
        suppressLayout(z6);
    }

    public void setLayoutManager(J j4) {
        RecyclerView recyclerView;
        AbstractC1080l abstractC1080l;
        if (j4 == this.f12946q) {
            return;
        }
        setScrollState(0);
        Y y6 = this.g0;
        y6.f13018j.removeCallbacks(y6);
        y6.f13014c.abortAnimation();
        J j6 = this.f12946q;
        if (j6 != null && (abstractC1080l = j6.f12846e) != null) {
            abstractC1080l.e();
        }
        J j7 = this.f12946q;
        P p6 = this.f12926c;
        if (j7 != null) {
            G g6 = this.f12914P;
            if (g6 != null) {
                g6.e();
            }
            this.f12946q.s0(p6);
            this.f12946q.t0(p6);
            p6.f12882a.clear();
            p6.g();
            if (this.f12958w) {
                J j8 = this.f12946q;
                j8.f12848g = false;
                j8.X(this);
            }
            this.f12946q.H0(null);
            this.f12946q = null;
        } else {
            p6.f12882a.clear();
            p6.g();
        }
        C4.f fVar = this.f12931f;
        ((C1152b) fVar.f742c).i();
        ArrayList arrayList = (ArrayList) fVar.f743d;
        int size = arrayList.size() - 1;
        while (true) {
            recyclerView = ((C1175z) fVar.f741b).f13194a;
            if (size < 0) {
                break;
            }
            Z zG = G((View) arrayList.get(size));
            if (zG != null) {
                zG.onLeftHiddenState(recyclerView);
            }
            arrayList.remove(size);
            size--;
        }
        int childCount = recyclerView.getChildCount();
        for (int i6 = 0; i6 < childCount; i6++) {
            View childAt = recyclerView.getChildAt(i6);
            Z zG2 = G(childAt);
            B b5 = recyclerView.f12944p;
            if (b5 != null && zG2 != null) {
                b5.onViewDetachedFromWindow(zG2);
            }
            childAt.clearAnimation();
        }
        recyclerView.removeAllViews();
        this.f12946q = j4;
        if (j4 != null) {
            if (j4.f12843b != null) {
                throw new IllegalArgumentException("LayoutManager " + j4 + " is already attached to a RecyclerView:" + j4.f12843b.w());
            }
            j4.H0(this);
            if (this.f12958w) {
                this.f12946q.f12848g = true;
            }
        }
        p6.n();
        requestLayout();
    }

    @Override // android.view.ViewGroup
    @Deprecated
    public void setLayoutTransition(LayoutTransition layoutTransition) {
        if (layoutTransition != null) {
            throw new IllegalArgumentException("Providing a LayoutTransition into RecyclerView is not supported. Please use setItemAnimator() instead for animating changes to the items in this RecyclerView");
        }
        super.setLayoutTransition(null);
    }

    @Override // android.view.View
    public void setNestedScrollingEnabled(boolean z6) {
        C0184m scrollingChildHelper = getScrollingChildHelper();
        if (scrollingChildHelper.f1455d) {
            Field field = F1.F.f1367a;
            AbstractC0195y.f(scrollingChildHelper.f1454c);
        }
        scrollingChildHelper.f1455d = z6;
    }

    public void setOnFlingListener(L l) {
    }

    @Deprecated
    public void setOnScrollListener(M m6) {
        this.f12936k0 = m6;
    }

    public void setPreserveFocusAfterLayout(boolean z6) {
        this.f0 = z6;
    }

    public void setRecycledViewPool(O o6) {
        P p6 = this.f12926c;
        RecyclerView recyclerView = p6.f12889h;
        p6.f(recyclerView.f12944p, false);
        if (p6.f12888g != null) {
            r2.f12880b--;
        }
        p6.f12888g = o6;
        if (o6 != null && recyclerView.getAdapter() != null) {
            p6.f12888g.f12880b++;
        }
        p6.e();
    }

    @Deprecated
    public void setRecyclerListener(Q q6) {
        this.f12948r = q6;
    }

    public void setScrollState(int i6) {
        AbstractC1080l abstractC1080l;
        if (i6 == this.f12915Q) {
            return;
        }
        this.f12915Q = i6;
        if (i6 != 2) {
            Y y6 = this.g0;
            y6.f13018j.removeCallbacks(y6);
            y6.f13014c.abortAnimation();
            J j4 = this.f12946q;
            if (j4 != null && (abstractC1080l = j4.f12846e) != null) {
                abstractC1080l.e();
            }
        }
        J j6 = this.f12946q;
        if (j6 != null) {
            j6.q0(i6);
        }
        ArrayList arrayList = this.f12937l0;
        if (arrayList != null) {
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                ((M) this.f12937l0.get(size)).getClass();
            }
        }
    }

    public void setScrollingTouchSlop(int i6) {
        ViewConfiguration viewConfiguration = ViewConfiguration.get(getContext());
        if (i6 != 0) {
            if (i6 == 1) {
                this.f12923a0 = viewConfiguration.getScaledPagingTouchSlop();
                return;
            }
            Log.w("RecyclerView", "setScrollingTouchSlop(): bad argument constant " + i6 + "; using default value");
        }
        this.f12923a0 = viewConfiguration.getScaledTouchSlop();
    }

    public void setViewCacheExtension(X x6) {
        this.f12926c.getClass();
    }

    @Override // android.view.View
    public final boolean startNestedScroll(int i6) {
        return getScrollingChildHelper().d(i6, 0);
    }

    @Override // android.view.View
    public final void stopNestedScroll() {
        getScrollingChildHelper().e(0);
    }

    @Override // android.view.ViewGroup
    public final void suppressLayout(boolean z6) {
        AbstractC1080l abstractC1080l;
        if (z6 != this.f12899B) {
            f("Do not suppressLayout in layout or scroll");
            if (!z6) {
                this.f12899B = false;
                if (this.f12897A && this.f12946q != null && this.f12944p != null) {
                    requestLayout();
                }
                this.f12897A = false;
                return;
            }
            long jUptimeMillis = SystemClock.uptimeMillis();
            onTouchEvent(MotionEvent.obtain(jUptimeMillis, jUptimeMillis, 3, 0.0f, 0.0f, 0));
            this.f12899B = true;
            this.f12901C = true;
            setScrollState(0);
            Y y6 = this.g0;
            y6.f13018j.removeCallbacks(y6);
            y6.f13014c.abortAnimation();
            J j4 = this.f12946q;
            if (j4 == null || (abstractC1080l = j4.f12846e) == null) {
                return;
            }
            abstractC1080l.e();
        }
    }

    public final void t() {
        if (this.f12910L != null) {
            return;
        }
        ((W) this.f12909K).getClass();
        EdgeEffect edgeEffect = new EdgeEffect(getContext());
        this.f12910L = edgeEffect;
        if (this.f12935k) {
            edgeEffect.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
        } else {
            edgeEffect.setSize(getMeasuredHeight(), getMeasuredWidth());
        }
    }

    public final void u() {
        if (this.f12912N != null) {
            return;
        }
        ((W) this.f12909K).getClass();
        EdgeEffect edgeEffect = new EdgeEffect(getContext());
        this.f12912N = edgeEffect;
        if (this.f12935k) {
            edgeEffect.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
        } else {
            edgeEffect.setSize(getMeasuredHeight(), getMeasuredWidth());
        }
    }

    public final void v() {
        if (this.f12911M != null) {
            return;
        }
        ((W) this.f12909K).getClass();
        EdgeEffect edgeEffect = new EdgeEffect(getContext());
        this.f12911M = edgeEffect;
        if (this.f12935k) {
            edgeEffect.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffect.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    public final String w() {
        return " " + super.toString() + ", adapter:" + this.f12944p + ", layout:" + this.f12946q + ", context:" + getContext();
    }

    public final void x(V v3) {
        if (getScrollState() != 2) {
            v3.f13010o = 0;
            v3.f13011p = 0;
        } else {
            OverScroller overScroller = this.g0.f13014c;
            v3.f13010o = overScroller.getFinalX() - overScroller.getCurrX();
            v3.f13011p = overScroller.getFinalY() - overScroller.getCurrY();
        }
    }

    public final View y(View view) {
        ViewParent parent = view.getParent();
        while (parent != null && parent != this && (parent instanceof View)) {
            view = parent;
            parent = view.getParent();
        }
        if (parent == this) {
            return view;
        }
        return null;
    }

    /* JADX WARN: Removed duplicated region for block: B:23:0x005e A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0061 A[SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean z(MotionEvent motionEvent) {
        int action = motionEvent.getAction();
        ArrayList arrayList = this.f12954u;
        int size = arrayList.size();
        for (int i6 = 0; i6 < size; i6++) {
            C1164n c1164n = (C1164n) arrayList.get(i6);
            int i7 = c1164n.f13141v;
            if (i7 == 1) {
                boolean zB = c1164n.b(motionEvent.getX(), motionEvent.getY());
                boolean zA = c1164n.a(motionEvent.getX(), motionEvent.getY());
                if (motionEvent.getAction() == 0 && (zB || zA)) {
                    if (zA) {
                        c1164n.f13142w = 1;
                        c1164n.f13135p = (int) motionEvent.getX();
                    } else if (zB) {
                        c1164n.f13142w = 2;
                        c1164n.f13132m = (int) motionEvent.getY();
                    }
                    c1164n.d(2);
                    if (action == 3) {
                        this.f12956v = c1164n;
                        return true;
                    }
                }
            } else if (i7 != 2) {
                continue;
            } else if (action == 3) {
            }
        }
        return false;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public RecyclerView(Context context, AttributeSet attributeSet, int i6) {
        float fA;
        AttributeSet attributeSet2;
        TypedArray typedArray;
        int i7;
        char c6;
        char c7;
        Context context2;
        int i8;
        Constructor constructor;
        Object[] objArr;
        super(context, attributeSet, i6);
        int i9 = 3;
        this.f12924b = new S(this);
        this.f12926c = new P(this);
        int i10 = 1;
        this.f12933j = new i0(1);
        this.l = new RunnableC1173x(this, 0);
        this.f12938m = new Rect();
        this.f12940n = new Rect();
        this.f12942o = new RectF();
        this.f12950s = new ArrayList();
        this.f12952t = new ArrayList();
        this.f12954u = new ArrayList();
        this.f12964z = 0;
        this.f12905G = false;
        this.f12906H = false;
        this.f12907I = 0;
        this.f12908J = 0;
        this.f12909K = f12896J0;
        C1159i c1159i = new C1159i();
        c1159i.f12822a = null;
        c1159i.f12823b = new ArrayList();
        c1159i.f12824c = 120L;
        c1159i.f12825d = 120L;
        c1159i.f12826e = 250L;
        c1159i.f12827f = 250L;
        c1159i.f13093g = true;
        c1159i.f13094h = new ArrayList();
        c1159i.f13095i = new ArrayList();
        c1159i.f13096j = new ArrayList();
        c1159i.f13097k = new ArrayList();
        c1159i.l = new ArrayList();
        c1159i.f13098m = new ArrayList();
        c1159i.f13099n = new ArrayList();
        c1159i.f13100o = new ArrayList();
        c1159i.f13101p = new ArrayList();
        c1159i.f13102q = new ArrayList();
        c1159i.f13103r = new ArrayList();
        this.f12914P = c1159i;
        this.f12915Q = 0;
        this.f12916R = -1;
        this.f12929d0 = Float.MIN_VALUE;
        this.e0 = Float.MIN_VALUE;
        this.f0 = true;
        this.g0 = new Y(this);
        this.f12932i0 = f12893G0 ? new C0629x(i9) : null;
        V v3 = new V();
        v3.f12997a = -1;
        v3.f12998b = 0;
        v3.f12999c = 0;
        v3.f13000d = 1;
        v3.f13001e = 0;
        v3.f13002f = false;
        v3.f13003g = false;
        v3.f13004h = false;
        v3.f13005i = false;
        v3.f13006j = false;
        v3.f13007k = false;
        this.f12934j0 = v3;
        this.f12939m0 = false;
        this.f12941n0 = false;
        C1175z c1175z = new C1175z(this);
        this.f12943o0 = c1175z;
        this.f12945p0 = false;
        this.f12949r0 = new int[2];
        this.f12953t0 = new int[2];
        this.f12955u0 = new int[2];
        this.f12957v0 = new int[2];
        this.f12959w0 = new ArrayList();
        this.f12961x0 = new RunnableC1173x(this, i10);
        this.f12965z0 = 0;
        this.f12898A0 = 0;
        this.f12900B0 = new C1175z(this);
        setScrollContainer(true);
        setFocusableInTouchMode(true);
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        this.f12923a0 = viewConfiguration.getScaledTouchSlop();
        int i11 = Build.VERSION.SDK_INT;
        if (i11 >= 26) {
            Method method = F1.G.f1369a;
            fA = A1.a.c(viewConfiguration);
        } else {
            fA = F1.G.a(viewConfiguration, context);
        }
        this.f12929d0 = fA;
        this.e0 = i11 >= 26 ? A1.a.d(viewConfiguration) : F1.G.a(viewConfiguration, context);
        this.f12925b0 = viewConfiguration.getScaledMinimumFlingVelocity();
        this.f12927c0 = viewConfiguration.getScaledMaximumFlingVelocity();
        this.f12922a = context.getResources().getDisplayMetrics().density * 160.0f * 386.0878f * 0.84f;
        setWillNotDraw(getOverScrollMode() == 2);
        this.f12914P.f12822a = c1175z;
        this.f12930e = new C0(new C1175z(this));
        this.f12931f = new C4.f(new C1175z(this));
        Field field = F1.F.f1367a;
        if ((i11 >= 26 ? F1.A.a(this) : 0) == 0 && i11 >= 26) {
            F1.A.b(this, 8);
        }
        if (getImportantForAccessibility() == 0) {
            setImportantForAccessibility(1);
        }
        this.f12904F = (AccessibilityManager) getContext().getSystemService("accessibility");
        setAccessibilityDelegateCompat(new b0(this));
        int[] iArr = AbstractC2465a.f20475a;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, iArr, i6, 0);
        if (i11 >= 29) {
            F1.C.b(this, context, iArr, attributeSet, typedArrayObtainStyledAttributes, i6, 0);
        }
        String string = typedArrayObtainStyledAttributes.getString(8);
        if (typedArrayObtainStyledAttributes.getInt(2, -1) == -1) {
            setDescendantFocusability(262144);
        }
        this.f12935k = typedArrayObtainStyledAttributes.getBoolean(1, true);
        if (typedArrayObtainStyledAttributes.getBoolean(3, false)) {
            StateListDrawable stateListDrawable = (StateListDrawable) typedArrayObtainStyledAttributes.getDrawable(6);
            Drawable drawable = typedArrayObtainStyledAttributes.getDrawable(7);
            StateListDrawable stateListDrawable2 = (StateListDrawable) typedArrayObtainStyledAttributes.getDrawable(4);
            Drawable drawable2 = typedArrayObtainStyledAttributes.getDrawable(5);
            if (stateListDrawable == null || drawable == null || stateListDrawable2 == null || drawable2 == null) {
                throw new IllegalArgumentException("Trying to set fast scroller without both required drawables." + w());
            }
            Resources resources = getContext().getResources();
            c6 = 3;
            attributeSet2 = attributeSet;
            typedArray = typedArrayObtainStyledAttributes;
            c7 = 2;
            i7 = 4;
            i8 = i6;
            context2 = context;
            new C1164n(this, stateListDrawable, drawable, stateListDrawable2, drawable2, resources.getDimensionPixelSize(com.debridstream.tv.R.dimen.fastscroll_default_thickness), resources.getDimensionPixelSize(com.debridstream.tv.R.dimen.fastscroll_minimum_range), resources.getDimensionPixelOffset(com.debridstream.tv.R.dimen.fastscroll_margin));
        } else {
            attributeSet2 = attributeSet;
            typedArray = typedArrayObtainStyledAttributes;
            i7 = 4;
            c6 = 3;
            c7 = 2;
            context2 = context;
            i8 = i6;
        }
        typedArray.recycle();
        if (string != null) {
            String strTrim = string.trim();
            if (!strTrim.isEmpty()) {
                if (strTrim.charAt(0) == '.') {
                    strTrim = context2.getPackageName() + strTrim;
                } else if (!strTrim.contains(".")) {
                    strTrim = RecyclerView.class.getPackage().getName() + '.' + strTrim;
                }
                String str = strTrim;
                try {
                    Class<? extends U> clsAsSubclass = Class.forName(str, false, isInEditMode() ? getClass().getClassLoader() : context2.getClassLoader()).asSubclass(J.class);
                    try {
                        constructor = clsAsSubclass.getConstructor(f12894H0);
                        objArr = new Object[i7];
                        objArr[0] = context2;
                        objArr[1] = attributeSet2;
                        objArr[c7] = Integer.valueOf(i8);
                        objArr[c6] = 0;
                    } catch (NoSuchMethodException e6) {
                        try {
                            constructor = clsAsSubclass.getConstructor(new Class[0]);
                            objArr = null;
                        } catch (NoSuchMethodException e7) {
                            e7.initCause(e6);
                            throw new IllegalStateException(attributeSet2.getPositionDescription() + ": Error creating LayoutManager " + str, e7);
                        }
                    }
                    constructor.setAccessible(true);
                    setLayoutManager((J) constructor.newInstance(objArr));
                } catch (ClassCastException e8) {
                    throw new IllegalStateException(attributeSet2.getPositionDescription() + ": Class is not a LayoutManager " + str, e8);
                } catch (ClassNotFoundException e9) {
                    throw new IllegalStateException(attributeSet2.getPositionDescription() + ": Unable to find LayoutManager " + str, e9);
                } catch (IllegalAccessException e10) {
                    throw new IllegalStateException(attributeSet2.getPositionDescription() + ": Cannot access non-public constructor " + str, e10);
                } catch (InstantiationException e11) {
                    throw new IllegalStateException(attributeSet2.getPositionDescription() + ": Could not instantiate the LayoutManager: " + str, e11);
                } catch (InvocationTargetException e12) {
                    throw new IllegalStateException(attributeSet2.getPositionDescription() + ": Could not instantiate the LayoutManager: " + str, e12);
                }
            }
        }
        int[] iArr2 = f12890C0;
        TypedArray typedArrayObtainStyledAttributes2 = context2.obtainStyledAttributes(attributeSet2, iArr2, i8, 0);
        if (Build.VERSION.SDK_INT >= 29) {
            F1.C.b(this, context2, iArr2, attributeSet2, typedArrayObtainStyledAttributes2, i8, 0);
        }
        boolean z6 = typedArrayObtainStyledAttributes2.getBoolean(0, true);
        typedArrayObtainStyledAttributes2.recycle();
        setNestedScrollingEnabled(z6);
        setTag(com.debridstream.tv.R.id.is_pooling_container_tag, Boolean.TRUE);
    }

    @Override // android.view.ViewGroup
    public final ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        J j4 = this.f12946q;
        if (j4 != null) {
            return j4.u(layoutParams);
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + w());
    }
}
