package androidx.recyclerview.widget;

import A1.I;
import B.h;
import B6.l;
import H5.n;
import M.C0177g;
import M.C0180j;
import M.D;
import M.J;
import M.K;
import N1.AbstractC0197a0;
import N1.B;
import N1.C0196a;
import N1.C0198b;
import N1.C0203d0;
import N1.C0207h;
import N1.C0214o;
import N1.C0223y;
import N1.C0224z;
import N1.D0;
import N1.H;
import N1.M;
import N1.N;
import N1.O;
import N1.P;
import N1.Q;
import N1.S;
import N1.T;
import N1.X;
import N1.Y;
import N1.Z;
import N1.e0;
import N1.f0;
import N1.g0;
import N1.h0;
import N1.i0;
import N1.j0;
import N1.k0;
import N1.m0;
import N1.o0;
import N1.p0;
import N1.q0;
import N1.r0;
import N1.s0;
import N1.t0;
import N1.v0;
import W2.g;
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.PointF;
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.KeyEvent;
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 com.rubensousa.dpadrecyclerview.DpadRecyclerView;
import com.rubensousa.dpadrecyclerview.layoutmanager.PivotLayoutManager;
import d3.R0;
import d3.V0;
import d5.AbstractC0844a;
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 q.i;
import s7.d;
import u.AbstractC1563h;
import v0.AbstractC1664c;

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

    /* JADX INFO: renamed from: U0, reason: collision with root package name */
    public static boolean f9008U0 = false;

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

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

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

    /* JADX INFO: renamed from: Z0, reason: collision with root package name */
    public static final boolean f9012Z0 = true;
    public static final Class[] a1;

    /* JADX INFO: renamed from: b1, reason: collision with root package name */
    public static final Q f9013b1;

    /* JADX INFO: renamed from: c1, reason: collision with root package name */
    public static final q0 f9014c1;

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

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

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

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

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

    /* JADX INFO: renamed from: C0, reason: collision with root package name */
    public boolean f9020C0;
    public a D;

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

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

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

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

    /* JADX INFO: renamed from: F0, reason: collision with root package name */
    public v0 f9025F0;

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

    /* JADX INFO: renamed from: G0, reason: collision with root package name */
    public X f9027G0;
    public final ArrayList H;

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

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

    /* JADX INFO: renamed from: I0, reason: collision with root package name */
    public C0180j f9030I0;

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

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

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public boolean f9033K;
    public final int[] K0;

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

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

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

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

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: R0, reason: collision with root package name */
    public final boolean f9047R0;

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

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

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

    /* JADX INFO: renamed from: T0, reason: collision with root package name */
    public final C0177g f9051T0;

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    public Z f9061g0;

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final float f9071q;
    public final int q0;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final k0 f9072r;

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final I f9080v;

    /* JADX INFO: renamed from: v0, reason: collision with root package name */
    public final s0 f9081v0;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final R0 f9082w;

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

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

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

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

    /* JADX INFO: renamed from: y0, reason: collision with root package name */
    public final p0 f9087y0;

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

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

    static {
        Class cls = Integer.TYPE;
        a1 = new Class[]{Context.class, AttributeSet.class, cls, cls};
        f9013b1 = new Q(0);
        f9014c1 = new q0();
    }

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

    public static RecyclerView G(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 i = 0; i < childCount; i++) {
            RecyclerView recyclerViewG = G(viewGroup.getChildAt(i));
            if (recyclerViewG != null) {
                return recyclerViewG;
            }
        }
        return null;
    }

    public static t0 N(View view) {
        if (view == null) {
            return null;
        }
        return ((C0203d0) view.getLayoutParams()).f4520q;
    }

    private C0180j getScrollingChildHelper() {
        if (this.f9030I0 == null) {
            this.f9030I0 = new C0180j(this);
        }
        return this.f9030I0;
    }

    public static void k(t0 t0Var) {
        WeakReference weakReference = t0Var.f4655b;
        if (weakReference != null) {
            View view = (View) weakReference.get();
            while (view != null) {
                if (view == t0Var.f4654a) {
                    return;
                }
                Object parent = view.getParent();
                view = parent instanceof View ? (View) parent : null;
            }
            t0Var.f4655b = null;
        }
    }

    public static int n(int i, EdgeEffect edgeEffect, EdgeEffect edgeEffect2, int i5) {
        if (i > 0 && edgeEffect != null && g.t(edgeEffect) != 0.0f) {
            int iRound = Math.round(g.C(edgeEffect, ((-i) * 4.0f) / i5, 0.5f) * ((-i5) / 4.0f));
            if (iRound != i) {
                edgeEffect.finish();
            }
            return i - iRound;
        }
        if (i >= 0 || edgeEffect2 == null || g.t(edgeEffect2) == 0.0f) {
            return i;
        }
        float f3 = i5;
        int iRound2 = Math.round(g.C(edgeEffect2, (i * 4.0f) / f3, 0.5f) * (f3 / 4.0f));
        if (iRound2 != i) {
            edgeEffect2.finish();
        }
        return i - iRound2;
    }

    public static void setDebugAssertionsEnabled(boolean z8) {
        f9008U0 = z8;
    }

    public static void setVerboseLoggingEnabled(boolean z8) {
        f9009V0 = z8;
    }

    public final void A() {
        if (this.f9058d0 != null) {
            return;
        }
        ((q0) this.f9056b0).getClass();
        EdgeEffect edgeEffect = new EdgeEffect(getContext());
        this.f9058d0 = edgeEffect;
        if (this.f9084x) {
            edgeEffect.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffect.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    public final String B() {
        return " " + super.toString() + ", adapter:" + this.f9019C + ", layout:" + this.D + ", context:" + getContext();
    }

    public final void C(p0 p0Var) {
        if (getScrollState() != 2) {
            p0Var.f4627o = 0;
            p0Var.f4628p = 0;
        } else {
            OverScroller overScroller = this.f9081v0.f4644s;
            p0Var.f4627o = overScroller.getFinalX() - overScroller.getCurrX();
            p0Var.f4628p = overScroller.getFinalY() - overScroller.getCurrY();
        }
    }

    public final View D(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 E(MotionEvent motionEvent) {
        int action = motionEvent.getAction();
        ArrayList arrayList = this.H;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            C0223y c0223y = (C0223y) arrayList.get(i);
            int i5 = c0223y.f4719v;
            if (i5 == 1) {
                boolean zE = c0223y.e(motionEvent.getX(), motionEvent.getY());
                boolean zD = c0223y.d(motionEvent.getX(), motionEvent.getY());
                if (motionEvent.getAction() == 0 && (zE || zD)) {
                    if (zD) {
                        c0223y.f4720w = 1;
                        c0223y.f4713p = (int) motionEvent.getX();
                    } else if (zE) {
                        c0223y.f4720w = 2;
                        c0223y.f4710m = (int) motionEvent.getY();
                    }
                    c0223y.g(2);
                    if (action == 3) {
                        this.f9029I = c0223y;
                        return true;
                    }
                }
            } else if (i5 != 2) {
                continue;
            } else if (action == 3) {
            }
        }
        return false;
    }

    public final void F(int[] iArr) {
        int i = this.f9080v.i();
        if (i == 0) {
            iArr[0] = -1;
            iArr[1] = -1;
            return;
        }
        int i5 = Integer.MAX_VALUE;
        int i8 = Integer.MIN_VALUE;
        for (int i9 = 0; i9 < i; i9++) {
            t0 t0VarN = N(this.f9080v.h(i9));
            if (!t0VarN.q()) {
                int iD = t0VarN.d();
                if (iD < i5) {
                    i5 = iD;
                }
                if (iD > i8) {
                    i8 = iD;
                }
            }
        }
        iArr[0] = i5;
        iArr[1] = i8;
    }

    public final t0 H(int i) {
        t0 t0Var = null;
        if (this.f9052U) {
            return null;
        }
        int iL = this.f9080v.l();
        for (int i5 = 0; i5 < iL; i5++) {
            t0 t0VarN = N(this.f9080v.k(i5));
            if (t0VarN != null && !t0VarN.j() && K(t0VarN) == i) {
                if (!((ArrayList) this.f9080v.f72u).contains(t0VarN.f4654a)) {
                    return t0VarN;
                }
                t0Var = t0VarN;
            }
        }
        return t0Var;
    }

    /* JADX WARN: Removed duplicated region for block: B:15:0x002a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final t0 I(int i, boolean z8) {
        int iL = this.f9080v.l();
        t0 t0Var = null;
        for (int i5 = 0; i5 < iL; i5++) {
            t0 t0VarN = N(this.f9080v.k(i5));
            if (t0VarN != null && !t0VarN.j()) {
                if (z8) {
                    if (t0VarN.f4656c != i) {
                        continue;
                    } else {
                        if (!((ArrayList) this.f9080v.f72u).contains(t0VarN.f4654a)) {
                            return t0VarN;
                        }
                        t0Var = t0VarN;
                    }
                } else if (t0VarN.d() != i) {
                    continue;
                }
            }
        }
        return t0Var;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:101:0x0151  */
    /* JADX WARN: Removed duplicated region for block: B:163:0x0217  */
    /* JADX WARN: Removed duplicated region for block: B:165:0x021d  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x008a  */
    /* JADX WARN: Removed duplicated region for block: B:61:0x00c9  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x00d0 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:65:0x00d2  */
    /* JADX WARN: Removed duplicated region for block: B:71:0x00f2  */
    /* JADX WARN: Removed duplicated region for block: B:73:0x00fa  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean J(int i, int i5, int i8, int i9) {
        int iMax;
        int i10;
        s0 s0Var;
        float f3;
        float f7;
        boolean z8;
        boolean z9;
        boolean z10;
        int minFlingVelocity;
        boolean z11;
        int iT;
        PointF pointFF;
        int i11;
        a aVar = this.D;
        if (aVar == null) {
            Log.e("RecyclerView", "Cannot fling without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return false;
        }
        if (!this.f9040O) {
            boolean zP = aVar.p();
            boolean zQ = this.D.q();
            int i12 = (!zP || Math.abs(i) < i8) ? 0 : i;
            int iMax2 = (!zQ || Math.abs(i5) < i8) ? 0 : i5;
            if (i12 != 0 || iMax2 != 0) {
                if (i12 == 0) {
                    iMax = 0;
                    if (iMax2 == 0) {
                        i10 = iMax2;
                        iMax2 = 0;
                        s0Var = this.f9081v0;
                        if (iMax == 0 || iMax2 != 0) {
                            int i13 = -i9;
                            iMax = Math.max(i13, Math.min(iMax, i9));
                            iMax2 = Math.max(i13, Math.min(iMax2, i9));
                            t0(1);
                            s0Var.a(iMax, iMax2);
                        }
                        if (i12 == 0 || i10 != 0) {
                            f3 = i12;
                            f7 = i10;
                            if (!dispatchNestedPreFling(f3, f7)) {
                                boolean z12 = zP || zQ;
                                dispatchNestedFling(f3, f7, z12);
                                e0 e0Var = this.f9070p0;
                                if (e0Var != null) {
                                    O o8 = (O) e0Var;
                                    a layoutManager = o8.f4482a.getLayoutManager();
                                    if (layoutManager != 0 && o8.f4482a.getAdapter() != null && ((Math.abs(i10) > (minFlingVelocity = o8.f4482a.getMinFlingVelocity()) || Math.abs(i12) > minFlingVelocity) && ((z11 = layoutManager instanceof o0)))) {
                                        View view = null;
                                        N n8 = !z11 ? null : new N(o8, o8.f4482a.getContext());
                                        if (n8 == null) {
                                            z8 = z12;
                                            z9 = false;
                                            z10 = true;
                                        } else {
                                            int iS = layoutManager.S();
                                            if (iS != 0) {
                                                M mE = layoutManager.q() ? o8.e(layoutManager) : layoutManager.p() ? o8.d(layoutManager) : null;
                                                if (mE == null) {
                                                    z8 = z12;
                                                    z9 = false;
                                                    z10 = true;
                                                } else {
                                                    z9 = false;
                                                    int I7 = layoutManager.I();
                                                    z10 = true;
                                                    int i14 = 0;
                                                    int i15 = Integer.MIN_VALUE;
                                                    int i16 = Integer.MAX_VALUE;
                                                    View view2 = null;
                                                    while (i14 < I7) {
                                                        boolean z13 = z12;
                                                        View viewH = layoutManager.H(i14);
                                                        if (viewH == null) {
                                                            i11 = I7;
                                                        } else {
                                                            i11 = I7;
                                                            int iB = O.b(viewH, mE);
                                                            if (iB <= 0 && iB > i15) {
                                                                view2 = viewH;
                                                                i15 = iB;
                                                            }
                                                            if (iB >= 0 && iB < i16) {
                                                                view = viewH;
                                                                i16 = iB;
                                                            }
                                                        }
                                                        i14++;
                                                        z12 = z13;
                                                        I7 = i11;
                                                    }
                                                    z8 = z12;
                                                    Object[] objArr = !layoutManager.p() ? i10 <= 0 : i12 <= 0;
                                                    if (objArr == true && view != null) {
                                                        iT = a.T(view);
                                                    } else if (objArr == true || view2 == null) {
                                                        if (objArr != false) {
                                                            view = view2;
                                                        }
                                                        if (view != null) {
                                                            iT = ((z11 && (pointFF = ((o0) layoutManager).f(layoutManager.S() + (-1))) != null && ((pointFF.x > 0.0f ? 1 : (pointFF.x == 0.0f ? 0 : -1)) < 0 || (pointFF.y > 0.0f ? 1 : (pointFF.y == 0.0f ? 0 : -1)) < 0)) == objArr ? -1 : 1) + a.T(view);
                                                            if (iT < 0 || iT >= iS) {
                                                            }
                                                        }
                                                    } else {
                                                        iT = a.T(view2);
                                                    }
                                                    if (iT != -1) {
                                                        n8.f4460a = iT;
                                                        layoutManager.a1(n8);
                                                        return z10;
                                                    }
                                                }
                                                iT = -1;
                                                if (iT != -1) {
                                                }
                                            }
                                        }
                                    }
                                }
                                if (!z8) {
                                    return z9;
                                }
                                boolean z14 = z10;
                                t0(z14 ? 1 : 0);
                                int i17 = -i9;
                                s0Var.a(Math.max(i17, Math.min(i12, i9)), Math.max(i17, Math.min(i10, i9)));
                                return z14;
                            }
                        } else if (iMax != 0 || iMax2 != 0) {
                            return true;
                        }
                    } else {
                        EdgeEffect edgeEffect = this.f9058d0;
                        if (edgeEffect == null || g.t(edgeEffect) == 0.0f) {
                            EdgeEffect edgeEffect2 = this.f9060f0;
                            if (edgeEffect2 != null && g.t(edgeEffect2) != 0.0f) {
                                if (m0(this.f9060f0, iMax2, getHeight())) {
                                    this.f9060f0.onAbsorb(iMax2);
                                    iMax2 = 0;
                                }
                                i10 = 0;
                                s0Var = this.f9081v0;
                                if (iMax == 0) {
                                    int i132 = -i9;
                                    iMax = Math.max(i132, Math.min(iMax, i9));
                                    iMax2 = Math.max(i132, Math.min(iMax2, i9));
                                    t0(1);
                                    s0Var.a(iMax, iMax2);
                                    if (i12 == 0) {
                                        f3 = i12;
                                        f7 = i10;
                                        if (!dispatchNestedPreFling(f3, f7)) {
                                        }
                                    }
                                }
                            }
                            i10 = iMax2;
                            iMax2 = 0;
                            s0Var = this.f9081v0;
                            if (iMax == 0) {
                            }
                        } else {
                            int i18 = -iMax2;
                            if (m0(this.f9058d0, i18, getHeight())) {
                                this.f9058d0.onAbsorb(i18);
                                iMax2 = 0;
                            }
                            i10 = 0;
                            s0Var = this.f9081v0;
                            if (iMax == 0) {
                            }
                        }
                    }
                } else {
                    EdgeEffect edgeEffect3 = this.f9057c0;
                    if (edgeEffect3 == null || g.t(edgeEffect3) == 0.0f) {
                        EdgeEffect edgeEffect4 = this.f9059e0;
                        if (edgeEffect4 != null && g.t(edgeEffect4) != 0.0f) {
                            if (m0(this.f9059e0, i12, getWidth())) {
                                this.f9059e0.onAbsorb(i12);
                                i12 = 0;
                            }
                            iMax = i12;
                            i12 = 0;
                            if (iMax2 == 0) {
                            }
                        }
                        iMax = 0;
                        if (iMax2 == 0) {
                        }
                    } else {
                        int i19 = -i12;
                        if (m0(this.f9057c0, i19, getWidth())) {
                            this.f9057c0.onAbsorb(i19);
                            i12 = 0;
                        }
                        iMax = i12;
                        i12 = 0;
                        if (iMax2 == 0) {
                        }
                    }
                }
            }
        }
        return false;
    }

    public final int K(t0 t0Var) {
        if (((t0Var.f4662j & 524) != 0) || !t0Var.g()) {
            return -1;
        }
        C0198b c0198b = this.f9078u;
        int i = t0Var.f4656c;
        ArrayList arrayList = (ArrayList) c0198b.f4506c;
        int size = arrayList.size();
        for (int i5 = 0; i5 < size; i5++) {
            C0196a c0196a = (C0196a) arrayList.get(i5);
            int i8 = c0196a.f4500a;
            if (i8 != 1) {
                if (i8 == 2) {
                    int i9 = c0196a.f4501b;
                    if (i9 <= i) {
                        int i10 = c0196a.f4503d;
                        if (i9 + i10 > i) {
                            return -1;
                        }
                        i -= i10;
                    } else {
                        continue;
                    }
                } else if (i8 == 8) {
                    int i11 = c0196a.f4501b;
                    if (i11 == i) {
                        i = c0196a.f4503d;
                    } else {
                        if (i11 < i) {
                            i--;
                        }
                        if (c0196a.f4503d <= i) {
                            i++;
                        }
                    }
                }
            } else if (c0196a.f4501b <= i) {
                i += c0196a.f4503d;
            }
        }
        return i;
    }

    public final long L(t0 t0Var) {
        return this.f9019C.f4491b ? t0Var.f4658e : t0Var.f4656c;
    }

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

    public final Rect O(View view) {
        C0203d0 c0203d0 = (C0203d0) view.getLayoutParams();
        boolean z8 = c0203d0.f4522s;
        Rect rect = c0203d0.f4521r;
        if (z8) {
            p0 p0Var = this.f9087y0;
            if (!p0Var.f4620g || (!c0203d0.f4520q.m() && !c0203d0.f4520q.h())) {
                rect.set(0, 0, 0, 0);
                ArrayList arrayList = this.f9026G;
                int size = arrayList.size();
                for (int i = 0; i < size; i++) {
                    Rect rect2 = this.f9088z;
                    rect2.set(0, 0, 0, 0);
                    ((AbstractC0197a0) arrayList.get(i)).a(rect2, view, this, p0Var);
                    rect.left += rect2.left;
                    rect.top += rect2.top;
                    rect.right += rect2.right;
                    rect.bottom += rect2.bottom;
                }
                c0203d0.f4522s = false;
                return rect;
            }
        }
        return rect;
    }

    public final boolean P() {
        return !this.f9034L || this.f9052U || this.f9078u.m();
    }

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

    public final boolean R() {
        return this.f9054W > 0;
    }

    public final void S(int i) {
        if (this.D == null) {
            return;
        }
        setScrollState(2);
        this.D.P0(i);
        awakenScrollBars();
    }

    public final void T() {
        int iL = this.f9080v.l();
        for (int i = 0; i < iL; i++) {
            ((C0203d0) this.f9080v.k(i).getLayoutParams()).f4522s = true;
        }
        ArrayList arrayList = this.f9074s.f4557c;
        int size = arrayList.size();
        for (int i5 = 0; i5 < size; i5++) {
            C0203d0 c0203d0 = (C0203d0) ((t0) arrayList.get(i5)).f4654a.getLayoutParams();
            if (c0203d0 != null) {
                c0203d0.f4522s = true;
            }
        }
    }

    public final void U(int i, int i5, boolean z8) {
        int i8 = i + i5;
        int iL = this.f9080v.l();
        for (int i9 = 0; i9 < iL; i9++) {
            t0 t0VarN = N(this.f9080v.k(i9));
            if (t0VarN != null && !t0VarN.q()) {
                int i10 = t0VarN.f4656c;
                p0 p0Var = this.f9087y0;
                if (i10 >= i8) {
                    if (f9009V0) {
                        Log.d("RecyclerView", "offsetPositionRecordsForRemove attached child " + i9 + " holder " + t0VarN + " now at position " + (t0VarN.f4656c - i5));
                    }
                    t0VarN.n(-i5, z8);
                    p0Var.f4619f = true;
                } else if (i10 >= i) {
                    if (f9009V0) {
                        Log.d("RecyclerView", "offsetPositionRecordsForRemove attached child " + i9 + " holder " + t0VarN + " now REMOVED");
                    }
                    t0VarN.b(8);
                    t0VarN.n(-i5, z8);
                    t0VarN.f4656c = i - 1;
                    p0Var.f4619f = true;
                }
            }
        }
        i0 i0Var = this.f9074s;
        ArrayList arrayList = i0Var.f4557c;
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            t0 t0Var = (t0) arrayList.get(size);
            if (t0Var != null) {
                int i11 = t0Var.f4656c;
                if (i11 >= i8) {
                    if (f9009V0) {
                        Log.d("RecyclerView", "offsetPositionRecordsForRemove cached " + size + " holder " + t0Var + " now at position " + (t0Var.f4656c - i5));
                    }
                    t0Var.n(-i5, z8);
                } else if (i11 >= i) {
                    t0Var.b(8);
                    i0Var.h(size);
                }
            }
        }
        requestLayout();
    }

    public final void V() {
        this.f9054W++;
    }

    public final void W(boolean z8) {
        int i;
        AccessibilityManager accessibilityManager;
        int i5 = this.f9054W - 1;
        this.f9054W = i5;
        if (i5 < 1) {
            if (f9008U0 && i5 < 0) {
                throw new IllegalStateException(I1.a.l(this, new StringBuilder("layout or scroll counter cannot go below zero.Some calls are not matching")));
            }
            this.f9054W = 0;
            if (z8) {
                int i8 = this.f9044Q;
                this.f9044Q = 0;
                if (i8 != 0 && (accessibilityManager = this.f9048S) != null && accessibilityManager.isEnabled()) {
                    AccessibilityEvent accessibilityEventObtain = AccessibilityEvent.obtain();
                    accessibilityEventObtain.setEventType(2048);
                    accessibilityEventObtain.setContentChangeTypes(i8);
                    sendAccessibilityEventUnchecked(accessibilityEventObtain);
                }
                ArrayList arrayList = this.f9037M0;
                for (int size = arrayList.size() - 1; size >= 0; size--) {
                    t0 t0Var = (t0) arrayList.get(size);
                    if (t0Var.f4654a.getParent() == this && !t0Var.q() && (i = t0Var.f4669q) != -1) {
                        t0Var.f4654a.setImportantForAccessibility(i);
                        t0Var.f4669q = -1;
                    }
                }
                arrayList.clear();
            }
        }
    }

    public final void X(MotionEvent motionEvent) {
        int actionIndex = motionEvent.getActionIndex();
        if (motionEvent.getPointerId(actionIndex) == this.f9063i0) {
            int i = actionIndex == 0 ? 1 : 0;
            this.f9063i0 = motionEvent.getPointerId(i);
            int x8 = (int) (motionEvent.getX(i) + 0.5f);
            this.f9067m0 = x8;
            this.f9065k0 = x8;
            int y8 = (int) (motionEvent.getY(i) + 0.5f);
            this.f9068n0 = y8;
            this.f9066l0 = y8;
        }
    }

    public void Y(int i) {
    }

    public final void Z() {
        if (this.f9023E0 || !this.f9031J) {
            return;
        }
        Field field = J.f4065a;
        postOnAnimation(this.f9039N0);
        this.f9023E0 = true;
    }

    public final void a0() {
        boolean z8;
        boolean z9 = false;
        if (this.f9052U) {
            C0198b c0198b = this.f9078u;
            c0198b.t((ArrayList) c0198b.f4506c);
            c0198b.t((ArrayList) c0198b.f4507d);
            c0198b.f4504a = 0;
            if (this.f9053V) {
                this.D.r0(this);
            }
        }
        if (this.f9061g0 == null || !this.D.b1()) {
            this.f9078u.e();
        } else {
            this.f9078u.s();
        }
        boolean z10 = this.f9018B0 || this.f9020C0;
        boolean z11 = this.f9034L && this.f9061g0 != null && ((z8 = this.f9052U) || z10 || this.D.f9119v) && (!z8 || this.f9019C.f4491b);
        p0 p0Var = this.f9087y0;
        p0Var.f4622j = z11;
        if (z11 && z10 && !this.f9052U && this.f9061g0 != null && this.D.b1()) {
            z9 = true;
        }
        p0Var.f4623k = z9;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void addFocusables(ArrayList arrayList, int i, int i5) {
        a aVar = this.D;
        if (aVar == null || !aVar.h0(this, arrayList, i, i5)) {
            super.addFocusables(arrayList, i, i5);
        }
    }

    public final void b0(boolean z8) {
        this.f9053V = z8 | this.f9053V;
        this.f9052U = true;
        int iL = this.f9080v.l();
        for (int i = 0; i < iL; i++) {
            t0 t0VarN = N(this.f9080v.k(i));
            if (t0VarN != null && !t0VarN.q()) {
                t0VarN.b(6);
            }
        }
        T();
        i0 i0Var = this.f9074s;
        ArrayList arrayList = i0Var.f4557c;
        int size = arrayList.size();
        for (int i5 = 0; i5 < size; i5++) {
            t0 t0Var = (t0) arrayList.get(i5);
            if (t0Var != null) {
                t0Var.b(6);
                t0Var.b(1024);
            }
        }
        T t6 = i0Var.f4562h.f9019C;
        if (t6 == null || !t6.f4491b) {
            i0Var.g();
        }
    }

    public final void c0(t0 t0Var, A7.a aVar) {
        t0Var.f4662j &= -8193;
        boolean z8 = this.f9087y0.f4621h;
        R0 r02 = this.f9082w;
        if (z8 && t0Var.m() && !t0Var.j() && !t0Var.q()) {
            ((q.g) r02.f11693s).i(L(t0Var), t0Var);
        }
        i iVar = (i) r02.f11692r;
        D0 d0A = (D0) iVar.get(t0Var);
        if (d0A == null) {
            d0A = D0.a();
            iVar.put(t0Var, d0A);
        }
        d0A.f4440b = aVar;
        d0A.f4439a |= 4;
    }

    @Override // android.view.ViewGroup
    public final boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return (layoutParams instanceof C0203d0) && this.D.r((C0203d0) layoutParams);
    }

    @Override // android.view.View
    public final int computeHorizontalScrollExtent() {
        a aVar = this.D;
        if (aVar != null && aVar.p()) {
            return this.D.v(this.f9087y0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeHorizontalScrollOffset() {
        a aVar = this.D;
        if (aVar != null && aVar.p()) {
            return this.D.w(this.f9087y0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeHorizontalScrollRange() {
        a aVar = this.D;
        if (aVar != null && aVar.p()) {
            return this.D.x(this.f9087y0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeVerticalScrollExtent() {
        a aVar = this.D;
        if (aVar != null && aVar.q()) {
            return this.D.y(this.f9087y0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeVerticalScrollOffset() {
        a aVar = this.D;
        if (aVar != null && aVar.q()) {
            return this.D.z(this.f9087y0);
        }
        return 0;
    }

    @Override // android.view.View
    public final int computeVerticalScrollRange() {
        a aVar = this.D;
        if (aVar != null && aVar.q()) {
            return this.D.A(this.f9087y0);
        }
        return 0;
    }

    public final void d0() {
        boolean zIsFinished;
        EdgeEffect edgeEffect = this.f9057c0;
        if (edgeEffect != null) {
            edgeEffect.onRelease();
            zIsFinished = this.f9057c0.isFinished();
        } else {
            zIsFinished = false;
        }
        EdgeEffect edgeEffect2 = this.f9058d0;
        if (edgeEffect2 != null) {
            edgeEffect2.onRelease();
            zIsFinished |= this.f9058d0.isFinished();
        }
        EdgeEffect edgeEffect3 = this.f9059e0;
        if (edgeEffect3 != null) {
            edgeEffect3.onRelease();
            zIsFinished |= this.f9059e0.isFinished();
        }
        EdgeEffect edgeEffect4 = this.f9060f0;
        if (edgeEffect4 != null) {
            edgeEffect4.onRelease();
            zIsFinished |= this.f9060f0.isFinished();
        }
        if (zIsFinished) {
            postInvalidateOnAnimation();
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public boolean dispatchKeyEvent(KeyEvent keyEvent) {
        if (super.dispatchKeyEvent(keyEvent)) {
            return true;
        }
        a layoutManager = getLayoutManager();
        int iA = 0;
        if (layoutManager != null) {
            if (layoutManager.q()) {
                int keyCode = keyEvent.getKeyCode();
                if (keyCode == 92 || keyCode == 93) {
                    int measuredHeight = getMeasuredHeight();
                    if (keyCode == 93) {
                        p0(0, measuredHeight, false);
                        return true;
                    }
                    p0(0, -measuredHeight, false);
                    return true;
                }
                if (keyCode == 122 || keyCode == 123) {
                    boolean Z7 = layoutManager.Z();
                    if (keyCode == 122) {
                        if (Z7) {
                            iA = getAdapter().a();
                        }
                    } else if (!Z7) {
                        iA = getAdapter().a();
                    }
                    q0(iA);
                    return true;
                }
            } else if (layoutManager.p()) {
                int keyCode2 = keyEvent.getKeyCode();
                if (keyCode2 == 92 || keyCode2 == 93) {
                    int measuredWidth = getMeasuredWidth();
                    if (keyCode2 == 93) {
                        p0(measuredWidth, 0, false);
                        return true;
                    }
                    p0(-measuredWidth, 0, false);
                    return true;
                }
                if (keyCode2 == 122 || keyCode2 == 123) {
                    boolean Z8 = layoutManager.Z();
                    if (keyCode2 == 122) {
                        if (Z8) {
                            iA = getAdapter().a();
                        }
                    } else if (!Z8) {
                        iA = getAdapter().a();
                    }
                    q0(iA);
                    return true;
                }
            }
        }
        return false;
    }

    @Override // android.view.View
    public final boolean dispatchNestedFling(float f3, float f7, boolean z8) {
        return getScrollingChildHelper().a(f3, f7, z8);
    }

    @Override // android.view.View
    public final boolean dispatchNestedPreFling(float f3, float f7) {
        return getScrollingChildHelper().b(f3, f7);
    }

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

    @Override // android.view.View
    public final boolean dispatchNestedScroll(int i, int i5, int i8, int i9, int[] iArr) {
        return getScrollingChildHelper().d(i, i5, 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 z8;
        super.draw(canvas);
        ArrayList arrayList = this.f9026G;
        int size = arrayList.size();
        boolean z9 = false;
        for (int i = 0; i < size; i++) {
            ((AbstractC0197a0) arrayList.get(i)).c(canvas);
        }
        EdgeEffect edgeEffect = this.f9057c0;
        if (edgeEffect == null || edgeEffect.isFinished()) {
            z8 = false;
        } else {
            int iSave = canvas.save();
            int paddingBottom = this.f9084x ? getPaddingBottom() : 0;
            canvas.rotate(270.0f);
            canvas.translate((-getHeight()) + paddingBottom, 0.0f);
            EdgeEffect edgeEffect2 = this.f9057c0;
            z8 = edgeEffect2 != null && edgeEffect2.draw(canvas);
            canvas.restoreToCount(iSave);
        }
        EdgeEffect edgeEffect3 = this.f9058d0;
        if (edgeEffect3 != null && !edgeEffect3.isFinished()) {
            int iSave2 = canvas.save();
            if (this.f9084x) {
                canvas.translate(getPaddingLeft(), getPaddingTop());
            }
            EdgeEffect edgeEffect4 = this.f9058d0;
            z8 |= edgeEffect4 != null && edgeEffect4.draw(canvas);
            canvas.restoreToCount(iSave2);
        }
        EdgeEffect edgeEffect5 = this.f9059e0;
        if (edgeEffect5 != null && !edgeEffect5.isFinished()) {
            int iSave3 = canvas.save();
            int width = getWidth();
            int paddingTop = this.f9084x ? getPaddingTop() : 0;
            canvas.rotate(90.0f);
            canvas.translate(paddingTop, -width);
            EdgeEffect edgeEffect6 = this.f9059e0;
            z8 |= edgeEffect6 != null && edgeEffect6.draw(canvas);
            canvas.restoreToCount(iSave3);
        }
        EdgeEffect edgeEffect7 = this.f9060f0;
        if (edgeEffect7 != null && !edgeEffect7.isFinished()) {
            int iSave4 = canvas.save();
            canvas.rotate(180.0f);
            if (this.f9084x) {
                canvas.translate(getPaddingRight() + (-getWidth()), getPaddingBottom() + (-getHeight()));
            } else {
                canvas.translate(-getWidth(), -getHeight());
            }
            EdgeEffect edgeEffect8 = this.f9060f0;
            if (edgeEffect8 != null && edgeEffect8.draw(canvas)) {
                z9 = true;
            }
            z8 |= z9;
            canvas.restoreToCount(iSave4);
        }
        if ((z8 || this.f9061g0 == null || arrayList.size() <= 0 || !this.f9061g0.f()) ? z8 : true) {
            postInvalidateOnAnimation();
        }
    }

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

    public final int e0(int i, float f3) {
        float height = f3 / getHeight();
        float width = i / getWidth();
        EdgeEffect edgeEffect = this.f9057c0;
        float f7 = 0.0f;
        if (edgeEffect == null || g.t(edgeEffect) == 0.0f) {
            EdgeEffect edgeEffect2 = this.f9059e0;
            if (edgeEffect2 != null && g.t(edgeEffect2) != 0.0f) {
                if (canScrollHorizontally(1)) {
                    this.f9059e0.onRelease();
                } else {
                    float fC = g.C(this.f9059e0, width, height);
                    if (g.t(this.f9059e0) == 0.0f) {
                        this.f9059e0.onRelease();
                    }
                    f7 = fC;
                }
                invalidate();
            }
        } else {
            if (canScrollHorizontally(-1)) {
                this.f9057c0.onRelease();
            } else {
                float f8 = -g.C(this.f9057c0, -width, 1.0f - height);
                if (g.t(this.f9057c0) == 0.0f) {
                    this.f9057c0.onRelease();
                }
                f7 = f8;
            }
            invalidate();
        }
        return Math.round(f7 * getWidth());
    }

    public final int f0(int i, float f3) {
        float width = f3 / getWidth();
        float height = i / getHeight();
        EdgeEffect edgeEffect = this.f9058d0;
        float f7 = 0.0f;
        if (edgeEffect == null || g.t(edgeEffect) == 0.0f) {
            EdgeEffect edgeEffect2 = this.f9060f0;
            if (edgeEffect2 != null && g.t(edgeEffect2) != 0.0f) {
                if (canScrollVertically(1)) {
                    this.f9060f0.onRelease();
                } else {
                    float fC = g.C(this.f9060f0, height, 1.0f - width);
                    if (g.t(this.f9060f0) == 0.0f) {
                        this.f9060f0.onRelease();
                    }
                    f7 = fC;
                }
                invalidate();
            }
        } else {
            if (canScrollVertically(-1)) {
                this.f9058d0.onRelease();
            } else {
                float f8 = -g.C(this.f9058d0, -height, width);
                if (g.t(this.f9058d0) == 0.0f) {
                    this.f9058d0.onRelease();
                }
                f7 = f8;
            }
            invalidate();
        }
        return Math.round(f7 * getHeight());
    }

    /* JADX WARN: Removed duplicated region for block: B:121:0x016b  */
    /* JADX WARN: Removed duplicated region for block: B:140:0x019b A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:141:0x019c  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x0065  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0067  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x006a  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x006c  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x0070  */
    /* JADX WARN: Removed duplicated region for block: B:41:0x0073  */
    /* JADX WARN: Removed duplicated region for block: B:44:0x007a  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x007c  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x007f  */
    /* JADX WARN: Removed duplicated region for block: B:61:0x00bb  */
    /* JADX WARN: Removed duplicated region for block: B:70:0x00d2 A[ADDED_TO_REGION] */
    @Override // android.view.ViewGroup, android.view.ViewParent
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public View focusSearch(View view, int i) {
        View viewK0;
        int i5;
        byte b8;
        boolean z8;
        View viewP0 = this.D.p0(view, i);
        if (viewP0 != null) {
            return viewP0;
        }
        boolean z9 = true;
        boolean z10 = (this.f9019C == null || this.D == null || R() || this.f9040O) ? false : true;
        FocusFinder focusFinder = FocusFinder.getInstance();
        p0 p0Var = this.f9087y0;
        i0 i0Var = this.f9074s;
        if (!z10 || (i != 2 && i != 1)) {
            View viewFindNextFocus = focusFinder.findNextFocus(this, view, i);
            if (viewFindNextFocus == null && z10) {
                o();
                if (D(view) != null) {
                    r0();
                    viewK0 = this.D.k0(view, i, i0Var, p0Var);
                    u0(false);
                }
                return null;
            }
            viewK0 = viewFindNextFocus;
            if (viewK0 == null && !viewK0.hasFocusable()) {
                if (getFocusedChild() == null) {
                    return super.focusSearch(view, i);
                }
                h0(viewK0, null);
                return view;
            }
            if (viewK0 == null || viewK0 == this || viewK0 == view) {
                z9 = false;
            } else if (D(viewK0) == null) {
                z9 = false;
            } else if (view != null && D(view) != null) {
                int width = view.getWidth();
                int height = view.getHeight();
                Rect rect = this.f9088z;
                rect.set(0, 0, width, height);
                int width2 = viewK0.getWidth();
                int height2 = viewK0.getHeight();
                Rect rect2 = this.f9015A;
                rect2.set(0, 0, width2, height2);
                offsetDescendantRectToMyCoords(view, rect);
                offsetDescendantRectToMyCoords(viewK0, rect2);
                int i8 = this.D.f9115r.getLayoutDirection() == 1 ? -1 : 1;
                int i9 = rect.left;
                int i10 = rect2.left;
                if ((i9 < i10 || rect.right <= i10) && rect.right < rect2.right) {
                    i5 = 1;
                } else {
                    int i11 = rect.right;
                    int i12 = rect2.right;
                    i5 = ((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) {
                    b8 = 1;
                } else {
                    int i15 = rect.bottom;
                    int i16 = rect2.bottom;
                    b8 = ((i15 > i16 || i13 >= i16) && i13 > i14) ? (byte) -1 : (byte) 0;
                }
                if (i != 1) {
                    if (i != 2) {
                        if (i != 17) {
                            if (i != 33) {
                                if (i != 66) {
                                    if (i != 130) {
                                        StringBuilder sb = new StringBuilder("Invalid direction: ");
                                        sb.append(i);
                                        throw new IllegalArgumentException(I1.a.l(this, sb));
                                    }
                                    if (b8 <= 0) {
                                    }
                                } else if (i5 <= 0) {
                                }
                            } else if (b8 >= 0) {
                            }
                        } else if (i5 >= 0) {
                        }
                    } else if (b8 <= 0 && (b8 != 0 || i5 * i8 <= 0)) {
                    }
                } else if (b8 >= 0 && (b8 != 0 || i5 * i8 >= 0)) {
                }
            }
            return z9 ? viewK0 : super.focusSearch(view, i);
        }
        if (this.D.q()) {
            if (focusFinder.findNextFocus(this, view, i == 2 ? 130 : 33) == null) {
                z8 = true;
            }
            if (!z8 && this.D.p()) {
                z8 = focusFinder.findNextFocus(this, view, !((this.D.f9115r.getLayoutDirection() != 1) ^ (i != 2)) ? 66 : 17) != null;
            }
            if (z8) {
                o();
                if (D(view) != null) {
                    r0();
                    this.D.k0(view, i, i0Var, p0Var);
                    u0(false);
                }
                return null;
            }
            viewK0 = focusFinder.findNextFocus(this, view, i);
            if (viewK0 == null) {
            }
            if (viewK0 == null) {
                z9 = false;
            }
            if (z9) {
            }
        }
        z8 = false;
        if (!z8) {
            if (focusFinder.findNextFocus(this, view, !((this.D.f9115r.getLayoutDirection() != 1) ^ (i != 2)) ? 66 : 17) != null) {
            }
        }
        if (z8) {
        }
        viewK0 = focusFinder.findNextFocus(this, view, i);
        if (viewK0 == null) {
        }
        if (viewK0 == null) {
        }
        if (z9) {
        }
    }

    public final void g(t0 t0Var) {
        View view = t0Var.f4654a;
        boolean z8 = view.getParent() == this;
        this.f9074s.m(M(view));
        if (t0Var.l()) {
            this.f9080v.d(view, -1, view.getLayoutParams(), true);
            return;
        }
        if (!z8) {
            this.f9080v.c(view, -1, true);
            return;
        }
        I i = this.f9080v;
        int iIndexOfChild = ((S) i.f70s).f4489q.indexOfChild(view);
        if (iIndexOfChild >= 0) {
            ((C0207h) i.f71t).A(iIndexOfChild);
            i.m(view);
        } else {
            throw new IllegalArgumentException("view is not a child, cannot hide " + view);
        }
    }

    public final void g0(AbstractC0197a0 abstractC0197a0) {
        a aVar = this.D;
        if (aVar != null) {
            aVar.n("Cannot remove item decoration during a scroll  or layout");
        }
        ArrayList arrayList = this.f9026G;
        arrayList.remove(abstractC0197a0);
        if (arrayList.isEmpty()) {
            setWillNotDraw(getOverScrollMode() == 2);
        }
        T();
        requestLayout();
    }

    @Override // android.view.ViewGroup
    public final ViewGroup.LayoutParams generateDefaultLayoutParams() {
        a aVar = this.D;
        if (aVar != null) {
            return aVar.E();
        }
        throw new IllegalStateException(I1.a.l(this, new StringBuilder("RecyclerView has no LayoutManager")));
    }

    @Override // android.view.ViewGroup
    public final ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        a aVar = this.D;
        if (aVar != null) {
            return aVar.F(getContext(), attributeSet);
        }
        throw new IllegalStateException(I1.a.l(this, new StringBuilder("RecyclerView has no LayoutManager")));
    }

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

    public T getAdapter() {
        return this.f9019C;
    }

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

    @Override // android.view.ViewGroup
    public int getChildDrawingOrder(int i, int i5) {
        View viewD;
        int iIndexOfChild;
        X x8 = this.f9027G0;
        if (x8 == null) {
            return super.getChildDrawingOrder(i, i5);
        }
        DpadRecyclerView dpadRecyclerView = (DpadRecyclerView) ((V0) x8).f11784r;
        PivotLayoutManager pivotLayoutManager = dpadRecyclerView.f11229j1;
        return (pivotLayoutManager == null || (viewD = pivotLayoutManager.D(pivotLayoutManager.f11237I.f12524d)) == null || i5 < (iIndexOfChild = dpadRecyclerView.indexOfChild(viewD))) ? i5 : i5 < i + (-1) ? ((iIndexOfChild + i) - 1) - i5 : iIndexOfChild;
    }

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

    public v0 getCompatAccessibilityDelegate() {
        return this.f9025F0;
    }

    public Y getEdgeEffectFactory() {
        return this.f9056b0;
    }

    public Z getItemAnimator() {
        return this.f9061g0;
    }

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

    public a getLayoutManager() {
        return this.D;
    }

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

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

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

    public e0 getOnFlingListener() {
        return this.f9070p0;
    }

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

    public h0 getRecycledViewPool() {
        return this.f9074s.c();
    }

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

    public final void h(AbstractC0197a0 abstractC0197a0) {
        a aVar = this.D;
        if (aVar != null) {
            aVar.n("Cannot add item decoration during a scroll  or layout");
        }
        ArrayList arrayList = this.f9026G;
        if (arrayList.isEmpty()) {
            setWillNotDraw(false);
        }
        arrayList.add(abstractC0197a0);
        T();
        requestLayout();
    }

    public final void h0(View view, View view2) {
        View view3 = view2 != null ? view2 : view;
        int width = view3.getWidth();
        int height = view3.getHeight();
        Rect rect = this.f9088z;
        rect.set(0, 0, width, height);
        ViewGroup.LayoutParams layoutParams = view3.getLayoutParams();
        if (layoutParams instanceof C0203d0) {
            C0203d0 c0203d0 = (C0203d0) layoutParams;
            if (!c0203d0.f4522s) {
                int i = rect.left;
                Rect rect2 = c0203d0.f4521r;
                rect.left = i - rect2.left;
                rect.right += rect2.right;
                rect.top -= rect2.top;
                rect.bottom += rect2.bottom;
            }
        }
        if (view2 != null) {
            offsetDescendantRectToMyCoords(view2, rect);
            offsetRectIntoDescendantCoords(view, rect);
        }
        this.D.L0(this, view, this.f9088z, !this.f9034L, view2 == null);
    }

    @Override // android.view.View
    public final boolean hasNestedScrollingParent() {
        return getScrollingChildHelper().f(0);
    }

    public final void i(f0 f0Var) {
        if (this.f9016A0 == null) {
            this.f9016A0 = new ArrayList();
        }
        this.f9016A0.add(f0Var);
    }

    /* JADX WARN: Removed duplicated region for block: B:30:0x00cb  */
    /* JADX WARN: Removed duplicated region for block: B:32:0x00e3  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0100  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x0108  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean i0(int i, int i5, MotionEvent motionEvent, int i8) {
        int i9;
        int i10;
        int i11;
        int i12;
        boolean z8;
        boolean z9;
        boolean z10;
        o();
        T t6 = this.f9019C;
        int[] iArr = this.f9035L0;
        if (t6 != null) {
            iArr[0] = 0;
            iArr[1] = 0;
            j0(i, i5, iArr);
            i9 = iArr[0];
            i10 = iArr[1];
            i11 = i - i9;
            i12 = i5 - i10;
        } else {
            i9 = 0;
            i10 = 0;
            i11 = 0;
            i12 = 0;
        }
        if (!this.f9026G.isEmpty()) {
            invalidate();
        }
        iArr[0] = 0;
        iArr[1] = 0;
        v(i9, i10, i11, i12, this.f9032J0, i8, iArr);
        int i13 = iArr[0];
        int i14 = i11 - i13;
        int i15 = iArr[1];
        int i16 = i12 - i15;
        boolean z11 = (i13 == 0 && i15 == 0) ? false : true;
        int i17 = this.f9067m0;
        int[] iArr2 = this.f9032J0;
        int i18 = iArr2[0];
        this.f9067m0 = i17 - i18;
        int i19 = this.f9068n0;
        int i20 = iArr2[1];
        this.f9068n0 = i19 - i20;
        int[] iArr3 = this.K0;
        iArr3[0] = iArr3[0] + i18;
        iArr3[1] = iArr3[1] + i20;
        if (getOverScrollMode() != 2) {
            if (motionEvent == null || d.y(motionEvent, 8194)) {
                z8 = true;
                z9 = false;
            } else {
                float x8 = motionEvent.getX();
                float f3 = i14;
                float y8 = motionEvent.getY();
                float f7 = i16;
                if (f3 < 0.0f) {
                    y();
                    z8 = true;
                    z9 = false;
                    g.C(this.f9057c0, (-f3) / getWidth(), 1.0f - (y8 / getHeight()));
                } else {
                    z8 = true;
                    z9 = false;
                    if (f3 > 0.0f) {
                        z();
                        g.C(this.f9059e0, f3 / getWidth(), y8 / getHeight());
                    } else {
                        z10 = false;
                        if (f7 >= 0.0f) {
                            A();
                            g.C(this.f9058d0, (-f7) / getHeight(), x8 / getWidth());
                        } else {
                            if (f7 > 0.0f) {
                                x();
                                g.C(this.f9060f0, f7 / getHeight(), 1.0f - (x8 / getWidth()));
                            }
                            if (z10 || f3 != 0.0f || f7 != 0.0f) {
                                postInvalidateOnAnimation();
                            }
                            if (Build.VERSION.SDK_INT >= 31 && d.y(motionEvent, 4194304)) {
                                d0();
                            }
                        }
                        z10 = z8;
                        if (z10) {
                            postInvalidateOnAnimation();
                            if (Build.VERSION.SDK_INT >= 31) {
                                d0();
                            }
                        }
                    }
                }
                z10 = z8;
                if (f7 >= 0.0f) {
                }
                z10 = z8;
                if (z10) {
                }
            }
            m(i, i5);
        } else {
            z8 = true;
            z9 = false;
        }
        if (i9 != 0 || i10 != 0) {
            w(i9, i10);
        }
        if (!awakenScrollBars()) {
            invalidate();
        }
        return (!z11 && i9 == 0 && i10 == 0) ? z9 : z8;
    }

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

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

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

    public final void j(String str) {
        if (R()) {
            if (str != null) {
                throw new IllegalStateException(str);
            }
            throw new IllegalStateException(I1.a.l(this, new StringBuilder("Cannot call this method while RecyclerView is computing a layout or scrolling")));
        }
        if (this.f9055a0 > 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(I1.a.l(this, new StringBuilder(""))));
        }
    }

    public final void j0(int i, int i5, int[] iArr) {
        t0 t0Var;
        r0();
        V();
        Trace.beginSection("RV Scroll");
        p0 p0Var = this.f9087y0;
        C(p0Var);
        i0 i0Var = this.f9074s;
        int iO0 = i != 0 ? this.D.O0(i, i0Var, p0Var) : 0;
        int iQ0 = i5 != 0 ? this.D.Q0(i5, i0Var, p0Var) : 0;
        Trace.endSection();
        int i8 = this.f9080v.i();
        for (int i9 = 0; i9 < i8; i9++) {
            View viewH = this.f9080v.h(i9);
            t0 t0VarM = M(viewH);
            if (t0VarM != null && (t0Var = t0VarM.i) != null) {
                int left = viewH.getLeft();
                int top = viewH.getTop();
                View view = t0Var.f4654a;
                if (left != view.getLeft() || top != view.getTop()) {
                    view.layout(left, top, view.getWidth() + left, view.getHeight() + top);
                }
            }
        }
        W(true);
        u0(false);
        if (iArr != null) {
            iArr[0] = iO0;
            iArr[1] = iQ0;
        }
    }

    public void k0(int i) {
        if (this.f9040O) {
            return;
        }
        w0();
        a aVar = this.D;
        if (aVar == null) {
            Log.e("RecyclerView", "Cannot scroll to position a LayoutManager set. Call setLayoutManager with a non-null argument.");
        } else {
            aVar.P0(i);
            awakenScrollBars();
        }
    }

    public final void l() {
        int iL = this.f9080v.l();
        for (int i = 0; i < iL; i++) {
            t0 t0VarN = N(this.f9080v.k(i));
            if (!t0VarN.q()) {
                t0VarN.f4657d = -1;
                t0VarN.f4660g = -1;
            }
        }
        i0 i0Var = this.f9074s;
        ArrayList arrayList = i0Var.f4557c;
        int size = arrayList.size();
        for (int i5 = 0; i5 < size; i5++) {
            t0 t0Var = (t0) arrayList.get(i5);
            t0Var.f4657d = -1;
            t0Var.f4660g = -1;
        }
        ArrayList arrayList2 = i0Var.f4555a;
        int size2 = arrayList2.size();
        for (int i8 = 0; i8 < size2; i8++) {
            t0 t0Var2 = (t0) arrayList2.get(i8);
            t0Var2.f4657d = -1;
            t0Var2.f4660g = -1;
        }
        ArrayList arrayList3 = i0Var.f4556b;
        if (arrayList3 != null) {
            int size3 = arrayList3.size();
            for (int i9 = 0; i9 < size3; i9++) {
                t0 t0Var3 = (t0) i0Var.f4556b.get(i9);
                t0Var3.f4657d = -1;
                t0Var3.f4660g = -1;
            }
        }
    }

    public final void l0(T t6, boolean z8) {
        T t8 = this.f9019C;
        k0 k0Var = this.f9072r;
        if (t8 != null) {
            t8.f4490a.unregisterObserver(k0Var);
            this.f9019C.getClass();
        }
        Z z9 = this.f9061g0;
        if (z9 != null) {
            z9.e();
        }
        a aVar = this.D;
        i0 i0Var = this.f9074s;
        if (aVar != null) {
            aVar.G0(i0Var);
            this.D.H0(i0Var);
        }
        i0Var.f4555a.clear();
        i0Var.g();
        C0198b c0198b = this.f9078u;
        c0198b.t((ArrayList) c0198b.f4506c);
        c0198b.t((ArrayList) c0198b.f4507d);
        c0198b.f4504a = 0;
        T t9 = this.f9019C;
        this.f9019C = t6;
        if (t6 != null) {
            t6.f4490a.registerObserver(k0Var);
        }
        a aVar2 = this.D;
        if (aVar2 != null) {
            aVar2.g0(t9, this.f9019C);
        }
        T t10 = this.f9019C;
        i0Var.f4555a.clear();
        i0Var.g();
        i0Var.f(t9, true);
        h0 h0VarC = i0Var.c();
        if (t9 != null) {
            h0VarC.f4550b--;
        }
        if (!z8 && h0VarC.f4550b == 0) {
            int i = 0;
            while (true) {
                SparseArray sparseArray = h0VarC.f4549a;
                if (i >= sparseArray.size()) {
                    break;
                }
                g0 g0Var = (g0) sparseArray.valueAt(i);
                ArrayList arrayList = g0Var.f4542a;
                int size = arrayList.size();
                int i5 = 0;
                while (i5 < size) {
                    Object obj = arrayList.get(i5);
                    i5++;
                    AbstractC1664c.c(((t0) obj).f4654a);
                }
                g0Var.f4542a.clear();
                i++;
            }
        }
        if (t10 != null) {
            h0VarC.f4550b++;
        } else {
            h0VarC.getClass();
        }
        i0Var.e();
        this.f9087y0.f4619f = true;
    }

    public final void m(int i, int i5) {
        boolean zIsFinished;
        EdgeEffect edgeEffect = this.f9057c0;
        if (edgeEffect == null || edgeEffect.isFinished() || i <= 0) {
            zIsFinished = false;
        } else {
            this.f9057c0.onRelease();
            zIsFinished = this.f9057c0.isFinished();
        }
        EdgeEffect edgeEffect2 = this.f9059e0;
        if (edgeEffect2 != null && !edgeEffect2.isFinished() && i < 0) {
            this.f9059e0.onRelease();
            zIsFinished |= this.f9059e0.isFinished();
        }
        EdgeEffect edgeEffect3 = this.f9058d0;
        if (edgeEffect3 != null && !edgeEffect3.isFinished() && i5 > 0) {
            this.f9058d0.onRelease();
            zIsFinished |= this.f9058d0.isFinished();
        }
        EdgeEffect edgeEffect4 = this.f9060f0;
        if (edgeEffect4 != null && !edgeEffect4.isFinished() && i5 < 0) {
            this.f9060f0.onRelease();
            zIsFinished |= this.f9060f0.isFinished();
        }
        if (zIsFinished) {
            postInvalidateOnAnimation();
        }
    }

    public final boolean m0(EdgeEffect edgeEffect, int i, int i5) {
        if (i > 0) {
            return true;
        }
        float fT = g.t(edgeEffect) * i5;
        float fAbs = Math.abs(-i) * 0.35f;
        float f3 = this.f9071q * 0.015f;
        double dLog = Math.log(fAbs / f3);
        double d8 = f9010X0;
        return ((float) (Math.exp((d8 / (d8 - 1.0d)) * dLog) * ((double) f3))) < fT;
    }

    public void n0(int i, int i5) {
        o0(i, i5);
    }

    public final void o() {
        if (!this.f9034L || this.f9052U) {
            Trace.beginSection("RV FullInvalidate");
            r();
            Trace.endSection();
            return;
        }
        if (this.f9078u.m()) {
            C0198b c0198b = this.f9078u;
            int i = c0198b.f4504a;
            if ((i & 4) == 0 || (i & 11) != 0) {
                if (c0198b.m()) {
                    Trace.beginSection("RV FullInvalidate");
                    r();
                    Trace.endSection();
                    return;
                }
                return;
            }
            Trace.beginSection("RV PartialInvalidate");
            r0();
            V();
            this.f9078u.s();
            if (!this.f9038N) {
                int i5 = this.f9080v.i();
                int i8 = 0;
                while (true) {
                    if (i8 < i5) {
                        t0 t0VarN = N(this.f9080v.h(i8));
                        if (t0VarN != null && !t0VarN.q() && t0VarN.m()) {
                            r();
                            break;
                        }
                        i8++;
                    } else {
                        this.f9078u.d();
                        break;
                    }
                }
            }
            u0(true);
            W(true);
            Trace.endSection();
        }
    }

    public void o0(int i, int i5) {
        p0(i, i5, false);
    }

    /* JADX WARN: Removed duplicated region for block: B:21:0x0058  */
    @Override // android.view.ViewGroup, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void onAttachedToWindow() {
        float refreshRate;
        super.onAttachedToWindow();
        this.f9054W = 0;
        this.f9031J = true;
        this.f9034L = this.f9034L && !isLayoutRequested();
        this.f9074s.e();
        a aVar = this.D;
        if (aVar != null) {
            aVar.f9120w = true;
            aVar.i0(this);
        }
        this.f9023E0 = false;
        if (f9012Z0) {
            ThreadLocal threadLocal = B.f4410u;
            B b8 = (B) threadLocal.get();
            this.f9083w0 = b8;
            if (b8 == null) {
                this.f9083w0 = new B();
                Field field = J.f4065a;
                Display display = getDisplay();
                if (isInEditMode() || display == null) {
                    refreshRate = 60.0f;
                    B b9 = this.f9083w0;
                    b9.f4414s = (long) (1.0E9f / refreshRate);
                    threadLocal.set(b9);
                } else {
                    refreshRate = display.getRefreshRate();
                    if (refreshRate < 30.0f) {
                    }
                    B b92 = this.f9083w0;
                    b92.f4414s = (long) (1.0E9f / refreshRate);
                    threadLocal.set(b92);
                }
            }
            B b10 = this.f9083w0;
            b10.getClass();
            boolean z8 = f9008U0;
            ArrayList arrayList = b10.f4412q;
            if (z8 && arrayList.contains(this)) {
                throw new IllegalStateException("RecyclerView already present in worker list!");
            }
            arrayList.add(this);
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onDetachedFromWindow() {
        B b8;
        super.onDetachedFromWindow();
        Z z8 = this.f9061g0;
        if (z8 != null) {
            z8.e();
        }
        w0();
        int i = 0;
        this.f9031J = false;
        a aVar = this.D;
        i0 i0Var = this.f9074s;
        if (aVar != null) {
            aVar.f9120w = false;
            aVar.j0(this, i0Var);
        }
        this.f9037M0.clear();
        removeCallbacks(this.f9039N0);
        this.f9082w.getClass();
        while (D0.f4438d.a() != null) {
        }
        int i5 = 0;
        while (true) {
            ArrayList arrayList = i0Var.f4557c;
            if (i5 >= arrayList.size()) {
                break;
            }
            AbstractC1664c.c(((t0) arrayList.get(i5)).f4654a);
            i5++;
        }
        i0Var.f(i0Var.f4562h.f9019C, false);
        while (i < getChildCount()) {
            int i8 = i + 1;
            View childAt = getChildAt(i);
            if (childAt == null) {
                throw new IndexOutOfBoundsException();
            }
            R.a aVar2 = (R.a) childAt.getTag(com.martsnew.tv.R.id.pooling_container_listener_holder_tag);
            if (aVar2 == null) {
                aVar2 = new R.a();
                childAt.setTag(com.martsnew.tv.R.id.pooling_container_listener_holder_tag, aVar2);
            }
            ArrayList arrayList2 = aVar2.f5861a;
            int iV = l.V(arrayList2);
            if (-1 < iV) {
                arrayList2.get(iV).getClass();
                throw new ClassCastException();
            }
            i = i8;
        }
        if (!f9012Z0 || (b8 = this.f9083w0) == null) {
            return;
        }
        boolean zRemove = b8.f4412q.remove(this);
        if (f9008U0 && !zRemove) {
            throw new IllegalStateException("RecyclerView removal failed!");
        }
        this.f9083w0 = null;
    }

    @Override // android.view.View
    public final void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        ArrayList arrayList = this.f9026G;
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            ((AbstractC0197a0) arrayList.get(i)).b(this);
        }
    }

    @Override // android.view.View
    public final boolean onGenericMotionEvent(MotionEvent motionEvent) {
        float axisValue;
        int i;
        boolean z8;
        if (this.D != null && !this.f9040O && motionEvent.getAction() == 8) {
            if ((motionEvent.getSource() & 2) != 0) {
                float f3 = this.D.q() ? -motionEvent.getAxisValue(9) : 0.0f;
                axisValue = this.D.p() ? motionEvent.getAxisValue(10) : 0.0f;
                i = 0;
                z8 = false;
                f = f3;
            } else if ((motionEvent.getSource() & 4194304) != 0) {
                axisValue = motionEvent.getAxisValue(26);
                if (this.D.q()) {
                    float f7 = -axisValue;
                    axisValue = 0.0f;
                    f = f7;
                } else if (!this.D.p()) {
                    axisValue = 0.0f;
                }
                i = 26;
                z8 = this.f9047R0;
            } else {
                axisValue = 0.0f;
                i = 0;
                z8 = false;
            }
            int i5 = (int) (f * this.f9077t0);
            int i8 = (int) (axisValue * this.f9075s0);
            if (z8) {
                OverScroller overScroller = this.f9081v0.f4644s;
                p0((overScroller.getFinalX() - overScroller.getCurrX()) + i8, (overScroller.getFinalY() - overScroller.getCurrY()) + i5, true);
            } else {
                a aVar = this.D;
                if (aVar == null) {
                    Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
                } else if (!this.f9040O) {
                    int[] iArr = this.f9035L0;
                    iArr[0] = 0;
                    iArr[1] = 0;
                    boolean zP = aVar.p();
                    boolean zQ = this.D.q();
                    int i9 = zQ ? (zP ? 1 : 0) | 2 : zP ? 1 : 0;
                    float y8 = motionEvent.getY();
                    float x8 = motionEvent.getX();
                    int iE0 = i8 - e0(i8, y8);
                    int iF0 = i5 - f0(i5, x8);
                    s0(i9, 1);
                    if (u(zP ? iE0 : 0, zQ ? iF0 : 0, 1, this.f9035L0, this.f9032J0)) {
                        iE0 -= iArr[0];
                        iF0 -= iArr[1];
                    }
                    i0(zP ? iE0 : 0, zQ ? iF0 : 0, motionEvent, 1);
                    B b8 = this.f9083w0;
                    if (b8 != null && (iE0 != 0 || iF0 != 0)) {
                        b8.a(this, iE0, iF0);
                    }
                    v0(1);
                }
            }
            if (i != 0 && !z8) {
                this.f9051T0.a(motionEvent, i);
            }
        }
        return false;
    }

    @Override // android.view.ViewGroup
    public final boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        boolean z8;
        boolean z9;
        if (!this.f9040O) {
            this.f9029I = null;
            if (E(motionEvent)) {
                VelocityTracker velocityTracker = this.f9064j0;
                if (velocityTracker != null) {
                    velocityTracker.clear();
                }
                v0(0);
                d0();
                setScrollState(0);
                return true;
            }
            a aVar = this.D;
            if (aVar != null) {
                boolean zP = aVar.p();
                boolean zQ = this.D.q();
                if (this.f9064j0 == null) {
                    this.f9064j0 = VelocityTracker.obtain();
                }
                this.f9064j0.addMovement(motionEvent);
                int actionMasked = motionEvent.getActionMasked();
                int actionIndex = motionEvent.getActionIndex();
                if (actionMasked == 0) {
                    if (this.f9042P) {
                        this.f9042P = false;
                    }
                    this.f9063i0 = motionEvent.getPointerId(0);
                    int x8 = (int) (motionEvent.getX() + 0.5f);
                    this.f9067m0 = x8;
                    this.f9065k0 = x8;
                    int y8 = (int) (motionEvent.getY() + 0.5f);
                    this.f9068n0 = y8;
                    this.f9066l0 = y8;
                    EdgeEffect edgeEffect = this.f9057c0;
                    if (edgeEffect == null || g.t(edgeEffect) == 0.0f || canScrollHorizontally(-1)) {
                        z8 = false;
                    } else {
                        g.C(this.f9057c0, 0.0f, 1.0f - (motionEvent.getY() / getHeight()));
                        z8 = true;
                    }
                    EdgeEffect edgeEffect2 = this.f9059e0;
                    if (edgeEffect2 != null && g.t(edgeEffect2) != 0.0f && !canScrollHorizontally(1)) {
                        g.C(this.f9059e0, 0.0f, motionEvent.getY() / getHeight());
                        z8 = true;
                    }
                    EdgeEffect edgeEffect3 = this.f9058d0;
                    if (edgeEffect3 != null && g.t(edgeEffect3) != 0.0f && !canScrollVertically(-1)) {
                        g.C(this.f9058d0, 0.0f, motionEvent.getX() / getWidth());
                        z8 = true;
                    }
                    EdgeEffect edgeEffect4 = this.f9060f0;
                    if (edgeEffect4 != null && g.t(edgeEffect4) != 0.0f && !canScrollVertically(1)) {
                        g.C(this.f9060f0, 0.0f, 1.0f - (motionEvent.getX() / getWidth()));
                        z8 = true;
                    }
                    if (z8 || this.f9062h0 == 2) {
                        getParent().requestDisallowInterceptTouchEvent(true);
                        setScrollState(1);
                        v0(1);
                    }
                    int[] iArr = this.K0;
                    iArr[1] = 0;
                    iArr[0] = 0;
                    t0(0);
                } else if (actionMasked == 1) {
                    this.f9064j0.clear();
                    v0(0);
                } else if (actionMasked == 2) {
                    int iFindPointerIndex = motionEvent.findPointerIndex(this.f9063i0);
                    if (iFindPointerIndex < 0) {
                        Log.e("RecyclerView", "Error processing scroll; pointer index for id " + this.f9063i0 + " not found. Did any MotionEvents get skipped?");
                        return false;
                    }
                    int x9 = (int) (motionEvent.getX(iFindPointerIndex) + 0.5f);
                    int y9 = (int) (motionEvent.getY(iFindPointerIndex) + 0.5f);
                    if (this.f9062h0 != 1) {
                        int i = x9 - this.f9065k0;
                        int i5 = y9 - this.f9066l0;
                        if (!zP || Math.abs(i) <= this.f9069o0) {
                            z9 = false;
                        } else {
                            this.f9067m0 = x9;
                            z9 = true;
                        }
                        if (zQ && Math.abs(i5) > this.f9069o0) {
                            this.f9068n0 = y9;
                            z9 = true;
                        }
                        if (z9) {
                            setScrollState(1);
                        }
                    }
                } else if (actionMasked == 3) {
                    VelocityTracker velocityTracker2 = this.f9064j0;
                    if (velocityTracker2 != null) {
                        velocityTracker2.clear();
                    }
                    v0(0);
                    d0();
                    setScrollState(0);
                } else if (actionMasked == 5) {
                    this.f9063i0 = motionEvent.getPointerId(actionIndex);
                    int x10 = (int) (motionEvent.getX(actionIndex) + 0.5f);
                    this.f9067m0 = x10;
                    this.f9065k0 = x10;
                    int y10 = (int) (motionEvent.getY(actionIndex) + 0.5f);
                    this.f9068n0 = y10;
                    this.f9066l0 = y10;
                } else if (actionMasked == 6) {
                    X(motionEvent);
                }
                if (this.f9062h0 == 1) {
                    return true;
                }
            }
        }
        return false;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onLayout(boolean z8, int i, int i5, int i8, int i9) {
        Trace.beginSection("RV OnLayout");
        r();
        Trace.endSection();
        this.f9034L = true;
    }

    @Override // android.view.View
    public void onMeasure(int i, int i5) {
        a aVar = this.D;
        if (aVar == null) {
            p(i, i5);
            return;
        }
        boolean zY = aVar.Y();
        i0 i0Var = this.f9074s;
        boolean z8 = false;
        p0 p0Var = this.f9087y0;
        if (zY) {
            int mode = View.MeasureSpec.getMode(i);
            int mode2 = View.MeasureSpec.getMode(i5);
            this.D.y0(i0Var, p0Var, i, i5);
            if (mode == 1073741824 && mode2 == 1073741824) {
                z8 = true;
            }
            this.f9041O0 = z8;
            if (z8 || this.f9019C == null) {
                return;
            }
            if (p0Var.f4617d == 1) {
                s();
            }
            this.D.S0(i, i5);
            p0Var.i = true;
            t();
            this.D.U0(i, i5);
            if (this.D.X0()) {
                this.D.S0(View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), 1073741824));
                p0Var.i = true;
                t();
                this.D.U0(i, i5);
            }
            this.f9043P0 = getMeasuredWidth();
            this.f9045Q0 = getMeasuredHeight();
            return;
        }
        if (this.f9033K) {
            this.D.y0(i0Var, p0Var, i, i5);
            return;
        }
        if (this.f9046R) {
            r0();
            V();
            a0();
            W(true);
            if (p0Var.f4623k) {
                p0Var.f4620g = true;
            } else {
                this.f9078u.e();
                p0Var.f4620g = false;
            }
            this.f9046R = false;
            u0(false);
        } else if (p0Var.f4623k) {
            setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight());
            return;
        }
        T t6 = this.f9019C;
        if (t6 != null) {
            p0Var.f4618e = t6.a();
        } else {
            p0Var.f4618e = 0;
        }
        r0();
        this.D.y0(i0Var, p0Var, i, i5);
        u0(false);
        p0Var.f4620g = false;
    }

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

    @Override // android.view.View
    public final void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof m0)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        m0 m0Var = (m0) parcelable;
        this.f9076t = m0Var;
        super.onRestoreInstanceState(m0Var.f6203q);
        requestLayout();
    }

    @Override // android.view.View
    public final Parcelable onSaveInstanceState() {
        m0 m0Var = new m0(super.onSaveInstanceState());
        m0 m0Var2 = this.f9076t;
        if (m0Var2 != null) {
            m0Var.f4588s = m0Var2.f4588s;
            return m0Var;
        }
        a aVar = this.D;
        if (aVar != null) {
            m0Var.f4588s = aVar.B0();
            return m0Var;
        }
        m0Var.f4588s = null;
        return m0Var;
    }

    @Override // android.view.View
    public void onSizeChanged(int i, int i5, int i8, int i9) {
        super.onSizeChanged(i, i5, i8, i9);
        if (i == i8 && i5 == i9) {
            return;
        }
        this.f9060f0 = null;
        this.f9058d0 = null;
        this.f9059e0 = null;
        this.f9057c0 = null;
    }

    /* JADX WARN: Removed duplicated region for block: B:101:0x020b A[PHI: r1
      0x020b: PHI (r1v50 int) = (r1v34 int), (r1v54 int) binds: [B:95:0x01f4, B:99:0x0207] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:103:0x020e  */
    /* JADX WARN: Removed duplicated region for block: B:109:0x0224  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean onTouchEvent(MotionEvent motionEvent) {
        boolean zE;
        boolean z8;
        if (!this.f9040O && !this.f9042P) {
            C0223y c0223y = this.f9029I;
            if (c0223y == null) {
                zE = motionEvent.getAction() == 0 ? false : E(motionEvent);
            } else {
                if (c0223y.f4719v != 0) {
                    if (motionEvent.getAction() == 0) {
                        boolean zE2 = c0223y.e(motionEvent.getX(), motionEvent.getY());
                        boolean zD = c0223y.d(motionEvent.getX(), motionEvent.getY());
                        if (zE2 || zD) {
                            if (zD) {
                                c0223y.f4720w = 1;
                                c0223y.f4713p = (int) motionEvent.getX();
                            } else if (zE2) {
                                c0223y.f4720w = 2;
                                c0223y.f4710m = (int) motionEvent.getY();
                            }
                            c0223y.g(2);
                        }
                    } else if (motionEvent.getAction() == 1 && c0223y.f4719v == 2) {
                        c0223y.f4710m = 0.0f;
                        c0223y.f4713p = 0.0f;
                        c0223y.g(1);
                        c0223y.f4720w = 0;
                    } else if (motionEvent.getAction() == 2 && c0223y.f4719v == 2) {
                        c0223y.h();
                        int i = c0223y.f4720w;
                        int i5 = c0223y.f4700b;
                        if (i == 1) {
                            float x8 = motionEvent.getX();
                            int[] iArr = c0223y.f4722y;
                            iArr[0] = i5;
                            int i8 = c0223y.f4714q - i5;
                            iArr[1] = i8;
                            float fMax = Math.max(i5, Math.min(i8, x8));
                            if (Math.abs(c0223y.f4712o - fMax) >= 2.0f) {
                                int iF = C0223y.f(c0223y.f4713p, fMax, iArr, c0223y.f4716s.computeHorizontalScrollRange(), c0223y.f4716s.computeHorizontalScrollOffset(), c0223y.f4714q);
                                if (iF != 0) {
                                    c0223y.f4716s.scrollBy(iF, 0);
                                }
                                c0223y.f4713p = fMax;
                            }
                        }
                        if (c0223y.f4720w == 2) {
                            float y8 = motionEvent.getY();
                            int[] iArr2 = c0223y.f4721x;
                            iArr2[0] = i5;
                            int i9 = c0223y.f4715r - i5;
                            iArr2[1] = i9;
                            float fMax2 = Math.max(i5, Math.min(i9, y8));
                            if (Math.abs(c0223y.f4709l - fMax2) >= 2.0f) {
                                int iF2 = C0223y.f(c0223y.f4710m, fMax2, iArr2, c0223y.f4716s.computeVerticalScrollRange(), c0223y.f4716s.computeVerticalScrollOffset(), c0223y.f4715r);
                                if (iF2 != 0) {
                                    c0223y.f4716s.scrollBy(0, iF2);
                                }
                                c0223y.f4710m = fMax2;
                            }
                        }
                    }
                }
                int action = motionEvent.getAction();
                if (action == 3 || action == 1) {
                    this.f9029I = null;
                }
                zE = true;
            }
            if (zE) {
                VelocityTracker velocityTracker = this.f9064j0;
                if (velocityTracker != null) {
                    velocityTracker.clear();
                }
                v0(0);
                d0();
                setScrollState(0);
                return true;
            }
            a aVar = this.D;
            if (aVar != null) {
                boolean zP = aVar.p();
                boolean zQ = this.D.q();
                if (this.f9064j0 == null) {
                    this.f9064j0 = VelocityTracker.obtain();
                }
                int actionMasked = motionEvent.getActionMasked();
                int actionIndex = motionEvent.getActionIndex();
                int[] iArr3 = this.K0;
                if (actionMasked == 0) {
                    iArr3[1] = 0;
                    iArr3[0] = 0;
                }
                MotionEvent motionEventObtain = MotionEvent.obtain(motionEvent);
                motionEventObtain.offsetLocation(iArr3[0], iArr3[1]);
                if (actionMasked == 0) {
                    this.f9063i0 = motionEvent.getPointerId(0);
                    int x9 = (int) (motionEvent.getX() + 0.5f);
                    this.f9067m0 = x9;
                    this.f9065k0 = x9;
                    int y9 = (int) (motionEvent.getY() + 0.5f);
                    this.f9068n0 = y9;
                    this.f9066l0 = y9;
                    t0(0);
                } else {
                    if (actionMasked == 1) {
                        this.f9064j0.addMovement(motionEventObtain);
                        VelocityTracker velocityTracker2 = this.f9064j0;
                        int i10 = this.f9073r0;
                        velocityTracker2.computeCurrentVelocity(1000, i10);
                        float f3 = zP ? -this.f9064j0.getXVelocity(this.f9063i0) : 0.0f;
                        float f7 = zQ ? -this.f9064j0.getYVelocity(this.f9063i0) : 0.0f;
                        if ((f3 == 0.0f && f7 == 0.0f) || !J((int) f3, (int) f7, this.q0, i10)) {
                            setScrollState(0);
                        }
                        VelocityTracker velocityTracker3 = this.f9064j0;
                        if (velocityTracker3 != null) {
                            velocityTracker3.clear();
                        }
                        v0(0);
                        d0();
                        motionEventObtain.recycle();
                        return true;
                    }
                    if (actionMasked == 2) {
                        int iFindPointerIndex = motionEvent.findPointerIndex(this.f9063i0);
                        if (iFindPointerIndex < 0) {
                            Log.e("RecyclerView", "Error processing scroll; pointer index for id " + this.f9063i0 + " not found. Did any MotionEvents get skipped?");
                            return false;
                        }
                        int x10 = (int) (motionEvent.getX(iFindPointerIndex) + 0.5f);
                        int y10 = (int) (motionEvent.getY(iFindPointerIndex) + 0.5f);
                        int iMax = this.f9067m0 - x10;
                        int iMax2 = this.f9068n0 - y10;
                        if (this.f9062h0 != 1) {
                            if (zP) {
                                iMax = iMax > 0 ? Math.max(0, iMax - this.f9069o0) : Math.min(0, iMax + this.f9069o0);
                                if (iMax != 0) {
                                    z8 = true;
                                }
                                if (zQ) {
                                }
                                if (z8) {
                                }
                            } else {
                                z8 = false;
                                if (zQ) {
                                    iMax2 = iMax2 > 0 ? Math.max(0, iMax2 - this.f9069o0) : Math.min(0, iMax2 + this.f9069o0);
                                    if (iMax2 != 0) {
                                        z8 = true;
                                    }
                                }
                                if (z8) {
                                    setScrollState(1);
                                }
                            }
                            motionEventObtain.recycle();
                            return true;
                        }
                        if (this.f9062h0 == 1) {
                            int[] iArr4 = this.f9035L0;
                            iArr4[0] = 0;
                            iArr4[1] = 0;
                            int iE0 = iMax - e0(iMax, motionEvent.getY());
                            int iF0 = iMax2 - f0(iMax2, motionEvent.getX());
                            boolean zU = u(zP ? iE0 : 0, zQ ? iF0 : 0, 0, this.f9035L0, this.f9032J0);
                            int[] iArr5 = this.f9032J0;
                            if (zU) {
                                iE0 -= iArr4[0];
                                iF0 -= iArr4[1];
                                iArr3[0] = iArr3[0] + iArr5[0];
                                iArr3[1] = iArr3[1] + iArr5[1];
                                getParent().requestDisallowInterceptTouchEvent(true);
                            }
                            int i11 = iE0;
                            int i12 = iF0;
                            this.f9067m0 = x10 - iArr5[0];
                            this.f9068n0 = y10 - iArr5[1];
                            if (i0(zP ? i11 : 0, zQ ? i12 : 0, motionEvent, 0)) {
                                getParent().requestDisallowInterceptTouchEvent(true);
                            }
                            B b8 = this.f9083w0;
                            if (b8 != null && (i11 != 0 || i12 != 0)) {
                                b8.a(this, i11, i12);
                            }
                        }
                    } else if (actionMasked == 3) {
                        VelocityTracker velocityTracker4 = this.f9064j0;
                        if (velocityTracker4 != null) {
                            velocityTracker4.clear();
                        }
                        v0(0);
                        d0();
                        setScrollState(0);
                    } else if (actionMasked == 5) {
                        this.f9063i0 = motionEvent.getPointerId(actionIndex);
                        int x11 = (int) (motionEvent.getX(actionIndex) + 0.5f);
                        this.f9067m0 = x11;
                        this.f9065k0 = x11;
                        int y11 = (int) (motionEvent.getY(actionIndex) + 0.5f);
                        this.f9068n0 = y11;
                        this.f9066l0 = y11;
                    } else if (actionMasked == 6) {
                        X(motionEvent);
                    }
                }
                this.f9064j0.addMovement(motionEventObtain);
                motionEventObtain.recycle();
                return true;
            }
        }
        return false;
    }

    public final void p(int i, int i5) {
        int paddingRight = getPaddingRight() + getPaddingLeft();
        Field field = J.f4065a;
        setMeasuredDimension(a.s(i, paddingRight, getMinimumWidth()), a.s(i5, getPaddingBottom() + getPaddingTop(), getMinimumHeight()));
    }

    public final void p0(int i, int i5, boolean z8) {
        a aVar = this.D;
        if (aVar == null) {
            Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.f9040O) {
            return;
        }
        if (!aVar.p()) {
            i = 0;
        }
        if (!this.D.q()) {
            i5 = 0;
        }
        if (i == 0 && i5 == 0) {
            return;
        }
        if (z8) {
            int i8 = i != 0 ? 1 : 0;
            if (i5 != 0) {
                i8 |= 2;
            }
            s0(i8, 1);
        }
        this.f9081v0.c(i, i5, Integer.MIN_VALUE, null);
    }

    public final void q(View view) {
        t0 t0VarN = N(view);
        T t6 = this.f9019C;
        if (t6 != null && t0VarN != null) {
            t6.k(t0VarN);
        }
        ArrayList arrayList = this.f9050T;
        if (arrayList != null) {
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                ((n) this.f9050T.get(size)).getClass();
                P6.g.e(view, "view");
            }
        }
    }

    public void q0(int i) {
        if (this.f9040O) {
            return;
        }
        a aVar = this.D;
        if (aVar == null) {
            Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
        } else {
            aVar.Z0(this, this.f9087y0, i);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:166:0x034c  */
    /* JADX WARN: Removed duplicated region for block: B:193:0x03ac  */
    /* JADX WARN: Type inference failed for: r3v12 */
    /* JADX WARN: Type inference failed for: r3v19 */
    /* JADX WARN: Type inference failed for: r3v20, types: [int] */
    /* JADX WARN: Type inference failed for: r3v23 */
    /* 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 failed for: r3v29 */
    /* 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 r() {
        boolean z8;
        t0 t0Var;
        View viewFindViewById;
        boolean z9;
        A7.a aVar;
        ?? r32;
        RecyclerView recyclerView;
        boolean zG;
        boolean z10;
        if (this.f9019C == null) {
            Log.w("RecyclerView", "No adapter attached; skipping layout");
            return;
        }
        if (this.D == null) {
            Log.e("RecyclerView", "No layout manager attached; skipping layout");
            return;
        }
        p0 p0Var = this.f9087y0;
        boolean z11 = false;
        p0Var.i = false;
        boolean z12 = true;
        boolean z13 = this.f9041O0 && !(this.f9043P0 == getWidth() && this.f9045Q0 == getHeight());
        this.f9043P0 = 0;
        this.f9045Q0 = 0;
        this.f9041O0 = false;
        if (p0Var.f4617d == 1) {
            s();
            this.D.R0(this);
            t();
        } else {
            C0198b c0198b = this.f9078u;
            if ((((ArrayList) c0198b.f4507d).isEmpty() || ((ArrayList) c0198b.f4506c).isEmpty()) && !z13 && this.D.D == getWidth() && this.D.f9113E == getHeight()) {
                this.D.R0(this);
            } else {
                this.D.R0(this);
                t();
            }
        }
        p0Var.a(4);
        r0();
        V();
        p0Var.f4617d = 1;
        boolean z14 = p0Var.f4622j;
        i0 i0Var = this.f9074s;
        R0 r02 = this.f9082w;
        if (z14) {
            int i = this.f9080v.i() - 1;
            while (i >= 0) {
                t0 t0VarN = N(this.f9080v.h(i));
                if (t0VarN.q()) {
                    z10 = z12;
                } else {
                    long jL = L(t0VarN);
                    this.f9061g0.getClass();
                    A7.a aVar2 = new A7.a();
                    aVar2.d(t0VarN);
                    t0 t0Var2 = (t0) ((q.g) r02.f11693s).f(jL);
                    if (t0Var2 == null || t0Var2.q()) {
                        z10 = z12;
                        r02.F(t0VarN, aVar2);
                    } else {
                        i iVar = (i) r02.f11692r;
                        z10 = z12;
                        D0 d02 = (D0) iVar.get(t0Var2);
                        boolean z15 = (d02 == null || (d02.f4439a & 1) == 0) ? false : z10;
                        D0 d03 = (D0) iVar.get(t0VarN);
                        boolean z16 = (d03 == null || (d03.f4439a & 1) == 0) ? false : z10;
                        if (z15 && t0Var2 == t0VarN) {
                            r02.F(t0VarN, aVar2);
                        } else {
                            A7.a aVarY = r02.Y(t0Var2, 4);
                            r02.F(t0VarN, aVar2);
                            A7.a aVarY2 = r02.Y(t0VarN, 8);
                            if (aVarY == null) {
                                int i5 = this.f9080v.i();
                                for (int i8 = 0; i8 < i5; i8++) {
                                    t0 t0VarN2 = N(this.f9080v.h(i8));
                                    if (t0VarN2 != t0VarN && L(t0VarN2) == jL) {
                                        T t6 = this.f9019C;
                                        if (t6 == null || !t6.f4491b) {
                                            StringBuilder sb = new StringBuilder("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:");
                                            sb.append(t0VarN2);
                                            sb.append(" \n View Holder 2:");
                                            sb.append(t0VarN);
                                            throw new IllegalStateException(I1.a.l(this, sb));
                                        }
                                        StringBuilder sb2 = new StringBuilder("Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.\n ViewHolder 1:");
                                        sb2.append(t0VarN2);
                                        sb2.append(" \n View Holder 2:");
                                        sb2.append(t0VarN);
                                        throw new IllegalStateException(I1.a.l(this, sb2));
                                    }
                                }
                                Log.e("RecyclerView", "Problem while matching changed view holders with the newones. The pre-layout information for the change holder " + t0Var2 + " cannot be found but it is necessary for " + t0VarN + B());
                            } else {
                                t0Var2.p(false);
                                if (z15) {
                                    g(t0Var2);
                                }
                                if (t0Var2 != t0VarN) {
                                    if (z16) {
                                        g(t0VarN);
                                    }
                                    t0Var2.f4661h = t0VarN;
                                    g(t0Var2);
                                    i0Var.m(t0Var2);
                                    t0VarN.p(false);
                                    t0VarN.i = t0Var2;
                                }
                                if (this.f9061g0.a(t0Var2, t0VarN, aVarY, aVarY2)) {
                                    Z();
                                }
                            }
                        }
                    }
                }
                i--;
                z12 = z10;
            }
            z8 = z12;
            i iVar2 = (i) r02.f11692r;
            int i9 = iVar2.f16190s - 1;
            while (i9 >= 0) {
                t0 t0Var3 = (t0) iVar2.e(i9);
                D0 d04 = (D0) iVar2.f(i9);
                int i10 = d04.f4439a;
                int i11 = i10 & 3;
                S s8 = this.f9049S0;
                if (i11 == 3) {
                    RecyclerView recyclerView2 = s8.f4489q;
                    recyclerView2.D.I0(t0Var3.f4654a, recyclerView2.f9074s);
                    r32 = z11;
                } else if ((i10 & 1) != 0) {
                    A7.a aVar3 = d04.f4440b;
                    if (aVar3 == null) {
                        RecyclerView recyclerView3 = s8.f4489q;
                        recyclerView3.D.I0(t0Var3.f4654a, recyclerView3.f9074s);
                        r32 = z11;
                    } else {
                        s8.h(t0Var3, aVar3, d04.f4441c);
                        r32 = z11;
                    }
                } else if ((i10 & 14) == 14) {
                    s8.g(t0Var3, d04.f4440b, d04.f4441c);
                    r32 = z11;
                } else if ((i10 & 12) == 12) {
                    A7.a aVar4 = d04.f4440b;
                    A7.a aVar5 = d04.f4441c;
                    s8.getClass();
                    t0Var3.p(z11);
                    RecyclerView recyclerView4 = s8.f4489q;
                    if (!recyclerView4.f9052U) {
                        C0214o c0214o = (C0214o) recyclerView4.f9061g0;
                        c0214o.getClass();
                        int i12 = aVar4.f460a;
                        int i13 = aVar5.f460a;
                        if (i12 == i13 && aVar4.f461b == aVar5.f461b) {
                            c0214o.c(t0Var3);
                            recyclerView = recyclerView4;
                            zG = false;
                        } else {
                            recyclerView = recyclerView4;
                            zG = c0214o.g(t0Var3, i12, aVar4.f461b, i13, aVar5.f461b);
                        }
                        if (zG) {
                            recyclerView.Z();
                        }
                    } else if (recyclerView4.f9061g0.a(t0Var3, t0Var3, aVar4, aVar5)) {
                        recyclerView4.Z();
                    }
                    r32 = 0;
                } else {
                    if ((i10 & 4) != 0) {
                        aVar = null;
                        s8.h(t0Var3, d04.f4440b, null);
                    } else {
                        aVar = null;
                        if ((i10 & 8) != 0) {
                            s8.g(t0Var3, d04.f4440b, d04.f4441c);
                        }
                    }
                    r32 = 0;
                    d04.f4439a = r32;
                    d04.f4440b = aVar;
                    d04.f4441c = aVar;
                    D0.f4438d.c(d04);
                    i9--;
                    z11 = false;
                }
                aVar = null;
                d04.f4439a = r32;
                d04.f4440b = aVar;
                d04.f4441c = aVar;
                D0.f4438d.c(d04);
                i9--;
                z11 = false;
            }
        } else {
            z8 = true;
        }
        View view = null;
        this.D.H0(i0Var);
        p0Var.f4615b = p0Var.f4618e;
        this.f9052U = false;
        this.f9053V = false;
        p0Var.f4622j = false;
        p0Var.f4623k = false;
        this.D.f9119v = false;
        ArrayList arrayList = i0Var.f4556b;
        if (arrayList != null) {
            arrayList.clear();
        }
        a aVar6 = this.D;
        if (aVar6.f9110A) {
            aVar6.f9123z = 0;
            aVar6.f9110A = false;
            i0Var.n();
        }
        this.D.x0(p0Var);
        W(z8);
        u0(false);
        ((i) r02.f11692r).clear();
        ((q.g) r02.f11693s).d();
        int[] iArr = this.f9028H0;
        int i14 = iArr[0];
        int i15 = iArr[1];
        F(iArr);
        if ((iArr[0] == i14 && iArr[1] == i15) ? false : true) {
            w(0, 0);
        }
        if (this.f9079u0 && this.f9019C != null && hasFocus() && getDescendantFocusability() != 393216 && (getDescendantFocusability() != 131072 || !isFocused())) {
            if (!isFocused()) {
                if (((ArrayList) this.f9080v.f72u).contains(getFocusedChild())) {
                    long j8 = p0Var.f4625m;
                    if (j8 != -1 && (z9 = this.f9019C.f4491b) && z9) {
                        int iL = this.f9080v.l();
                        int i16 = 0;
                        t0Var = null;
                        while (true) {
                            if (i16 >= iL) {
                                break;
                            }
                            t0 t0VarN3 = N(this.f9080v.k(i16));
                            if (t0VarN3 != null && !t0VarN3.j() && t0VarN3.f4658e == j8) {
                                if (!((ArrayList) this.f9080v.f72u).contains(t0VarN3.f4654a)) {
                                    t0Var = t0VarN3;
                                    break;
                                }
                                t0Var = t0VarN3;
                            }
                            i16++;
                        }
                    } else {
                        t0Var = null;
                    }
                    if (t0Var != null) {
                        ArrayList arrayList2 = (ArrayList) this.f9080v.f72u;
                        View view2 = t0Var.f4654a;
                        if (!arrayList2.contains(view2) && view2.hasFocusable()) {
                            view = view2;
                        } else if (this.f9080v.i() > 0) {
                            int i17 = p0Var.f4624l;
                            int i18 = i17 != -1 ? i17 : 0;
                            int iB = p0Var.b();
                            for (int i19 = i18; i19 < iB; i19++) {
                                t0 t0VarH = H(i19);
                                if (t0VarH == null) {
                                    break;
                                }
                                View view3 = t0VarH.f4654a;
                                if (view3.hasFocusable()) {
                                    view = view3;
                                    break;
                                }
                            }
                            int iMin = Math.min(iB, i18) - 1;
                            while (true) {
                                if (iMin < 0) {
                                    break;
                                }
                                t0 t0VarH2 = H(iMin);
                                if (t0VarH2 == null) {
                                    break;
                                }
                                View view4 = t0VarH2.f4654a;
                                if (view4.hasFocusable()) {
                                    view = view4;
                                    break;
                                }
                                iMin--;
                            }
                        }
                        if (view != null) {
                            int i20 = p0Var.f4626n;
                            if (i20 != -1 && (viewFindViewById = view.findViewById(i20)) != null && viewFindViewById.isFocusable()) {
                                view = viewFindViewById;
                            }
                            view.requestFocus();
                        }
                    }
                }
            }
        }
        p0Var.f4625m = -1L;
        p0Var.f4624l = -1;
        p0Var.f4626n = -1;
    }

    public final void r0() {
        int i = this.f9036M + 1;
        this.f9036M = i;
        if (i != 1 || this.f9040O) {
            return;
        }
        this.f9038N = false;
    }

    @Override // android.view.ViewGroup
    public final void removeDetachedView(View view, boolean z8) {
        t0 t0VarN = N(view);
        if (t0VarN != null) {
            if (t0VarN.l()) {
                t0VarN.f4662j &= -257;
            } else if (!t0VarN.q()) {
                StringBuilder sb = new StringBuilder("Called removeDetachedView with a view which is not flagged as tmp detached.");
                sb.append(t0VarN);
                throw new IllegalArgumentException(I1.a.l(this, sb));
            }
        } else if (f9008U0) {
            StringBuilder sb2 = new StringBuilder("No ViewHolder found for child: ");
            sb2.append(view);
            throw new IllegalArgumentException(I1.a.l(this, sb2));
        }
        view.clearAnimation();
        q(view);
        super.removeDetachedView(view, z8);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final void requestChildFocus(View view, View view2) {
        if (!this.D.z0(this, this.f9087y0, view, view2) && view2 != null) {
            h0(view, view2);
        }
        super.requestChildFocus(view, view2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public final boolean requestChildRectangleOnScreen(View view, Rect rect, boolean z8) {
        return this.D.K0(this, view, rect, z8);
    }

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

    @Override // android.view.View, android.view.ViewParent
    public void requestLayout() {
        if (this.f9036M != 0 || this.f9040O) {
            this.f9038N = true;
        } else {
            super.requestLayout();
        }
    }

    public final void s() {
        D0 d02;
        View viewD;
        p0 p0Var = this.f9087y0;
        p0Var.a(1);
        C(p0Var);
        p0Var.i = false;
        r0();
        R0 r02 = this.f9082w;
        ((i) r02.f11692r).clear();
        q.g gVar = (q.g) r02.f11693s;
        gVar.d();
        V();
        a0();
        t0 t0VarM = null;
        View focusedChild = (this.f9079u0 && hasFocus() && this.f9019C != null) ? getFocusedChild() : null;
        if (focusedChild != null && (viewD = D(focusedChild)) != null) {
            t0VarM = M(viewD);
        }
        if (t0VarM == null) {
            p0Var.f4625m = -1L;
            p0Var.f4624l = -1;
            p0Var.f4626n = -1;
        } else {
            p0Var.f4625m = this.f9019C.f4491b ? t0VarM.f4658e : -1L;
            p0Var.f4624l = this.f9052U ? -1 : t0VarM.j() ? t0VarM.f4657d : t0VarM.c();
            View focusedChild2 = t0VarM.f4654a;
            int id = focusedChild2.getId();
            while (!focusedChild2.isFocused() && (focusedChild2 instanceof ViewGroup) && focusedChild2.hasFocus()) {
                focusedChild2 = ((ViewGroup) focusedChild2).getFocusedChild();
                if (focusedChild2.getId() != -1) {
                    id = focusedChild2.getId();
                }
            }
            p0Var.f4626n = id;
        }
        p0Var.f4621h = p0Var.f4622j && this.f9020C0;
        this.f9020C0 = false;
        this.f9018B0 = false;
        p0Var.f4620g = p0Var.f4623k;
        p0Var.f4618e = this.f9019C.a();
        F(this.f9028H0);
        boolean z8 = p0Var.f4622j;
        i iVar = (i) r02.f11692r;
        if (z8) {
            int i = this.f9080v.i();
            for (int i5 = 0; i5 < i; i5++) {
                t0 t0VarN = N(this.f9080v.h(i5));
                if (!t0VarN.q() && (!t0VarN.h() || this.f9019C.f4491b)) {
                    Z z9 = this.f9061g0;
                    Z.b(t0VarN);
                    t0VarN.e();
                    z9.getClass();
                    A7.a aVar = new A7.a();
                    aVar.d(t0VarN);
                    D0 d0A = (D0) iVar.get(t0VarN);
                    if (d0A == null) {
                        d0A = D0.a();
                        iVar.put(t0VarN, d0A);
                    }
                    d0A.f4440b = aVar;
                    d0A.f4439a |= 4;
                    if (p0Var.f4621h && t0VarN.m() && !t0VarN.j() && !t0VarN.q() && !t0VarN.h()) {
                        gVar.i(L(t0VarN), t0VarN);
                    }
                }
            }
        }
        if (p0Var.f4623k) {
            int iL = this.f9080v.l();
            for (int i8 = 0; i8 < iL; i8++) {
                t0 t0VarN2 = N(this.f9080v.k(i8));
                if (f9008U0 && t0VarN2.f4656c == -1 && !t0VarN2.j()) {
                    throw new IllegalStateException(I1.a.l(this, new StringBuilder("view holder cannot have position -1 unless it is removed")));
                }
                if (!t0VarN2.q() && t0VarN2.f4657d == -1) {
                    t0VarN2.f4657d = t0VarN2.f4656c;
                }
            }
            boolean z10 = p0Var.f4619f;
            p0Var.f4619f = false;
            this.D.w0(this.f9074s, p0Var);
            p0Var.f4619f = z10;
            for (int i9 = 0; i9 < this.f9080v.i(); i9++) {
                t0 t0VarN3 = N(this.f9080v.h(i9));
                if (!t0VarN3.q() && ((d02 = (D0) iVar.get(t0VarN3)) == null || (d02.f4439a & 4) == 0)) {
                    Z.b(t0VarN3);
                    boolean z11 = (t0VarN3.f4662j & 8192) != 0;
                    Z z12 = this.f9061g0;
                    t0VarN3.e();
                    z12.getClass();
                    A7.a aVar2 = new A7.a();
                    aVar2.d(t0VarN3);
                    if (z11) {
                        c0(t0VarN3, aVar2);
                    } else {
                        D0 d0A2 = (D0) iVar.get(t0VarN3);
                        if (d0A2 == null) {
                            d0A2 = D0.a();
                            iVar.put(t0VarN3, d0A2);
                        }
                        d0A2.f4439a |= 2;
                        d0A2.f4440b = aVar2;
                    }
                }
            }
            l();
        } else {
            l();
        }
        W(true);
        u0(false);
        p0Var.f4617d = 2;
    }

    public boolean s0(int i, int i5) {
        return getScrollingChildHelper().g(i, i5);
    }

    @Override // android.view.View
    public final void scrollBy(int i, int i5) {
        a aVar = this.D;
        if (aVar == null) {
            Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.f9040O) {
            return;
        }
        boolean zP = aVar.p();
        boolean zQ = this.D.q();
        if (zP || zQ) {
            if (!zP) {
                i = 0;
            }
            if (!zQ) {
                i5 = 0;
            }
            i0(i, i5, null, 0);
        }
    }

    @Override // android.view.View
    public final void scrollTo(int i, int i5) {
        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 (!R()) {
            super.sendAccessibilityEventUnchecked(accessibilityEvent);
        } else {
            int contentChangeTypes = accessibilityEvent != null ? accessibilityEvent.getContentChangeTypes() : 0;
            this.f9044Q |= contentChangeTypes != 0 ? contentChangeTypes : 0;
        }
    }

    public void setAccessibilityDelegateCompat(v0 v0Var) {
        this.f9025F0 = v0Var;
        J.j(this, v0Var);
    }

    public void setAdapter(T t6) {
        setLayoutFrozen(false);
        l0(t6, false);
        b0(false);
        requestLayout();
    }

    public void setChildDrawingOrderCallback(X x8) {
        if (x8 == this.f9027G0) {
            return;
        }
        this.f9027G0 = x8;
        setChildrenDrawingOrderEnabled(x8 != null);
    }

    @Override // android.view.ViewGroup
    public void setClipToPadding(boolean z8) {
        if (z8 != this.f9084x) {
            this.f9060f0 = null;
            this.f9058d0 = null;
            this.f9059e0 = null;
            this.f9057c0 = null;
        }
        this.f9084x = z8;
        super.setClipToPadding(z8);
        if (this.f9034L) {
            requestLayout();
        }
    }

    public void setEdgeEffectFactory(Y y8) {
        y8.getClass();
        this.f9056b0 = y8;
        this.f9060f0 = null;
        this.f9058d0 = null;
        this.f9059e0 = null;
        this.f9057c0 = null;
    }

    public void setHasFixedSize(boolean z8) {
        this.f9033K = z8;
    }

    public void setItemAnimator(Z z8) {
        Z z9 = this.f9061g0;
        if (z9 != null) {
            z9.e();
            this.f9061g0.f4494a = null;
        }
        this.f9061g0 = z8;
        if (z8 != null) {
            z8.f4494a = this.f9021D0;
        }
    }

    public void setItemViewCacheSize(int i) {
        i0 i0Var = this.f9074s;
        i0Var.f4559e = i;
        i0Var.n();
    }

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

    public void setLayoutManager(a aVar) {
        RecyclerView recyclerView;
        if (aVar == this.D) {
            return;
        }
        w0();
        a aVar2 = this.D;
        i0 i0Var = this.f9074s;
        if (aVar2 != null) {
            Z z8 = this.f9061g0;
            if (z8 != null) {
                z8.e();
            }
            this.D.G0(i0Var);
            this.D.H0(i0Var);
            i0Var.f4555a.clear();
            i0Var.g();
            if (this.f9031J) {
                a aVar3 = this.D;
                aVar3.f9120w = false;
                aVar3.j0(this, i0Var);
            }
            this.D.V0(null);
            this.D = null;
        } else {
            i0Var.f4555a.clear();
            i0Var.g();
        }
        I i = this.f9080v;
        ((C0207h) i.f71t).z();
        ArrayList arrayList = (ArrayList) i.f72u;
        int size = arrayList.size() - 1;
        while (true) {
            recyclerView = ((S) i.f70s).f4489q;
            if (size < 0) {
                break;
            }
            t0 t0VarN = N((View) arrayList.get(size));
            if (t0VarN != null) {
                int i5 = t0VarN.f4668p;
                if (recyclerView.R()) {
                    t0VarN.f4669q = i5;
                    recyclerView.f9037M0.add(t0VarN);
                } else {
                    t0VarN.f4654a.setImportantForAccessibility(i5);
                }
                t0VarN.f4668p = 0;
            }
            arrayList.remove(size);
            size--;
        }
        int childCount = recyclerView.getChildCount();
        for (int i8 = 0; i8 < childCount; i8++) {
            View childAt = recyclerView.getChildAt(i8);
            recyclerView.q(childAt);
            childAt.clearAnimation();
        }
        recyclerView.removeAllViews();
        this.D = aVar;
        if (aVar != null) {
            if (aVar.f9115r != null) {
                StringBuilder sb = new StringBuilder("LayoutManager ");
                sb.append(aVar);
                sb.append(" is already attached to a RecyclerView:");
                throw new IllegalArgumentException(I1.a.l(aVar.f9115r, sb));
            }
            aVar.V0(this);
            if (this.f9031J) {
                a aVar4 = this.D;
                aVar4.f9120w = true;
                aVar4.i0(this);
            }
        }
        i0Var.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 z8) {
        C0180j scrollingChildHelper = getScrollingChildHelper();
        if (scrollingChildHelper.f4122d) {
            Field field = J.f4065a;
            M.B.m(scrollingChildHelper.f4121c);
        }
        scrollingChildHelper.f4122d = z8;
    }

    public void setOnFlingListener(e0 e0Var) {
        this.f9070p0 = e0Var;
    }

    @Deprecated
    public void setOnScrollListener(f0 f0Var) {
        this.f9089z0 = f0Var;
    }

    public void setPreserveFocusAfterLayout(boolean z8) {
        this.f9079u0 = z8;
    }

    public void setRecycledViewPool(h0 h0Var) {
        i0 i0Var = this.f9074s;
        RecyclerView recyclerView = i0Var.f4562h;
        i0Var.f(recyclerView.f9019C, false);
        if (i0Var.f4561g != null) {
            r2.f4550b--;
        }
        i0Var.f4561g = h0Var;
        if (h0Var != null && recyclerView.getAdapter() != null) {
            i0Var.f4561g.f4550b++;
        }
        i0Var.e();
    }

    @Deprecated
    public void setRecyclerListener(j0 j0Var) {
        this.f9022E = j0Var;
    }

    public void setScrollState(int i) {
        H h8;
        if (i == this.f9062h0) {
            return;
        }
        if (f9009V0) {
            StringBuilder sbO = AbstractC0844a.o(i, "setting scroll state to ", " from ");
            sbO.append(this.f9062h0);
            Log.d("RecyclerView", sbO.toString(), new Exception());
        }
        this.f9062h0 = i;
        if (i != 2) {
            s0 s0Var = this.f9081v0;
            s0Var.f4648w.removeCallbacks(s0Var);
            s0Var.f4644s.abortAnimation();
            a aVar = this.D;
            if (aVar != null && (h8 = aVar.f9118u) != null) {
                h8.j();
            }
        }
        a aVar2 = this.D;
        if (aVar2 != null) {
            aVar2.C0(i);
        }
        Y(i);
        f0 f0Var = this.f9089z0;
        if (f0Var != null) {
            f0Var.a(this, i);
        }
        ArrayList arrayList = this.f9016A0;
        if (arrayList != null) {
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                ((f0) this.f9016A0.get(size)).a(this, i);
            }
        }
    }

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

    public void setViewCacheExtension(r0 r0Var) {
        this.f9074s.getClass();
    }

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

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

    @Override // android.view.ViewGroup
    public final void suppressLayout(boolean z8) {
        if (z8 != this.f9040O) {
            j("Do not suppressLayout in layout or scroll");
            if (z8) {
                long jUptimeMillis = SystemClock.uptimeMillis();
                onTouchEvent(MotionEvent.obtain(jUptimeMillis, jUptimeMillis, 3, 0.0f, 0.0f, 0));
                this.f9040O = true;
                this.f9042P = true;
                w0();
                return;
            }
            this.f9040O = false;
            if (this.f9038N && this.D != null && this.f9019C != null) {
                requestLayout();
            }
            this.f9038N = false;
        }
    }

    public final void t() {
        r0();
        V();
        p0 p0Var = this.f9087y0;
        p0Var.a(6);
        this.f9078u.e();
        p0Var.f4618e = this.f9019C.a();
        p0Var.f4616c = 0;
        if (this.f9076t != null) {
            T t6 = this.f9019C;
            int iC = AbstractC1563h.c(t6.f4492c);
            if (iC == 1 ? t6.a() > 0 : iC != 2) {
                Parcelable parcelable = this.f9076t.f4588s;
                if (parcelable != null) {
                    this.D.A0(parcelable);
                }
                this.f9076t = null;
            }
        }
        p0Var.f4620g = false;
        this.D.w0(this.f9074s, p0Var);
        p0Var.f4619f = false;
        p0Var.f4622j = p0Var.f4622j && this.f9061g0 != null;
        p0Var.f4617d = 4;
        W(true);
        u0(false);
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final void t0(int i) {
        boolean zP = this.D.p();
        int i5 = zP;
        if (this.D.q()) {
            i5 = (zP ? 1 : 0) | 2;
        }
        s0(i5, i);
    }

    public final boolean u(int i, int i5, int i8, int[] iArr, int[] iArr2) {
        return getScrollingChildHelper().c(i, i5, i8, iArr, iArr2);
    }

    public final void u0(boolean z8) {
        if (this.f9036M < 1) {
            if (f9008U0) {
                throw new IllegalStateException(I1.a.l(this, new StringBuilder("stopInterceptRequestLayout was called more times than startInterceptRequestLayout.")));
            }
            this.f9036M = 1;
        }
        if (!z8 && !this.f9040O) {
            this.f9038N = false;
        }
        if (this.f9036M == 1) {
            if (z8 && this.f9038N && !this.f9040O && this.D != null && this.f9019C != null) {
                r();
            }
            if (!this.f9040O) {
                this.f9038N = false;
            }
        }
        this.f9036M--;
    }

    public final void v(int i, int i5, int i8, int i9, int[] iArr, int i10, int[] iArr2) {
        getScrollingChildHelper().d(i, i5, i8, i9, iArr, i10, iArr2);
    }

    public final void v0(int i) {
        getScrollingChildHelper().h(i);
    }

    public final void w(int i, int i5) {
        this.f9055a0++;
        int scrollX = getScrollX();
        int scrollY = getScrollY();
        onScrollChanged(scrollX, scrollY, scrollX - i, scrollY - i5);
        f0 f0Var = this.f9089z0;
        if (f0Var != null) {
            f0Var.b(this, i, i5);
        }
        ArrayList arrayList = this.f9016A0;
        if (arrayList != null) {
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                ((f0) this.f9016A0.get(size)).b(this, i, i5);
            }
        }
        this.f9055a0--;
    }

    public final void w0() {
        H h8;
        setScrollState(0);
        s0 s0Var = this.f9081v0;
        s0Var.f4648w.removeCallbacks(s0Var);
        s0Var.f4644s.abortAnimation();
        a aVar = this.D;
        if (aVar == null || (h8 = aVar.f9118u) == null) {
            return;
        }
        h8.j();
    }

    public final void x() {
        if (this.f9060f0 != null) {
            return;
        }
        ((q0) this.f9056b0).getClass();
        EdgeEffect edgeEffect = new EdgeEffect(getContext());
        this.f9060f0 = edgeEffect;
        if (this.f9084x) {
            edgeEffect.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffect.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    public final void y() {
        if (this.f9057c0 != null) {
            return;
        }
        ((q0) this.f9056b0).getClass();
        EdgeEffect edgeEffect = new EdgeEffect(getContext());
        this.f9057c0 = edgeEffect;
        if (this.f9084x) {
            edgeEffect.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
        } else {
            edgeEffect.setSize(getMeasuredHeight(), getMeasuredWidth());
        }
    }

    public final void z() {
        if (this.f9059e0 != null) {
            return;
        }
        ((q0) this.f9056b0).getClass();
        EdgeEffect edgeEffect = new EdgeEffect(getContext());
        this.f9059e0 = edgeEffect;
        if (this.f9084x) {
            edgeEffect.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
        } else {
            edgeEffect.setSize(getMeasuredHeight(), getMeasuredWidth());
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    /* JADX WARN: Multi-variable type inference failed */
    public RecyclerView(Context context, AttributeSet attributeSet, int i) throws NoSuchMethodException {
        float fA;
        char c3;
        int i5;
        char c8;
        char c9;
        int i8;
        TypedArray typedArray;
        Object[] objArr;
        Constructor constructor;
        super(context, attributeSet, i);
        int i9 = 1;
        int i10 = 0;
        this.f9072r = new k0(this, i10);
        this.f9074s = new i0(this);
        this.f9082w = new R0(27);
        this.f9086y = new P(this, i10);
        this.f9088z = new Rect();
        this.f9015A = new Rect();
        this.f9017B = new RectF();
        this.f9024F = new ArrayList();
        this.f9026G = new ArrayList();
        this.H = new ArrayList();
        this.f9036M = 0;
        this.f9052U = false;
        this.f9053V = false;
        this.f9054W = 0;
        this.f9055a0 = 0;
        this.f9056b0 = f9014c1;
        C0214o c0214o = new C0214o();
        c0214o.f4494a = null;
        c0214o.f4495b = new ArrayList();
        c0214o.f4496c = 120L;
        c0214o.f4497d = 120L;
        c0214o.f4498e = 250L;
        c0214o.f4499f = 250L;
        c0214o.f4602g = true;
        c0214o.f4603h = new ArrayList();
        c0214o.i = new ArrayList();
        c0214o.f4604j = new ArrayList();
        c0214o.f4605k = new ArrayList();
        c0214o.f4606l = new ArrayList();
        c0214o.f4607m = new ArrayList();
        c0214o.f4608n = new ArrayList();
        c0214o.f4609o = new ArrayList();
        c0214o.f4610p = new ArrayList();
        c0214o.f4611q = new ArrayList();
        c0214o.f4612r = new ArrayList();
        this.f9061g0 = c0214o;
        this.f9062h0 = 0;
        this.f9063i0 = -1;
        this.f9075s0 = Float.MIN_VALUE;
        this.f9077t0 = Float.MIN_VALUE;
        this.f9079u0 = true;
        this.f9081v0 = new s0(this);
        this.f9085x0 = f9012Z0 ? new C0224z() : null;
        p0 p0Var = new p0();
        p0Var.f4614a = -1;
        p0Var.f4615b = 0;
        p0Var.f4616c = 0;
        p0Var.f4617d = 1;
        p0Var.f4618e = 0;
        p0Var.f4619f = false;
        p0Var.f4620g = false;
        p0Var.f4621h = false;
        p0Var.i = false;
        p0Var.f4622j = false;
        p0Var.f4623k = false;
        this.f9087y0 = p0Var;
        this.f9018B0 = false;
        this.f9020C0 = false;
        S s8 = new S(this);
        this.f9021D0 = s8;
        this.f9023E0 = false;
        this.f9028H0 = new int[2];
        this.f9032J0 = new int[2];
        this.K0 = new int[2];
        this.f9035L0 = new int[2];
        this.f9037M0 = new ArrayList();
        this.f9039N0 = new P(this, i9);
        this.f9043P0 = 0;
        this.f9045Q0 = 0;
        this.f9049S0 = new S(this);
        this.f9051T0 = new C0177g(getContext(), new S(this));
        setScrollContainer(true);
        setFocusableInTouchMode(true);
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        this.f9069o0 = viewConfiguration.getScaledTouchSlop();
        int i11 = Build.VERSION.SDK_INT;
        if (i11 >= 26) {
            Method method = K.f4070a;
            fA = h.c(viewConfiguration);
        } else {
            fA = K.a(viewConfiguration, context);
        }
        this.f9075s0 = fA;
        this.f9077t0 = i11 >= 26 ? h.d(viewConfiguration) : K.a(viewConfiguration, context);
        this.q0 = viewConfiguration.getScaledMinimumFlingVelocity();
        this.f9073r0 = viewConfiguration.getScaledMaximumFlingVelocity();
        this.f9071q = context.getResources().getDisplayMetrics().density * 160.0f * 386.0878f * 0.84f;
        setWillNotDraw(getOverScrollMode() == 2);
        this.f9061g0.f4494a = s8;
        this.f9078u = new C0198b(new S(this));
        this.f9080v = new I(new S(this));
        Field field = J.f4065a;
        if ((i11 >= 26 ? D.a(this) : 0) == 0 && i11 >= 26) {
            D.b(this, 8);
        }
        if (getImportantForAccessibility() == 0) {
            setImportantForAccessibility(1);
        }
        this.f9048S = (AccessibilityManager) getContext().getSystemService("accessibility");
        setAccessibilityDelegateCompat(new v0(this));
        int[] iArr = M1.a.f4150a;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, iArr, i, 0);
        J.i(this, context, iArr, attributeSet, typedArrayObtainStyledAttributes, i);
        String string = typedArrayObtainStyledAttributes.getString(8);
        if (typedArrayObtainStyledAttributes.getInt(2, -1) == -1) {
            setDescendantFocusability(262144);
        }
        this.f9084x = 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(I1.a.l(this, new StringBuilder("Trying to set fast scroller without both required drawables.")));
            }
            Resources resources = getContext().getResources();
            c3 = 3;
            c9 = 2;
            c8 = 1;
            typedArray = typedArrayObtainStyledAttributes;
            i8 = i;
            i5 = 4;
            new C0223y(this, stateListDrawable, drawable, stateListDrawable2, drawable2, resources.getDimensionPixelSize(com.martsnew.tv.R.dimen.fastscroll_default_thickness), resources.getDimensionPixelSize(com.martsnew.tv.R.dimen.fastscroll_minimum_range), resources.getDimensionPixelOffset(com.martsnew.tv.R.dimen.fastscroll_margin));
        } else {
            c3 = 3;
            i5 = 4;
            c8 = 1;
            c9 = 2;
            i8 = i;
            typedArray = typedArrayObtainStyledAttributes;
        }
        typedArray.recycle();
        this.f9047R0 = context.getPackageManager().hasSystemFeature("android.hardware.rotaryencoder.lowres");
        if (string != null) {
            String strTrim = string.trim();
            if (!strTrim.isEmpty()) {
                if (strTrim.charAt(0) == '.') {
                    strTrim = context.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() : context.getClassLoader()).asSubclass(a.class);
                    try {
                        Constructor constructor2 = clsAsSubclass.getConstructor(a1);
                        Object[] objArr2 = new Object[i5];
                        objArr2[0] = context;
                        objArr2[c8] = attributeSet;
                        objArr2[c9] = Integer.valueOf(i8);
                        objArr2[c3] = 0;
                        objArr = objArr2;
                        constructor = constructor2;
                    } catch (NoSuchMethodException e8) {
                        try {
                            objArr = null;
                            constructor = clsAsSubclass.getConstructor(null);
                        } catch (NoSuchMethodException e9) {
                            e9.initCause(e8);
                            throw new IllegalStateException(attributeSet.getPositionDescription() + ": Error creating LayoutManager " + str, e9);
                        }
                    }
                    constructor.setAccessible(c8);
                    setLayoutManager((a) constructor.newInstance(objArr));
                } catch (ClassCastException e10) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Class is not a LayoutManager " + str, e10);
                } catch (ClassNotFoundException e11) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Unable to find LayoutManager " + str, e11);
                } catch (IllegalAccessException e12) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Cannot access non-public constructor " + str, e12);
                } catch (InstantiationException e13) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Could not instantiate the LayoutManager: " + str, e13);
                } catch (InvocationTargetException e14) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Could not instantiate the LayoutManager: " + str, e14);
                }
            }
        }
        int[] iArr2 = W0;
        TypedArray typedArrayObtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, iArr2, i8, 0);
        J.i(this, context, iArr2, attributeSet, typedArrayObtainStyledAttributes2, i8);
        boolean z8 = typedArrayObtainStyledAttributes2.getBoolean(0, true);
        typedArrayObtainStyledAttributes2.recycle();
        setNestedScrollingEnabled(z8);
        setTag(com.martsnew.tv.R.id.is_pooling_container_tag, Boolean.TRUE);
    }

    @Override // android.view.ViewGroup
    public final ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        a aVar = this.D;
        if (aVar != null) {
            return aVar.G(layoutParams);
        }
        throw new IllegalStateException(I1.a.l(this, new StringBuilder("RecyclerView has no LayoutManager")));
    }
}
