package androidx.recyclerview.widget;

import android.R;
import android.animation.LayoutTransition;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.database.Observable;
import android.graphics.Canvas;
import android.graphics.Matrix;
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.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.Display;
import android.view.FocusFinder;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.Interpolator;
import android.widget.EdgeEffect;
import android.widget.OverScroller;
import androidx.core.view.accessibility.d;
import androidx.recyclerview.widget.a;
import androidx.recyclerview.widget.b;
import androidx.recyclerview.widget.e;
import androidx.recyclerview.widget.k;
import androidx.recyclerview.widget.o;
import androidx.recyclerview.widget.p;
import com.android.org.conscrypt.PSKKeyManager;
import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public class RecyclerView extends ViewGroup implements androidx.core.view.m {
    private static final int[] B0 = {R.attr.nestedScrollingEnabled};
    static final boolean C0;
    static final boolean D0;
    static final boolean E0;
    private static final boolean F0;
    private static final boolean G0;
    private static final Class<?>[] H0;
    static final Interpolator I0;
    boolean A;
    private final p.b A0;
    private boolean B;
    private int C;
    boolean D;
    private final AccessibilityManager E;
    private List<q> F;
    boolean G;
    boolean H;
    private int I;
    private int J;
    private k K;
    private EdgeEffect L;
    private EdgeEffect M;
    private EdgeEffect N;
    private EdgeEffect O;
    l P;
    private int Q;
    private int R;
    private VelocityTracker S;
    private int T;
    private int U;
    private int V;
    private int W;

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

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    private r f2650b0;

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

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    private final int f2652d0;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private final x f2653e;

    /* JADX INFO: renamed from: e0, reason: collision with root package name */
    private float f2654e0;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    final v f2655f;

    /* JADX INFO: renamed from: f0, reason: collision with root package name */
    private float f2656f0;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private y f2657g;

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    private boolean f2658g0;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    androidx.recyclerview.widget.a f2659h;

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    final c0 f2660h0;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    androidx.recyclerview.widget.b f2661i;

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    androidx.recyclerview.widget.e f2662i0;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    final androidx.recyclerview.widget.p f2663j;

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    e.b f2664j0;

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

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    final a0 f2666k0;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    final Rect f2667l;

    /* JADX INFO: renamed from: l0, reason: collision with root package name */
    private t f2668l0;

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

    /* JADX INFO: renamed from: m0, reason: collision with root package name */
    private List<t> f2670m0;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    final RectF f2671n;

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

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    g f2673o;

    /* JADX INFO: renamed from: o0, reason: collision with root package name */
    boolean f2674o0;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    o f2675p;

    /* JADX INFO: renamed from: p0, reason: collision with root package name */
    private l.b f2676p0;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    w f2677q;

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    boolean f2678q0;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    final ArrayList<n> f2679r;

    /* JADX INFO: renamed from: r0, reason: collision with root package name */
    androidx.recyclerview.widget.k f2680r0;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    private final ArrayList<s> f2681s;

    /* JADX INFO: renamed from: s0, reason: collision with root package name */
    private j f2682s0;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    private s f2683t;

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

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    boolean f2685u;

    /* JADX INFO: renamed from: u0, reason: collision with root package name */
    private androidx.core.view.n f2686u0;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    boolean f2687v;

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

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

    /* JADX INFO: renamed from: w0, reason: collision with root package name */
    private final int[] f2690w0;

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

    /* JADX INFO: renamed from: x0, reason: collision with root package name */
    final int[] f2692x0;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    private int f2693y;

    /* JADX INFO: renamed from: y0, reason: collision with root package name */
    final List<d0> f2694y0;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    boolean f2695z;

    /* JADX INFO: renamed from: z0, reason: collision with root package name */
    private Runnable f2696z0;

    class a implements Runnable {
        a() {
        }

        @Override // java.lang.Runnable
        public void run() {
            RecyclerView recyclerView = RecyclerView.this;
            if (!recyclerView.f2691x || recyclerView.isLayoutRequested()) {
                return;
            }
            RecyclerView recyclerView2 = RecyclerView.this;
            if (!recyclerView2.f2685u) {
                recyclerView2.requestLayout();
            } else if (recyclerView2.A) {
                recyclerView2.f2695z = true;
            } else {
                recyclerView2.u();
            }
        }
    }

    public static class a0 {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private SparseArray<Object> f2699b;

        /* JADX INFO: renamed from: m, reason: collision with root package name */
        int f2710m;

        /* JADX INFO: renamed from: n, reason: collision with root package name */
        long f2711n;

        /* JADX INFO: renamed from: o, reason: collision with root package name */
        int f2712o;

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        int f2713p;

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        int f2698a = -1;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        int f2700c = 0;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        int f2701d = 0;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        int f2702e = 1;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        int f2703f = 0;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        boolean f2704g = false;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        boolean f2705h = false;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        boolean f2706i = false;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        boolean f2707j = false;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        boolean f2708k = false;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        boolean f2709l = false;

        void a(int i3) {
            if ((this.f2702e & i3) != 0) {
                return;
            }
            throw new IllegalStateException("Layout state should be one of " + Integer.toBinaryString(i3) + " but it is " + Integer.toBinaryString(this.f2702e));
        }

        public int b() {
            return this.f2705h ? this.f2700c - this.f2701d : this.f2703f;
        }

        public int c() {
            return this.f2698a;
        }

        public boolean d() {
            return this.f2698a != -1;
        }

        public boolean e() {
            return this.f2705h;
        }

        void f(g gVar) {
            this.f2702e = 1;
            this.f2703f = gVar.c();
            this.f2705h = false;
            this.f2706i = false;
            this.f2707j = false;
        }

        public boolean g() {
            return this.f2709l;
        }

        public String toString() {
            return "State{mTargetPosition=" + this.f2698a + ", mData=" + this.f2699b + ", mItemCount=" + this.f2703f + ", mIsMeasuring=" + this.f2707j + ", mPreviousLayoutItemCount=" + this.f2700c + ", mDeletedInvisibleItemCountSincePreviousLayout=" + this.f2701d + ", mStructureChanged=" + this.f2704g + ", mInPreLayout=" + this.f2705h + ", mRunSimpleAnimations=" + this.f2708k + ", mRunPredictiveAnimations=" + this.f2709l + '}';
        }
    }

    class b implements Runnable {
        b() {
        }

        @Override // java.lang.Runnable
        public void run() {
            l lVar = RecyclerView.this.P;
            if (lVar != null) {
                lVar.u();
            }
            RecyclerView.this.f2678q0 = false;
        }
    }

    public static abstract class b0 {
    }

    static class c implements Interpolator {
        c() {
        }

        @Override // android.animation.TimeInterpolator
        public float getInterpolation(float f3) {
            float f4 = f3 - 1.0f;
            return (f4 * f4 * f4 * f4 * f4) + 1.0f;
        }
    }

    class c0 implements Runnable {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private int f2715e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private int f2716f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        OverScroller f2717g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        Interpolator f2718h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        private boolean f2719i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        private boolean f2720j;

        c0() {
            Interpolator interpolator = RecyclerView.I0;
            this.f2718h = interpolator;
            this.f2719i = false;
            this.f2720j = false;
            this.f2717g = new OverScroller(RecyclerView.this.getContext(), interpolator);
        }

        private int a(int i3, int i4, int i5, int i6) {
            int iRound;
            int iAbs = Math.abs(i3);
            int iAbs2 = Math.abs(i4);
            boolean z2 = iAbs > iAbs2;
            int iSqrt = (int) Math.sqrt((i5 * i5) + (i6 * i6));
            int iSqrt2 = (int) Math.sqrt((i3 * i3) + (i4 * i4));
            RecyclerView recyclerView = RecyclerView.this;
            int width = z2 ? recyclerView.getWidth() : recyclerView.getHeight();
            int i7 = width / 2;
            float f3 = width;
            float f4 = i7;
            float fB = f4 + (b(Math.min(1.0f, (iSqrt2 * 1.0f) / f3)) * f4);
            if (iSqrt > 0) {
                iRound = Math.round(Math.abs(fB / iSqrt) * 1000.0f) * 4;
            } else {
                if (!z2) {
                    iAbs = iAbs2;
                }
                iRound = (int) (((iAbs / f3) + 1.0f) * 300.0f);
            }
            return Math.min(iRound, 2000);
        }

        private float b(float f3) {
            return (float) Math.sin((f3 - 0.5f) * 0.47123894f);
        }

        private void d() {
            RecyclerView.this.removeCallbacks(this);
            androidx.core.view.y.j0(RecyclerView.this, this);
        }

        public void c(int i3, int i4) {
            RecyclerView.this.setScrollState(2);
            this.f2716f = 0;
            this.f2715e = 0;
            Interpolator interpolator = this.f2718h;
            Interpolator interpolator2 = RecyclerView.I0;
            if (interpolator != interpolator2) {
                this.f2718h = interpolator2;
                this.f2717g = new OverScroller(RecyclerView.this.getContext(), interpolator2);
            }
            this.f2717g.fling(0, 0, i3, i4, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE);
            e();
        }

        void e() {
            if (this.f2719i) {
                this.f2720j = true;
            } else {
                d();
            }
        }

        public void f(int i3, int i4, int i5, Interpolator interpolator) {
            if (i5 == Integer.MIN_VALUE) {
                i5 = a(i3, i4, 0, 0);
            }
            int i6 = i5;
            if (interpolator == null) {
                interpolator = RecyclerView.I0;
            }
            if (this.f2718h != interpolator) {
                this.f2718h = interpolator;
                this.f2717g = new OverScroller(RecyclerView.this.getContext(), interpolator);
            }
            this.f2716f = 0;
            this.f2715e = 0;
            RecyclerView.this.setScrollState(2);
            this.f2717g.startScroll(0, 0, i3, i4, i6);
            if (Build.VERSION.SDK_INT < 23) {
                this.f2717g.computeScrollOffset();
            }
            e();
        }

        public void g() {
            RecyclerView.this.removeCallbacks(this);
            this.f2717g.abortAnimation();
        }

        @Override // java.lang.Runnable
        public void run() {
            int i3;
            int i4;
            RecyclerView recyclerView = RecyclerView.this;
            if (recyclerView.f2675p == null) {
                g();
                return;
            }
            this.f2720j = false;
            this.f2719i = true;
            recyclerView.u();
            OverScroller overScroller = this.f2717g;
            if (overScroller.computeScrollOffset()) {
                int currX = overScroller.getCurrX();
                int currY = overScroller.getCurrY();
                int i5 = currX - this.f2715e;
                int i6 = currY - this.f2716f;
                this.f2715e = currX;
                this.f2716f = currY;
                RecyclerView recyclerView2 = RecyclerView.this;
                int[] iArr = recyclerView2.f2692x0;
                iArr[0] = 0;
                iArr[1] = 0;
                if (recyclerView2.F(i5, i6, iArr, null, 1)) {
                    int[] iArr2 = RecyclerView.this.f2692x0;
                    i5 -= iArr2[0];
                    i6 -= iArr2[1];
                }
                if (RecyclerView.this.getOverScrollMode() != 2) {
                    RecyclerView.this.t(i5, i6);
                }
                RecyclerView recyclerView3 = RecyclerView.this;
                if (recyclerView3.f2673o != null) {
                    int[] iArr3 = recyclerView3.f2692x0;
                    iArr3[0] = 0;
                    iArr3[1] = 0;
                    recyclerView3.f1(i5, i6, iArr3);
                    RecyclerView recyclerView4 = RecyclerView.this;
                    int[] iArr4 = recyclerView4.f2692x0;
                    i4 = iArr4[0];
                    i3 = iArr4[1];
                    i5 -= i4;
                    i6 -= i3;
                    z zVar = recyclerView4.f2675p.f2761g;
                    if (zVar != null && !zVar.g() && zVar.h()) {
                        int iB = RecyclerView.this.f2666k0.b();
                        if (iB == 0) {
                            zVar.r();
                        } else if (zVar.f() >= iB) {
                            zVar.p(iB - 1);
                            zVar.j(i4, i3);
                        } else {
                            zVar.j(i4, i3);
                        }
                    }
                } else {
                    i3 = 0;
                    i4 = 0;
                }
                if (!RecyclerView.this.f2679r.isEmpty()) {
                    RecyclerView.this.invalidate();
                }
                RecyclerView recyclerView5 = RecyclerView.this;
                int[] iArr5 = recyclerView5.f2692x0;
                iArr5[0] = 0;
                iArr5[1] = 0;
                recyclerView5.G(i4, i3, i5, i6, null, 1, iArr5);
                RecyclerView recyclerView6 = RecyclerView.this;
                int[] iArr6 = recyclerView6.f2692x0;
                int i7 = i5 - iArr6[0];
                int i8 = i6 - iArr6[1];
                if (i4 != 0 || i3 != 0) {
                    recyclerView6.I(i4, i3);
                }
                if (!RecyclerView.this.awakenScrollBars()) {
                    RecyclerView.this.invalidate();
                }
                boolean z2 = overScroller.isFinished() || (((overScroller.getCurrX() == overScroller.getFinalX()) || i7 != 0) && ((overScroller.getCurrY() == overScroller.getFinalY()) || i8 != 0));
                z zVar2 = RecyclerView.this.f2675p.f2761g;
                if ((zVar2 != null && zVar2.g()) || !z2) {
                    e();
                    RecyclerView recyclerView7 = RecyclerView.this;
                    androidx.recyclerview.widget.e eVar = recyclerView7.f2662i0;
                    if (eVar != null) {
                        eVar.f(recyclerView7, i4, i3);
                    }
                } else {
                    if (RecyclerView.this.getOverScrollMode() != 2) {
                        int currVelocity = (int) overScroller.getCurrVelocity();
                        int i9 = i7 < 0 ? -currVelocity : i7 > 0 ? currVelocity : 0;
                        if (i8 < 0) {
                            currVelocity = -currVelocity;
                        } else if (i8 <= 0) {
                            currVelocity = 0;
                        }
                        RecyclerView.this.a(i9, currVelocity);
                    }
                    if (RecyclerView.E0) {
                        RecyclerView.this.f2664j0.b();
                    }
                }
            }
            z zVar3 = RecyclerView.this.f2675p.f2761g;
            if (zVar3 != null && zVar3.g()) {
                zVar3.j(0, 0);
            }
            this.f2719i = false;
            if (this.f2720j) {
                d();
            } else {
                RecyclerView.this.setScrollState(0);
                RecyclerView.this.s1(1);
            }
        }
    }

    class d implements p.b {
        d() {
        }

        @Override // androidx.recyclerview.widget.p.b
        public void a(d0 d0Var) {
            RecyclerView recyclerView = RecyclerView.this;
            recyclerView.f2675p.m1(d0Var.f2724a, recyclerView.f2655f);
        }

        @Override // androidx.recyclerview.widget.p.b
        public void b(d0 d0Var, l.c cVar, l.c cVar2) {
            RecyclerView.this.l(d0Var, cVar, cVar2);
        }

        @Override // androidx.recyclerview.widget.p.b
        public void c(d0 d0Var, l.c cVar, l.c cVar2) {
            RecyclerView.this.f2655f.J(d0Var);
            RecyclerView.this.n(d0Var, cVar, cVar2);
        }

        @Override // androidx.recyclerview.widget.p.b
        public void d(d0 d0Var, l.c cVar, l.c cVar2) {
            d0Var.G(false);
            RecyclerView recyclerView = RecyclerView.this;
            if (recyclerView.G) {
                if (recyclerView.P.b(d0Var, d0Var, cVar, cVar2)) {
                    RecyclerView.this.L0();
                }
            } else if (recyclerView.P.d(d0Var, cVar, cVar2)) {
                RecyclerView.this.L0();
            }
        }
    }

    public static abstract class d0 {

        /* JADX INFO: renamed from: s, reason: collision with root package name */
        private static final List<Object> f2723s = Collections.emptyList();

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

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        WeakReference<RecyclerView> f2725b;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        int f2733j;

        /* JADX INFO: renamed from: r, reason: collision with root package name */
        RecyclerView f2741r;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        int f2726c = -1;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        int f2727d = -1;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        long f2728e = -1;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        int f2729f = -1;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        int f2730g = -1;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        d0 f2731h = null;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        d0 f2732i = null;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        List<Object> f2734k = null;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        List<Object> f2735l = null;

        /* JADX INFO: renamed from: m, reason: collision with root package name */
        private int f2736m = 0;

        /* JADX INFO: renamed from: n, reason: collision with root package name */
        v f2737n = null;

        /* JADX INFO: renamed from: o, reason: collision with root package name */
        boolean f2738o = false;

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        private int f2739p = 0;

        /* JADX INFO: renamed from: q, reason: collision with root package name */
        int f2740q = -1;

        public d0(View view) {
            if (view == null) {
                throw new IllegalArgumentException("itemView may not be null");
            }
            this.f2724a = view;
        }

        private void g() {
            if (this.f2734k == null) {
                ArrayList arrayList = new ArrayList();
                this.f2734k = arrayList;
                this.f2735l = Collections.unmodifiableList(arrayList);
            }
        }

        void A(int i3, boolean z2) {
            if (this.f2727d == -1) {
                this.f2727d = this.f2726c;
            }
            if (this.f2730g == -1) {
                this.f2730g = this.f2726c;
            }
            if (z2) {
                this.f2730g += i3;
            }
            this.f2726c += i3;
            if (this.f2724a.getLayoutParams() != null) {
                ((p) this.f2724a.getLayoutParams()).f2781c = true;
            }
        }

        void B(RecyclerView recyclerView) {
            int i3 = this.f2740q;
            if (i3 != -1) {
                this.f2739p = i3;
            } else {
                this.f2739p = androidx.core.view.y.C(this.f2724a);
            }
            recyclerView.i1(this, 4);
        }

        void C(RecyclerView recyclerView) {
            recyclerView.i1(this, this.f2739p);
            this.f2739p = 0;
        }

        void D() {
            this.f2733j = 0;
            this.f2726c = -1;
            this.f2727d = -1;
            this.f2728e = -1L;
            this.f2730g = -1;
            this.f2736m = 0;
            this.f2731h = null;
            this.f2732i = null;
            d();
            this.f2739p = 0;
            this.f2740q = -1;
            RecyclerView.r(this);
        }

        void E() {
            if (this.f2727d == -1) {
                this.f2727d = this.f2726c;
            }
        }

        void F(int i3, int i4) {
            this.f2733j = (i3 & i4) | (this.f2733j & (~i4));
        }

        public final void G(boolean z2) {
            int i3 = this.f2736m;
            int i4 = z2 ? i3 - 1 : i3 + 1;
            this.f2736m = i4;
            if (i4 < 0) {
                this.f2736m = 0;
                Log.e("View", "isRecyclable decremented below 0: unmatched pair of setIsRecyable() calls for " + this);
                return;
            }
            if (!z2 && i4 == 1) {
                this.f2733j |= 16;
            } else if (z2 && i4 == 0) {
                this.f2733j &= -17;
            }
        }

        void H(v vVar, boolean z2) {
            this.f2737n = vVar;
            this.f2738o = z2;
        }

        boolean I() {
            return (this.f2733j & 16) != 0;
        }

        boolean J() {
            return (this.f2733j & 128) != 0;
        }

        void K() {
            this.f2737n.J(this);
        }

        boolean L() {
            return (this.f2733j & 32) != 0;
        }

        void a(Object obj) {
            if (obj == null) {
                b(1024);
            } else if ((1024 & this.f2733j) == 0) {
                g();
                this.f2734k.add(obj);
            }
        }

        void b(int i3) {
            this.f2733j = i3 | this.f2733j;
        }

        void c() {
            this.f2727d = -1;
            this.f2730g = -1;
        }

        void d() {
            List<Object> list = this.f2734k;
            if (list != null) {
                list.clear();
            }
            this.f2733j &= -1025;
        }

        void e() {
            this.f2733j &= -33;
        }

        void f() {
            this.f2733j &= -257;
        }

        boolean h() {
            return (this.f2733j & 16) == 0 && androidx.core.view.y.S(this.f2724a);
        }

        void i(int i3, int i4, boolean z2) {
            b(8);
            A(i4, z2);
            this.f2726c = i3;
        }

        public final int j() {
            RecyclerView recyclerView = this.f2741r;
            if (recyclerView == null) {
                return -1;
            }
            return recyclerView.b0(this);
        }

        public final long k() {
            return this.f2728e;
        }

        public final int l() {
            return this.f2729f;
        }

        public final int m() {
            int i3 = this.f2730g;
            return i3 == -1 ? this.f2726c : i3;
        }

        public final int n() {
            return this.f2727d;
        }

        List<Object> o() {
            if ((this.f2733j & 1024) != 0) {
                return f2723s;
            }
            List<Object> list = this.f2734k;
            return (list == null || list.size() == 0) ? f2723s : this.f2735l;
        }

        boolean p(int i3) {
            return (this.f2733j & i3) != 0;
        }

        boolean q() {
            return (this.f2733j & 512) != 0 || t();
        }

        boolean r() {
            return (this.f2724a.getParent() == null || this.f2724a.getParent() == this.f2741r) ? false : true;
        }

        boolean s() {
            return (this.f2733j & 1) != 0;
        }

        boolean t() {
            return (this.f2733j & 4) != 0;
        }

        public String toString() {
            StringBuilder sb = new StringBuilder((getClass().isAnonymousClass() ? "ViewHolder" : getClass().getSimpleName()) + "{" + Integer.toHexString(hashCode()) + " position=" + this.f2726c + " id=" + this.f2728e + ", oldPos=" + this.f2727d + ", pLpos:" + this.f2730g);
            if (w()) {
                sb.append(" scrap ");
                sb.append(this.f2738o ? "[changeScrap]" : "[attachedScrap]");
            }
            if (t()) {
                sb.append(" invalid");
            }
            if (!s()) {
                sb.append(" unbound");
            }
            if (z()) {
                sb.append(" update");
            }
            if (v()) {
                sb.append(" removed");
            }
            if (J()) {
                sb.append(" ignored");
            }
            if (x()) {
                sb.append(" tmpDetached");
            }
            if (!u()) {
                sb.append(" not recyclable(" + this.f2736m + ")");
            }
            if (q()) {
                sb.append(" undefined adapter position");
            }
            if (this.f2724a.getParent() == null) {
                sb.append(" no parent");
            }
            sb.append("}");
            return sb.toString();
        }

        public final boolean u() {
            return (this.f2733j & 16) == 0 && !androidx.core.view.y.S(this.f2724a);
        }

        boolean v() {
            return (this.f2733j & 8) != 0;
        }

        boolean w() {
            return this.f2737n != null;
        }

        boolean x() {
            return (this.f2733j & PSKKeyManager.MAX_KEY_LENGTH_BYTES) != 0;
        }

        boolean y() {
            return (this.f2733j & 2) != 0;
        }

        boolean z() {
            return (this.f2733j & 2) != 0;
        }
    }

    class e implements b.InterfaceC0040b {
        e() {
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public View a(int i3) {
            return RecyclerView.this.getChildAt(i3);
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public void b(View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0 != null) {
                d0VarF0.B(RecyclerView.this);
            }
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public void c(int i3) {
            View childAt = RecyclerView.this.getChildAt(i3);
            if (childAt != null) {
                RecyclerView.this.z(childAt);
                childAt.clearAnimation();
            }
            RecyclerView.this.removeViewAt(i3);
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public void d() {
            int iK = k();
            for (int i3 = 0; i3 < iK; i3++) {
                View viewA = a(i3);
                RecyclerView.this.z(viewA);
                viewA.clearAnimation();
            }
            RecyclerView.this.removeAllViews();
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public d0 e(View view) {
            return RecyclerView.f0(view);
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public void f(int i3) {
            d0 d0VarF0;
            View viewA = a(i3);
            if (viewA != null && (d0VarF0 = RecyclerView.f0(viewA)) != null) {
                if (d0VarF0.x() && !d0VarF0.J()) {
                    throw new IllegalArgumentException("called detach on an already detached child " + d0VarF0 + RecyclerView.this.P());
                }
                d0VarF0.b(PSKKeyManager.MAX_KEY_LENGTH_BYTES);
            }
            RecyclerView.this.detachViewFromParent(i3);
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public void g(View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0 != null) {
                d0VarF0.C(RecyclerView.this);
            }
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public void h(View view, int i3, ViewGroup.LayoutParams layoutParams) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0 != null) {
                if (!d0VarF0.x() && !d0VarF0.J()) {
                    throw new IllegalArgumentException("Called attach on a child which is not detached: " + d0VarF0 + RecyclerView.this.P());
                }
                d0VarF0.f();
            }
            RecyclerView.this.attachViewToParent(view, i3, layoutParams);
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public void i(View view, int i3) {
            RecyclerView.this.addView(view, i3);
            RecyclerView.this.y(view);
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public int j(View view) {
            return RecyclerView.this.indexOfChild(view);
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0040b
        public int k() {
            return RecyclerView.this.getChildCount();
        }
    }

    class f implements a.InterfaceC0039a {
        f() {
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0039a
        public void a(int i3, int i4) {
            RecyclerView.this.B0(i3, i4);
            RecyclerView.this.f2672n0 = true;
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0039a
        public void b(a.b bVar) {
            i(bVar);
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0039a
        public d0 c(int i3) {
            d0 d0VarZ = RecyclerView.this.Z(i3, true);
            if (d0VarZ == null || RecyclerView.this.f2661i.n(d0VarZ.f2724a)) {
                return null;
            }
            return d0VarZ;
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0039a
        public void d(int i3, int i4) {
            RecyclerView.this.C0(i3, i4, true);
            RecyclerView recyclerView = RecyclerView.this;
            recyclerView.f2672n0 = true;
            recyclerView.f2666k0.f2701d += i4;
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0039a
        public void e(int i3, int i4) {
            RecyclerView.this.C0(i3, i4, false);
            RecyclerView.this.f2672n0 = true;
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0039a
        public void f(a.b bVar) {
            i(bVar);
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0039a
        public void g(int i3, int i4) {
            RecyclerView.this.A0(i3, i4);
            RecyclerView.this.f2672n0 = true;
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0039a
        public void h(int i3, int i4, Object obj) {
            RecyclerView.this.v1(i3, i4, obj);
            RecyclerView.this.f2674o0 = true;
        }

        void i(a.b bVar) {
            int i3 = bVar.f2862a;
            if (i3 == 1) {
                RecyclerView recyclerView = RecyclerView.this;
                recyclerView.f2675p.R0(recyclerView, bVar.f2863b, bVar.f2865d);
                return;
            }
            if (i3 == 2) {
                RecyclerView recyclerView2 = RecyclerView.this;
                recyclerView2.f2675p.U0(recyclerView2, bVar.f2863b, bVar.f2865d);
            } else if (i3 == 4) {
                RecyclerView recyclerView3 = RecyclerView.this;
                recyclerView3.f2675p.W0(recyclerView3, bVar.f2863b, bVar.f2865d, bVar.f2864c);
            } else {
                if (i3 != 8) {
                    return;
                }
                RecyclerView recyclerView4 = RecyclerView.this;
                recyclerView4.f2675p.T0(recyclerView4, bVar.f2863b, bVar.f2865d, 1);
            }
        }
    }

    public static abstract class g<VH extends d0> {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private final h f2744a = new h();

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private boolean f2745b = false;

        public final void a(VH vh, int i3) {
            vh.f2726c = i3;
            if (g()) {
                vh.f2728e = d(i3);
            }
            vh.F(1, 519);
            androidx.core.os.f.a("RV OnBindView");
            k(vh, i3, vh.o());
            vh.d();
            ViewGroup.LayoutParams layoutParams = vh.f2724a.getLayoutParams();
            if (layoutParams instanceof p) {
                ((p) layoutParams).f2781c = true;
            }
            androidx.core.os.f.b();
        }

        public final VH b(ViewGroup viewGroup, int i3) {
            try {
                androidx.core.os.f.a("RV CreateView");
                VH vh = (VH) l(viewGroup, i3);
                if (vh.f2724a.getParent() != null) {
                    throw new IllegalStateException("ViewHolder views must not be attached when created. Ensure that you are not passing 'true' to the attachToRoot parameter of LayoutInflater.inflate(..., boolean attachToRoot)");
                }
                vh.f2729f = i3;
                return vh;
            } finally {
                androidx.core.os.f.b();
            }
        }

        public abstract int c();

        public long d(int i3) {
            return -1L;
        }

        public int e(int i3) {
            return 0;
        }

        public final boolean f() {
            return this.f2744a.a();
        }

        public final boolean g() {
            return this.f2745b;
        }

        public final void h() {
            this.f2744a.b();
        }

        public void i(RecyclerView recyclerView) {
        }

        public abstract void j(VH vh, int i3);

        public void k(VH vh, int i3, List<Object> list) {
            j(vh, i3);
        }

        public abstract VH l(ViewGroup viewGroup, int i3);

        public void m(RecyclerView recyclerView) {
        }

        public boolean n(VH vh) {
            return false;
        }

        public void o(VH vh) {
        }

        public void p(VH vh) {
        }

        public void q(VH vh) {
        }

        public void r(i iVar) {
            this.f2744a.registerObserver(iVar);
        }

        public void s(boolean z2) {
            if (f()) {
                throw new IllegalStateException("Cannot change whether this adapter has stable IDs while the adapter has registered observers.");
            }
            this.f2745b = z2;
        }

        public void t(i iVar) {
            this.f2744a.unregisterObserver(iVar);
        }
    }

    static class h extends Observable<i> {
        h() {
        }

        public boolean a() {
            return !((Observable) this).mObservers.isEmpty();
        }

        public void b() {
            for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
                ((i) ((Observable) this).mObservers.get(size)).a();
            }
        }
    }

    public static abstract class i {
        public void a() {
        }
    }

    public interface j {
        int a(int i3, int i4);
    }

    public static class k {
        protected EdgeEffect a(RecyclerView recyclerView, int i3) {
            return new EdgeEffect(recyclerView.getContext());
        }
    }

    public static abstract class l {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private b f2746a = null;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private ArrayList<a> f2747b = new ArrayList<>();

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private long f2748c = 120;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private long f2749d = 120;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private long f2750e = 250;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private long f2751f = 250;

        public interface a {
            void a();
        }

        interface b {
            void a(d0 d0Var);
        }

        public static class c {

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

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

            public c a(d0 d0Var) {
                return b(d0Var, 0);
            }

            public c b(d0 d0Var, int i3) {
                View view = d0Var.f2724a;
                this.f2752a = view.getLeft();
                this.f2753b = view.getTop();
                view.getRight();
                view.getBottom();
                return this;
            }
        }

        static int e(d0 d0Var) {
            int i3 = d0Var.f2733j & 14;
            if (d0Var.t()) {
                return 4;
            }
            if ((i3 & 4) != 0) {
                return i3;
            }
            int iN = d0Var.n();
            int iJ = d0Var.j();
            return (iN == -1 || iJ == -1 || iN == iJ) ? i3 : i3 | 2048;
        }

        public abstract boolean a(d0 d0Var, c cVar, c cVar2);

        public abstract boolean b(d0 d0Var, d0 d0Var2, c cVar, c cVar2);

        public abstract boolean c(d0 d0Var, c cVar, c cVar2);

        public abstract boolean d(d0 d0Var, c cVar, c cVar2);

        public abstract boolean f(d0 d0Var);

        public boolean g(d0 d0Var, List<Object> list) {
            return f(d0Var);
        }

        public final void h(d0 d0Var) {
            r(d0Var);
            b bVar = this.f2746a;
            if (bVar != null) {
                bVar.a(d0Var);
            }
        }

        public final void i() {
            int size = this.f2747b.size();
            for (int i3 = 0; i3 < size; i3++) {
                this.f2747b.get(i3).a();
            }
            this.f2747b.clear();
        }

        public abstract void j(d0 d0Var);

        public abstract void k();

        public long l() {
            return this.f2748c;
        }

        public long m() {
            return this.f2751f;
        }

        public long n() {
            return this.f2750e;
        }

        public long o() {
            return this.f2749d;
        }

        public abstract boolean p();

        public c q() {
            return new c();
        }

        public void r(d0 d0Var) {
        }

        public c s(a0 a0Var, d0 d0Var) {
            return q().a(d0Var);
        }

        public c t(a0 a0Var, d0 d0Var, int i3, List<Object> list) {
            return q().a(d0Var);
        }

        public abstract void u();

        void v(b bVar) {
            this.f2746a = bVar;
        }
    }

    private class m implements l.b {
        m() {
        }

        @Override // androidx.recyclerview.widget.RecyclerView.l.b
        public void a(d0 d0Var) {
            d0Var.G(true);
            if (d0Var.f2731h != null && d0Var.f2732i == null) {
                d0Var.f2731h = null;
            }
            d0Var.f2732i = null;
            if (d0Var.I() || RecyclerView.this.U0(d0Var.f2724a) || !d0Var.x()) {
                return;
            }
            RecyclerView.this.removeDetachedView(d0Var.f2724a, false);
        }
    }

    public static abstract class n {
        @Deprecated
        public void d(Rect rect, int i3, RecyclerView recyclerView) {
            rect.set(0, 0, 0, 0);
        }

        public void e(Rect rect, View view, RecyclerView recyclerView, a0 a0Var) {
            d(rect, ((p) view.getLayoutParams()).a(), recyclerView);
        }

        @Deprecated
        public void f(Canvas canvas, RecyclerView recyclerView) {
        }

        public void g(Canvas canvas, RecyclerView recyclerView, a0 a0Var) {
            f(canvas, recyclerView);
        }

        @Deprecated
        public void h(Canvas canvas, RecyclerView recyclerView) {
        }

        public void i(Canvas canvas, RecyclerView recyclerView, a0 a0Var) {
            h(canvas, recyclerView);
        }
    }

    public static abstract class o {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        androidx.recyclerview.widget.b f2755a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        RecyclerView f2756b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private final o.b f2757c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private final o.b f2758d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        androidx.recyclerview.widget.o f2759e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        androidx.recyclerview.widget.o f2760f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        z f2761g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        boolean f2762h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        boolean f2763i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        boolean f2764j;

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

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        private boolean f2766l;

        /* JADX INFO: renamed from: m, reason: collision with root package name */
        int f2767m;

        /* JADX INFO: renamed from: n, reason: collision with root package name */
        boolean f2768n;

        /* JADX INFO: renamed from: o, reason: collision with root package name */
        private int f2769o;

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        private int f2770p;

        /* JADX INFO: renamed from: q, reason: collision with root package name */
        private int f2771q;

        /* JADX INFO: renamed from: r, reason: collision with root package name */
        private int f2772r;

        class a implements o.b {
            a() {
            }

            @Override // androidx.recyclerview.widget.o.b
            public View a(int i3) {
                return o.this.I(i3);
            }

            @Override // androidx.recyclerview.widget.o.b
            public int b() {
                return o.this.o0() - o.this.f0();
            }

            @Override // androidx.recyclerview.widget.o.b
            public int c() {
                return o.this.e0();
            }

            @Override // androidx.recyclerview.widget.o.b
            public int d(View view) {
                return o.this.T(view) + ((ViewGroup.MarginLayoutParams) ((p) view.getLayoutParams())).rightMargin;
            }

            @Override // androidx.recyclerview.widget.o.b
            public int e(View view) {
                return o.this.Q(view) - ((ViewGroup.MarginLayoutParams) ((p) view.getLayoutParams())).leftMargin;
            }
        }

        class b implements o.b {
            b() {
            }

            @Override // androidx.recyclerview.widget.o.b
            public View a(int i3) {
                return o.this.I(i3);
            }

            @Override // androidx.recyclerview.widget.o.b
            public int b() {
                return o.this.W() - o.this.d0();
            }

            @Override // androidx.recyclerview.widget.o.b
            public int c() {
                return o.this.g0();
            }

            @Override // androidx.recyclerview.widget.o.b
            public int d(View view) {
                return o.this.O(view) + ((ViewGroup.MarginLayoutParams) ((p) view.getLayoutParams())).bottomMargin;
            }

            @Override // androidx.recyclerview.widget.o.b
            public int e(View view) {
                return o.this.U(view) - ((ViewGroup.MarginLayoutParams) ((p) view.getLayoutParams())).topMargin;
            }
        }

        public interface c {
            void a(int i3, int i4);
        }

        public static class d {

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

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

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

            /* JADX INFO: renamed from: d, reason: collision with root package name */
            public boolean f2778d;
        }

        public o() {
            a aVar = new a();
            this.f2757c = aVar;
            b bVar = new b();
            this.f2758d = bVar;
            this.f2759e = new androidx.recyclerview.widget.o(aVar);
            this.f2760f = new androidx.recyclerview.widget.o(bVar);
            this.f2762h = false;
            this.f2763i = false;
            this.f2764j = false;
            this.f2765k = true;
            this.f2766l = true;
        }

        /* JADX WARN: Removed duplicated region for block: B:14:0x0020  */
        /* JADX WARN: Removed duplicated region for block: B:21:0x002f  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public static int K(int r4, int r5, int r6, int r7, boolean r8) {
            /*
                int r4 = r4 - r6
                r6 = 0
                int r4 = java.lang.Math.max(r6, r4)
                r0 = -2
                r1 = -1
                r2 = -2147483648(0xffffffff80000000, float:-0.0)
                r3 = 1073741824(0x40000000, float:2.0)
                if (r8 == 0) goto L1a
                if (r7 < 0) goto L11
                goto L1c
            L11:
                if (r7 != r1) goto L2f
                if (r5 == r2) goto L20
                if (r5 == 0) goto L2f
                if (r5 == r3) goto L20
                goto L2f
            L1a:
                if (r7 < 0) goto L1e
            L1c:
                r5 = r3
                goto L31
            L1e:
                if (r7 != r1) goto L22
            L20:
                r7 = r4
                goto L31
            L22:
                if (r7 != r0) goto L2f
                if (r5 == r2) goto L2c
                if (r5 != r3) goto L29
                goto L2c
            L29:
                r7 = r4
                r5 = r6
                goto L31
            L2c:
                r7 = r4
                r5 = r2
                goto L31
            L2f:
                r5 = r6
                r7 = r5
            L31:
                int r4 = android.view.View.MeasureSpec.makeMeasureSpec(r7, r5)
                return r4
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.o.K(int, int, int, int, boolean):int");
        }

        private int[] L(View view, Rect rect) {
            int[] iArr = new int[2];
            int iE0 = e0();
            int iG0 = g0();
            int iO0 = o0() - f0();
            int iW = W() - d0();
            int left = (view.getLeft() + rect.left) - view.getScrollX();
            int top = (view.getTop() + rect.top) - view.getScrollY();
            int iWidth = rect.width() + left;
            int iHeight = rect.height() + top;
            int i3 = left - iE0;
            int iMin = Math.min(0, i3);
            int i4 = top - iG0;
            int iMin2 = Math.min(0, i4);
            int i5 = iWidth - iO0;
            int iMax = Math.max(0, i5);
            int iMax2 = Math.max(0, iHeight - iW);
            if (Z() != 1) {
                if (iMin == 0) {
                    iMin = Math.min(i3, iMax);
                }
                iMax = iMin;
            } else if (iMax == 0) {
                iMax = Math.max(iMin, i5);
            }
            if (iMin2 == 0) {
                iMin2 = Math.min(i4, iMax2);
            }
            iArr[0] = iMax;
            iArr[1] = iMin2;
            return iArr;
        }

        private void f(View view, int i3, boolean z2) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (z2 || d0VarF0.v()) {
                this.f2756b.f2663j.b(d0VarF0);
            } else {
                this.f2756b.f2663j.p(d0VarF0);
            }
            p pVar = (p) view.getLayoutParams();
            if (d0VarF0.L() || d0VarF0.w()) {
                if (d0VarF0.w()) {
                    d0VarF0.K();
                } else {
                    d0VarF0.e();
                }
                this.f2755a.c(view, i3, view.getLayoutParams(), false);
            } else if (view.getParent() == this.f2756b) {
                int iM = this.f2755a.m(view);
                if (i3 == -1) {
                    i3 = this.f2755a.g();
                }
                if (iM == -1) {
                    throw new IllegalStateException("Added View has RecyclerView as parent but view is not a real child. Unfiltered index:" + this.f2756b.indexOfChild(view) + this.f2756b.P());
                }
                if (iM != i3) {
                    this.f2756b.f2675p.B0(iM, i3);
                }
            } else {
                this.f2755a.a(view, i3, false);
                pVar.f2781c = true;
                z zVar = this.f2761g;
                if (zVar != null && zVar.h()) {
                    this.f2761g.k(view);
                }
            }
            if (pVar.f2782d) {
                d0VarF0.f2724a.invalidate();
                pVar.f2782d = false;
            }
        }

        public static d i0(Context context, AttributeSet attributeSet, int i3, int i4) {
            d dVar = new d();
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, f0.c.f4625a, i3, i4);
            dVar.f2775a = typedArrayObtainStyledAttributes.getInt(f0.c.f4626b, 1);
            dVar.f2776b = typedArrayObtainStyledAttributes.getInt(f0.c.f4636l, 1);
            dVar.f2777c = typedArrayObtainStyledAttributes.getBoolean(f0.c.f4635k, false);
            dVar.f2778d = typedArrayObtainStyledAttributes.getBoolean(f0.c.f4637m, false);
            typedArrayObtainStyledAttributes.recycle();
            return dVar;
        }

        public static int n(int i3, int i4, int i5) {
            int mode = View.MeasureSpec.getMode(i3);
            int size = View.MeasureSpec.getSize(i3);
            return mode != Integer.MIN_VALUE ? mode != 1073741824 ? Math.max(i4, i5) : size : Math.min(size, Math.max(i4, i5));
        }

        private boolean t0(RecyclerView recyclerView, int i3, int i4) {
            View focusedChild = recyclerView.getFocusedChild();
            if (focusedChild == null) {
                return false;
            }
            int iE0 = e0();
            int iG0 = g0();
            int iO0 = o0() - f0();
            int iW = W() - d0();
            Rect rect = this.f2756b.f2667l;
            P(focusedChild, rect);
            return rect.left - i3 < iO0 && rect.right - i3 > iE0 && rect.top - i4 < iW && rect.bottom - i4 > iG0;
        }

        private void v1(v vVar, int i3, View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0.J()) {
                return;
            }
            if (d0VarF0.t() && !d0VarF0.v() && !this.f2756b.f2673o.g()) {
                q1(i3);
                vVar.C(d0VarF0);
            } else {
                x(i3);
                vVar.D(view);
                this.f2756b.f2663j.k(d0VarF0);
            }
        }

        private static boolean w0(int i3, int i4, int i5) {
            int mode = View.MeasureSpec.getMode(i4);
            int size = View.MeasureSpec.getSize(i4);
            if (i5 > 0 && i3 != i5) {
                return false;
            }
            if (mode == Integer.MIN_VALUE) {
                return size >= i3;
            }
            if (mode != 0) {
                return mode == 1073741824 && size == i3;
            }
            return true;
        }

        private void y(int i3, View view) {
            this.f2755a.d(i3);
        }

        void A(RecyclerView recyclerView, v vVar) {
            this.f2763i = false;
            I0(recyclerView, vVar);
        }

        public void A0(View view, int i3, int i4) {
            p pVar = (p) view.getLayoutParams();
            Rect rectJ0 = this.f2756b.j0(view);
            int i5 = i3 + rectJ0.left + rectJ0.right;
            int i6 = i4 + rectJ0.top + rectJ0.bottom;
            int iK = K(o0(), p0(), e0() + f0() + ((ViewGroup.MarginLayoutParams) pVar).leftMargin + ((ViewGroup.MarginLayoutParams) pVar).rightMargin + i5, ((ViewGroup.MarginLayoutParams) pVar).width, k());
            int iK2 = K(W(), X(), g0() + d0() + ((ViewGroup.MarginLayoutParams) pVar).topMargin + ((ViewGroup.MarginLayoutParams) pVar).bottomMargin + i6, ((ViewGroup.MarginLayoutParams) pVar).height, l());
            if (F1(view, iK, iK2, pVar)) {
                view.measure(iK, iK2);
            }
        }

        void A1(int i3, int i4) {
            this.f2771q = View.MeasureSpec.getSize(i3);
            int mode = View.MeasureSpec.getMode(i3);
            this.f2769o = mode;
            if (mode == 0 && !RecyclerView.D0) {
                this.f2771q = 0;
            }
            this.f2772r = View.MeasureSpec.getSize(i4);
            int mode2 = View.MeasureSpec.getMode(i4);
            this.f2770p = mode2;
            if (mode2 != 0 || RecyclerView.D0) {
                return;
            }
            this.f2772r = 0;
        }

        public View B(View view) {
            View viewR;
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView == null || (viewR = recyclerView.R(view)) == null || this.f2755a.n(viewR)) {
                return null;
            }
            return viewR;
        }

        public void B0(int i3, int i4) {
            View viewI = I(i3);
            if (viewI != null) {
                x(i3);
                h(viewI, i4);
            } else {
                throw new IllegalArgumentException("Cannot move a child from non-existing index:" + i3 + this.f2756b.toString());
            }
        }

        public void B1(int i3, int i4) {
            this.f2756b.setMeasuredDimension(i3, i4);
        }

        public View C(int i3) {
            int iJ = J();
            for (int i4 = 0; i4 < iJ; i4++) {
                View viewI = I(i4);
                d0 d0VarF0 = RecyclerView.f0(viewI);
                if (d0VarF0 != null && d0VarF0.m() == i3 && !d0VarF0.J() && (this.f2756b.f2666k0.e() || !d0VarF0.v())) {
                    return viewI;
                }
            }
            return null;
        }

        public void C0(int i3) {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                recyclerView.y0(i3);
            }
        }

        public void C1(Rect rect, int i3, int i4) {
            B1(n(i3, rect.width() + e0() + f0(), c0()), n(i4, rect.height() + g0() + d0(), b0()));
        }

        public abstract p D();

        public void D0(int i3) {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                recyclerView.z0(i3);
            }
        }

        void D1(int i3, int i4) {
            int iJ = J();
            if (iJ == 0) {
                this.f2756b.w(i3, i4);
                return;
            }
            int i5 = Integer.MIN_VALUE;
            int i6 = Integer.MAX_VALUE;
            int i7 = Integer.MAX_VALUE;
            int i8 = Integer.MIN_VALUE;
            for (int i9 = 0; i9 < iJ; i9++) {
                View viewI = I(i9);
                Rect rect = this.f2756b.f2667l;
                P(viewI, rect);
                int i10 = rect.left;
                if (i10 < i6) {
                    i6 = i10;
                }
                int i11 = rect.right;
                if (i11 > i5) {
                    i5 = i11;
                }
                int i12 = rect.top;
                if (i12 < i7) {
                    i7 = i12;
                }
                int i13 = rect.bottom;
                if (i13 > i8) {
                    i8 = i13;
                }
            }
            this.f2756b.f2667l.set(i6, i7, i5, i8);
            C1(this.f2756b.f2667l, i3, i4);
        }

        public p E(Context context, AttributeSet attributeSet) {
            return new p(context, attributeSet);
        }

        public void E0(g gVar, g gVar2) {
        }

        void E1(RecyclerView recyclerView) {
            if (recyclerView == null) {
                this.f2756b = null;
                this.f2755a = null;
                this.f2771q = 0;
                this.f2772r = 0;
            } else {
                this.f2756b = recyclerView;
                this.f2755a = recyclerView.f2661i;
                this.f2771q = recyclerView.getWidth();
                this.f2772r = recyclerView.getHeight();
            }
            this.f2769o = 1073741824;
            this.f2770p = 1073741824;
        }

        public p F(ViewGroup.LayoutParams layoutParams) {
            return layoutParams instanceof p ? new p((p) layoutParams) : layoutParams instanceof ViewGroup.MarginLayoutParams ? new p((ViewGroup.MarginLayoutParams) layoutParams) : new p(layoutParams);
        }

        public boolean F0(RecyclerView recyclerView, ArrayList<View> arrayList, int i3, int i4) {
            return false;
        }

        boolean F1(View view, int i3, int i4, p pVar) {
            return (!view.isLayoutRequested() && this.f2765k && w0(view.getWidth(), i3, ((ViewGroup.MarginLayoutParams) pVar).width) && w0(view.getHeight(), i4, ((ViewGroup.MarginLayoutParams) pVar).height)) ? false : true;
        }

        public int G() {
            return -1;
        }

        public void G0(RecyclerView recyclerView) {
        }

        boolean G1() {
            return false;
        }

        public int H(View view) {
            return ((p) view.getLayoutParams()).f2780b.bottom;
        }

        @Deprecated
        public void H0(RecyclerView recyclerView) {
        }

        boolean H1(View view, int i3, int i4, p pVar) {
            return (this.f2765k && w0(view.getMeasuredWidth(), i3, ((ViewGroup.MarginLayoutParams) pVar).width) && w0(view.getMeasuredHeight(), i4, ((ViewGroup.MarginLayoutParams) pVar).height)) ? false : true;
        }

        public View I(int i3) {
            androidx.recyclerview.widget.b bVar = this.f2755a;
            if (bVar != null) {
                return bVar.f(i3);
            }
            return null;
        }

        public void I0(RecyclerView recyclerView, v vVar) {
            H0(recyclerView);
        }

        public void I1(RecyclerView recyclerView, a0 a0Var, int i3) {
            Log.e("RecyclerView", "You must override smoothScrollToPosition to support smooth scrolling");
        }

        public int J() {
            androidx.recyclerview.widget.b bVar = this.f2755a;
            if (bVar != null) {
                return bVar.g();
            }
            return 0;
        }

        public View J0(View view, int i3, v vVar, a0 a0Var) {
            return null;
        }

        public void J1(z zVar) {
            z zVar2 = this.f2761g;
            if (zVar2 != null && zVar != zVar2 && zVar2.h()) {
                this.f2761g.r();
            }
            this.f2761g = zVar;
            zVar.q(this.f2756b, this);
        }

        public void K0(AccessibilityEvent accessibilityEvent) {
            RecyclerView recyclerView = this.f2756b;
            L0(recyclerView.f2655f, recyclerView.f2666k0, accessibilityEvent);
        }

        void K1() {
            z zVar = this.f2761g;
            if (zVar != null) {
                zVar.r();
            }
        }

        public void L0(v vVar, a0 a0Var, AccessibilityEvent accessibilityEvent) {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView == null || accessibilityEvent == null) {
                return;
            }
            boolean z2 = true;
            if (!recyclerView.canScrollVertically(1) && !this.f2756b.canScrollVertically(-1) && !this.f2756b.canScrollHorizontally(-1) && !this.f2756b.canScrollHorizontally(1)) {
                z2 = false;
            }
            accessibilityEvent.setScrollable(z2);
            g gVar = this.f2756b.f2673o;
            if (gVar != null) {
                accessibilityEvent.setItemCount(gVar.c());
            }
        }

        public boolean L1() {
            return false;
        }

        public boolean M() {
            RecyclerView recyclerView = this.f2756b;
            return recyclerView != null && recyclerView.f2665k;
        }

        void M0(androidx.core.view.accessibility.d dVar) {
            RecyclerView recyclerView = this.f2756b;
            N0(recyclerView.f2655f, recyclerView.f2666k0, dVar);
        }

        public int N(v vVar, a0 a0Var) {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView == null || recyclerView.f2673o == null || !k()) {
                return 1;
            }
            return this.f2756b.f2673o.c();
        }

        public void N0(v vVar, a0 a0Var, androidx.core.view.accessibility.d dVar) {
            if (this.f2756b.canScrollVertically(-1) || this.f2756b.canScrollHorizontally(-1)) {
                dVar.a(8192);
                dVar.o0(true);
            }
            if (this.f2756b.canScrollVertically(1) || this.f2756b.canScrollHorizontally(1)) {
                dVar.a(4096);
                dVar.o0(true);
            }
            dVar.Y(d.b.a(k0(vVar, a0Var), N(vVar, a0Var), v0(vVar, a0Var), l0(vVar, a0Var)));
        }

        public int O(View view) {
            return view.getBottom() + H(view);
        }

        void O0(View view, androidx.core.view.accessibility.d dVar) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0 == null || d0VarF0.v() || this.f2755a.n(d0VarF0.f2724a)) {
                return;
            }
            RecyclerView recyclerView = this.f2756b;
            P0(recyclerView.f2655f, recyclerView.f2666k0, view, dVar);
        }

        public void P(View view, Rect rect) {
            RecyclerView.g0(view, rect);
        }

        public void P0(v vVar, a0 a0Var, View view, androidx.core.view.accessibility.d dVar) {
            dVar.Z(d.c.a(l() ? h0(view) : 0, 1, k() ? h0(view) : 0, 1, false, false));
        }

        public int Q(View view) {
            return view.getLeft() - a0(view);
        }

        public View Q0(View view, int i3) {
            return null;
        }

        public int R(View view) {
            Rect rect = ((p) view.getLayoutParams()).f2780b;
            return view.getMeasuredHeight() + rect.top + rect.bottom;
        }

        public void R0(RecyclerView recyclerView, int i3, int i4) {
        }

        public int S(View view) {
            Rect rect = ((p) view.getLayoutParams()).f2780b;
            return view.getMeasuredWidth() + rect.left + rect.right;
        }

        public void S0(RecyclerView recyclerView) {
        }

        public int T(View view) {
            return view.getRight() + j0(view);
        }

        public void T0(RecyclerView recyclerView, int i3, int i4, int i5) {
        }

        public int U(View view) {
            return view.getTop() - m0(view);
        }

        public void U0(RecyclerView recyclerView, int i3, int i4) {
        }

        public View V() {
            View focusedChild;
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView == null || (focusedChild = recyclerView.getFocusedChild()) == null || this.f2755a.n(focusedChild)) {
                return null;
            }
            return focusedChild;
        }

        public void V0(RecyclerView recyclerView, int i3, int i4) {
        }

        public int W() {
            return this.f2772r;
        }

        public void W0(RecyclerView recyclerView, int i3, int i4, Object obj) {
            V0(recyclerView, i3, i4);
        }

        public int X() {
            return this.f2770p;
        }

        public void X0(v vVar, a0 a0Var) {
            Log.e("RecyclerView", "You must override onLayoutChildren(Recycler recycler, State state) ");
        }

        public int Y() {
            RecyclerView recyclerView = this.f2756b;
            g adapter = recyclerView != null ? recyclerView.getAdapter() : null;
            if (adapter != null) {
                return adapter.c();
            }
            return 0;
        }

        public void Y0(a0 a0Var) {
        }

        public int Z() {
            return androidx.core.view.y.E(this.f2756b);
        }

        public void Z0(v vVar, a0 a0Var, int i3, int i4) {
            this.f2756b.w(i3, i4);
        }

        public int a0(View view) {
            return ((p) view.getLayoutParams()).f2780b.left;
        }

        @Deprecated
        public boolean a1(RecyclerView recyclerView, View view, View view2) {
            return x0() || recyclerView.t0();
        }

        public void b(View view) {
            c(view, -1);
        }

        public int b0() {
            return androidx.core.view.y.F(this.f2756b);
        }

        public boolean b1(RecyclerView recyclerView, a0 a0Var, View view, View view2) {
            return a1(recyclerView, view, view2);
        }

        public void c(View view, int i3) {
            f(view, i3, true);
        }

        public int c0() {
            return androidx.core.view.y.G(this.f2756b);
        }

        public void c1(Parcelable parcelable) {
        }

        public void d(View view) {
            e(view, -1);
        }

        public int d0() {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                return recyclerView.getPaddingBottom();
            }
            return 0;
        }

        public Parcelable d1() {
            return null;
        }

        public void e(View view, int i3) {
            f(view, i3, false);
        }

        public int e0() {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                return recyclerView.getPaddingLeft();
            }
            return 0;
        }

        public void e1(int i3) {
        }

        public int f0() {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                return recyclerView.getPaddingRight();
            }
            return 0;
        }

        void f1(z zVar) {
            if (this.f2761g == zVar) {
                this.f2761g = null;
            }
        }

        public void g(String str) {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                recyclerView.o(str);
            }
        }

        public int g0() {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                return recyclerView.getPaddingTop();
            }
            return 0;
        }

        boolean g1(int i3, Bundle bundle) {
            RecyclerView recyclerView = this.f2756b;
            return h1(recyclerView.f2655f, recyclerView.f2666k0, i3, bundle);
        }

        public void h(View view, int i3) {
            i(view, i3, (p) view.getLayoutParams());
        }

        public int h0(View view) {
            return ((p) view.getLayoutParams()).a();
        }

        public boolean h1(v vVar, a0 a0Var, int i3, Bundle bundle) {
            int iW;
            int iO0;
            int i4;
            int i5;
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView == null) {
                return false;
            }
            if (i3 == 4096) {
                iW = recyclerView.canScrollVertically(1) ? (W() - g0()) - d0() : 0;
                if (this.f2756b.canScrollHorizontally(1)) {
                    iO0 = (o0() - e0()) - f0();
                    i4 = iW;
                    i5 = iO0;
                }
                i4 = iW;
                i5 = 0;
            } else if (i3 != 8192) {
                i5 = 0;
                i4 = 0;
            } else {
                iW = recyclerView.canScrollVertically(-1) ? -((W() - g0()) - d0()) : 0;
                if (this.f2756b.canScrollHorizontally(-1)) {
                    iO0 = -((o0() - e0()) - f0());
                    i4 = iW;
                    i5 = iO0;
                }
                i4 = iW;
                i5 = 0;
            }
            if (i4 == 0 && i5 == 0) {
                return false;
            }
            this.f2756b.n1(i5, i4, null, Integer.MIN_VALUE, true);
            return true;
        }

        public void i(View view, int i3, p pVar) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0.v()) {
                this.f2756b.f2663j.b(d0VarF0);
            } else {
                this.f2756b.f2663j.p(d0VarF0);
            }
            this.f2755a.c(view, i3, pVar, d0VarF0.v());
        }

        boolean i1(View view, int i3, Bundle bundle) {
            RecyclerView recyclerView = this.f2756b;
            return j1(recyclerView.f2655f, recyclerView.f2666k0, view, i3, bundle);
        }

        public void j(View view, Rect rect) {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView == null) {
                rect.set(0, 0, 0, 0);
            } else {
                rect.set(recyclerView.j0(view));
            }
        }

        public int j0(View view) {
            return ((p) view.getLayoutParams()).f2780b.right;
        }

        public boolean j1(v vVar, a0 a0Var, View view, int i3, Bundle bundle) {
            return false;
        }

        public boolean k() {
            return false;
        }

        public int k0(v vVar, a0 a0Var) {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView == null || recyclerView.f2673o == null || !l()) {
                return 1;
            }
            return this.f2756b.f2673o.c();
        }

        public void k1(v vVar) {
            for (int iJ = J() - 1; iJ >= 0; iJ--) {
                if (!RecyclerView.f0(I(iJ)).J()) {
                    n1(iJ, vVar);
                }
            }
        }

        public boolean l() {
            return false;
        }

        public int l0(v vVar, a0 a0Var) {
            return 0;
        }

        void l1(v vVar) {
            int iJ = vVar.j();
            for (int i3 = iJ - 1; i3 >= 0; i3--) {
                View viewN = vVar.n(i3);
                d0 d0VarF0 = RecyclerView.f0(viewN);
                if (!d0VarF0.J()) {
                    d0VarF0.G(false);
                    if (d0VarF0.x()) {
                        this.f2756b.removeDetachedView(viewN, false);
                    }
                    l lVar = this.f2756b.P;
                    if (lVar != null) {
                        lVar.j(d0VarF0);
                    }
                    d0VarF0.G(true);
                    vVar.y(viewN);
                }
            }
            vVar.e();
            if (iJ > 0) {
                this.f2756b.invalidate();
            }
        }

        public boolean m(p pVar) {
            return pVar != null;
        }

        public int m0(View view) {
            return ((p) view.getLayoutParams()).f2780b.top;
        }

        public void m1(View view, v vVar) {
            p1(view);
            vVar.B(view);
        }

        public void n0(View view, boolean z2, Rect rect) {
            Matrix matrix;
            if (z2) {
                Rect rect2 = ((p) view.getLayoutParams()).f2780b;
                rect.set(-rect2.left, -rect2.top, view.getWidth() + rect2.right, view.getHeight() + rect2.bottom);
            } else {
                rect.set(0, 0, view.getWidth(), view.getHeight());
            }
            if (this.f2756b != null && (matrix = view.getMatrix()) != null && !matrix.isIdentity()) {
                RectF rectF = this.f2756b.f2671n;
                rectF.set(rect);
                matrix.mapRect(rectF);
                rect.set((int) Math.floor(rectF.left), (int) Math.floor(rectF.top), (int) Math.ceil(rectF.right), (int) Math.ceil(rectF.bottom));
            }
            rect.offset(view.getLeft(), view.getTop());
        }

        public void n1(int i3, v vVar) {
            View viewI = I(i3);
            q1(i3);
            vVar.B(viewI);
        }

        public void o(int i3, int i4, a0 a0Var, c cVar) {
        }

        public int o0() {
            return this.f2771q;
        }

        public boolean o1(Runnable runnable) {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                return recyclerView.removeCallbacks(runnable);
            }
            return false;
        }

        public void p(int i3, c cVar) {
        }

        public int p0() {
            return this.f2769o;
        }

        public void p1(View view) {
            this.f2755a.p(view);
        }

        public int q(a0 a0Var) {
            return 0;
        }

        boolean q0() {
            int iJ = J();
            for (int i3 = 0; i3 < iJ; i3++) {
                ViewGroup.LayoutParams layoutParams = I(i3).getLayoutParams();
                if (layoutParams.width < 0 && layoutParams.height < 0) {
                    return true;
                }
            }
            return false;
        }

        public void q1(int i3) {
            if (I(i3) != null) {
                this.f2755a.q(i3);
            }
        }

        public int r(a0 a0Var) {
            return 0;
        }

        public boolean r0() {
            return this.f2763i;
        }

        public boolean r1(RecyclerView recyclerView, View view, Rect rect, boolean z2) {
            return s1(recyclerView, view, rect, z2, false);
        }

        public int s(a0 a0Var) {
            return 0;
        }

        public boolean s0() {
            return this.f2764j;
        }

        public boolean s1(RecyclerView recyclerView, View view, Rect rect, boolean z2, boolean z3) {
            int[] iArrL = L(view, rect);
            int i3 = iArrL[0];
            int i4 = iArrL[1];
            if ((z3 && !t0(recyclerView, i3, i4)) || (i3 == 0 && i4 == 0)) {
                return false;
            }
            if (z2) {
                recyclerView.scrollBy(i3, i4);
            } else {
                recyclerView.k1(i3, i4);
            }
            return true;
        }

        public int t(a0 a0Var) {
            return 0;
        }

        public void t1() {
            RecyclerView recyclerView = this.f2756b;
            if (recyclerView != null) {
                recyclerView.requestLayout();
            }
        }

        public int u(a0 a0Var) {
            return 0;
        }

        public final boolean u0() {
            return this.f2766l;
        }

        public void u1() {
            this.f2762h = true;
        }

        public int v(a0 a0Var) {
            return 0;
        }

        public boolean v0(v vVar, a0 a0Var) {
            return false;
        }

        public void w(v vVar) {
            for (int iJ = J() - 1; iJ >= 0; iJ--) {
                v1(vVar, iJ, I(iJ));
            }
        }

        public int w1(int i3, v vVar, a0 a0Var) {
            return 0;
        }

        public void x(int i3) {
            y(i3, I(i3));
        }

        public boolean x0() {
            z zVar = this.f2761g;
            return zVar != null && zVar.h();
        }

        public void x1(int i3) {
        }

        public boolean y0(View view, boolean z2, boolean z3) {
            boolean z4 = this.f2759e.b(view, 24579) && this.f2760f.b(view, 24579);
            return z2 ? z4 : !z4;
        }

        public int y1(int i3, v vVar, a0 a0Var) {
            return 0;
        }

        void z(RecyclerView recyclerView) {
            this.f2763i = true;
            G0(recyclerView);
        }

        public void z0(View view, int i3, int i4, int i5, int i6) {
            p pVar = (p) view.getLayoutParams();
            Rect rect = pVar.f2780b;
            view.layout(i3 + rect.left + ((ViewGroup.MarginLayoutParams) pVar).leftMargin, i4 + rect.top + ((ViewGroup.MarginLayoutParams) pVar).topMargin, (i5 - rect.right) - ((ViewGroup.MarginLayoutParams) pVar).rightMargin, (i6 - rect.bottom) - ((ViewGroup.MarginLayoutParams) pVar).bottomMargin);
        }

        void z1(RecyclerView recyclerView) {
            A1(View.MeasureSpec.makeMeasureSpec(recyclerView.getWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(recyclerView.getHeight(), 1073741824));
        }
    }

    public interface q {
        void a(View view);

        void b(View view);
    }

    public static abstract class r {
        public abstract boolean a(int i3, int i4);
    }

    public interface s {
        boolean a(RecyclerView recyclerView, MotionEvent motionEvent);

        void b(RecyclerView recyclerView, MotionEvent motionEvent);

        void c(boolean z2);
    }

    public static abstract class t {
        public void a(RecyclerView recyclerView, int i3) {
        }

        public void b(RecyclerView recyclerView, int i3, int i4) {
        }
    }

    public static class u {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        SparseArray<a> f2783a = new SparseArray<>();

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private int f2784b = 0;

        static class a {

            /* JADX INFO: renamed from: a, reason: collision with root package name */
            final ArrayList<d0> f2785a = new ArrayList<>();

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            int f2786b = 5;

            /* JADX INFO: renamed from: c, reason: collision with root package name */
            long f2787c = 0;

            /* JADX INFO: renamed from: d, reason: collision with root package name */
            long f2788d = 0;

            a() {
            }
        }

        private a g(int i3) {
            a aVar = this.f2783a.get(i3);
            if (aVar != null) {
                return aVar;
            }
            a aVar2 = new a();
            this.f2783a.put(i3, aVar2);
            return aVar2;
        }

        void a() {
            this.f2784b++;
        }

        public void b() {
            for (int i3 = 0; i3 < this.f2783a.size(); i3++) {
                this.f2783a.valueAt(i3).f2785a.clear();
            }
        }

        void c() {
            this.f2784b--;
        }

        void d(int i3, long j3) {
            a aVarG = g(i3);
            aVarG.f2788d = j(aVarG.f2788d, j3);
        }

        void e(int i3, long j3) {
            a aVarG = g(i3);
            aVarG.f2787c = j(aVarG.f2787c, j3);
        }

        public d0 f(int i3) {
            a aVar = this.f2783a.get(i3);
            if (aVar == null || aVar.f2785a.isEmpty()) {
                return null;
            }
            ArrayList<d0> arrayList = aVar.f2785a;
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                if (!arrayList.get(size).r()) {
                    return arrayList.remove(size);
                }
            }
            return null;
        }

        void h(g gVar, g gVar2, boolean z2) {
            if (gVar != null) {
                c();
            }
            if (!z2 && this.f2784b == 0) {
                b();
            }
            if (gVar2 != null) {
                a();
            }
        }

        public void i(d0 d0Var) {
            int iL = d0Var.l();
            ArrayList<d0> arrayList = g(iL).f2785a;
            if (this.f2783a.get(iL).f2786b <= arrayList.size()) {
                return;
            }
            d0Var.D();
            arrayList.add(d0Var);
        }

        long j(long j3, long j4) {
            return j3 == 0 ? j4 : ((j3 / 4) * 3) + (j4 / 4);
        }

        boolean k(int i3, long j3, long j4) {
            long j5 = g(i3).f2788d;
            return j5 == 0 || j3 + j5 < j4;
        }

        boolean l(int i3, long j3, long j4) {
            long j5 = g(i3).f2787c;
            return j5 == 0 || j3 + j5 < j4;
        }
    }

    public final class v {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        final ArrayList<d0> f2789a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        ArrayList<d0> f2790b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        final ArrayList<d0> f2791c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private final List<d0> f2792d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private int f2793e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        int f2794f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        u f2795g;

        public v() {
            ArrayList<d0> arrayList = new ArrayList<>();
            this.f2789a = arrayList;
            this.f2790b = null;
            this.f2791c = new ArrayList<>();
            this.f2792d = Collections.unmodifiableList(arrayList);
            this.f2793e = 2;
            this.f2794f = 2;
        }

        private boolean H(d0 d0Var, int i3, int i4, long j3) {
            d0Var.f2741r = RecyclerView.this;
            int iL = d0Var.l();
            long nanoTime = RecyclerView.this.getNanoTime();
            if (j3 != Long.MAX_VALUE && !this.f2795g.k(iL, nanoTime, j3)) {
                return false;
            }
            RecyclerView.this.f2673o.a(d0Var, i3);
            this.f2795g.d(d0Var.l(), RecyclerView.this.getNanoTime() - nanoTime);
            b(d0Var);
            if (!RecyclerView.this.f2666k0.e()) {
                return true;
            }
            d0Var.f2730g = i4;
            return true;
        }

        private void b(d0 d0Var) {
            if (RecyclerView.this.s0()) {
                View view = d0Var.f2724a;
                if (androidx.core.view.y.C(view) == 0) {
                    androidx.core.view.y.B0(view, 1);
                }
                androidx.recyclerview.widget.k kVar = RecyclerView.this.f2680r0;
                if (kVar == null) {
                    return;
                }
                androidx.core.view.a aVarN = kVar.n();
                if (aVarN instanceof k.a) {
                    ((k.a) aVarN).o(view);
                }
                androidx.core.view.y.r0(view, aVarN);
            }
        }

        private void q(ViewGroup viewGroup, boolean z2) {
            for (int childCount = viewGroup.getChildCount() - 1; childCount >= 0; childCount--) {
                View childAt = viewGroup.getChildAt(childCount);
                if (childAt instanceof ViewGroup) {
                    q((ViewGroup) childAt, true);
                }
            }
            if (z2) {
                if (viewGroup.getVisibility() == 4) {
                    viewGroup.setVisibility(0);
                    viewGroup.setVisibility(4);
                } else {
                    int visibility = viewGroup.getVisibility();
                    viewGroup.setVisibility(4);
                    viewGroup.setVisibility(visibility);
                }
            }
        }

        private void r(d0 d0Var) {
            View view = d0Var.f2724a;
            if (view instanceof ViewGroup) {
                q((ViewGroup) view, false);
            }
        }

        void A(int i3) {
            a(this.f2791c.get(i3), true);
            this.f2791c.remove(i3);
        }

        public void B(View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0.x()) {
                RecyclerView.this.removeDetachedView(view, false);
            }
            if (d0VarF0.w()) {
                d0VarF0.K();
            } else if (d0VarF0.L()) {
                d0VarF0.e();
            }
            C(d0VarF0);
            if (RecyclerView.this.P == null || d0VarF0.u()) {
                return;
            }
            RecyclerView.this.P.j(d0VarF0);
        }

        void C(d0 d0Var) {
            boolean z2;
            boolean z3 = true;
            if (d0Var.w() || d0Var.f2724a.getParent() != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("Scrapped or attached views may not be recycled. isScrap:");
                sb.append(d0Var.w());
                sb.append(" isAttached:");
                sb.append(d0Var.f2724a.getParent() != null);
                sb.append(RecyclerView.this.P());
                throw new IllegalArgumentException(sb.toString());
            }
            if (d0Var.x()) {
                throw new IllegalArgumentException("Tmp detached view should be removed from RecyclerView before it can be recycled: " + d0Var + RecyclerView.this.P());
            }
            if (d0Var.J()) {
                throw new IllegalArgumentException("Trying to recycle an ignored view holder. You should first call stopIgnoringView(view) before calling recycle." + RecyclerView.this.P());
            }
            boolean zH = d0Var.h();
            g gVar = RecyclerView.this.f2673o;
            if ((gVar != null && zH && gVar.n(d0Var)) || d0Var.u()) {
                if (this.f2794f <= 0 || d0Var.p(526)) {
                    z2 = false;
                } else {
                    int size = this.f2791c.size();
                    if (size >= this.f2794f && size > 0) {
                        A(0);
                        size--;
                    }
                    if (RecyclerView.E0 && size > 0 && !RecyclerView.this.f2664j0.d(d0Var.f2726c)) {
                        int i3 = size - 1;
                        while (i3 >= 0) {
                            if (!RecyclerView.this.f2664j0.d(this.f2791c.get(i3).f2726c)) {
                                break;
                            } else {
                                i3--;
                            }
                        }
                        size = i3 + 1;
                    }
                    this.f2791c.add(size, d0Var);
                    z2 = true;
                }
                if (z2) {
                    z3 = false;
                } else {
                    a(d0Var, true);
                }
                z = z2;
            } else {
                z3 = false;
            }
            RecyclerView.this.f2663j.q(d0Var);
            if (z || z3 || !zH) {
                return;
            }
            d0Var.f2741r = null;
        }

        void D(View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (!d0VarF0.p(12) && d0VarF0.y() && !RecyclerView.this.p(d0VarF0)) {
                if (this.f2790b == null) {
                    this.f2790b = new ArrayList<>();
                }
                d0VarF0.H(this, true);
                this.f2790b.add(d0VarF0);
                return;
            }
            if (!d0VarF0.t() || d0VarF0.v() || RecyclerView.this.f2673o.g()) {
                d0VarF0.H(this, false);
                this.f2789a.add(d0VarF0);
            } else {
                throw new IllegalArgumentException("Called scrap view with an invalid view. Invalid views cannot be reused from scrap, they should rebound from recycler pool." + RecyclerView.this.P());
            }
        }

        void E(u uVar) {
            u uVar2 = this.f2795g;
            if (uVar2 != null) {
                uVar2.c();
            }
            this.f2795g = uVar;
            if (uVar == null || RecyclerView.this.getAdapter() == null) {
                return;
            }
            this.f2795g.a();
        }

        void F(b0 b0Var) {
        }

        public void G(int i3) {
            this.f2793e = i3;
            K();
        }

        /* JADX WARN: Removed duplicated region for block: B:18:0x0037  */
        /* JADX WARN: Removed duplicated region for block: B:27:0x005c  */
        /* JADX WARN: Removed duplicated region for block: B:29:0x005f  */
        /* JADX WARN: Removed duplicated region for block: B:59:0x012c A[PHI: r1 r4
          0x012c: PHI (r1v12 androidx.recyclerview.widget.RecyclerView$d0) = (r1v11 androidx.recyclerview.widget.RecyclerView$d0), (r1v30 androidx.recyclerview.widget.RecyclerView$d0) binds: [B:28:0x005d, B:45:0x00ad] A[DONT_GENERATE, DONT_INLINE]
          0x012c: PHI (r4v3 boolean) = (r4v2 boolean), (r4v7 boolean) binds: [B:28:0x005d, B:45:0x00ad] A[DONT_GENERATE, DONT_INLINE]] */
        /* JADX WARN: Removed duplicated region for block: B:68:0x014d  */
        /* JADX WARN: Removed duplicated region for block: B:74:0x0179  */
        /* JADX WARN: Removed duplicated region for block: B:85:0x01a9  */
        /* JADX WARN: Removed duplicated region for block: B:86:0x01b7  */
        /* JADX WARN: Removed duplicated region for block: B:92:0x01d3 A[ADDED_TO_REGION] */
        /* JADX WARN: Removed duplicated region for block: B:94:0x01d6  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        androidx.recyclerview.widget.RecyclerView.d0 I(int r17, boolean r18, long r19) {
            /*
                Method dump skipped, instruction units count: 530
                To view this dump add '--comments-level debug' option
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.v.I(int, boolean, long):androidx.recyclerview.widget.RecyclerView$d0");
        }

        void J(d0 d0Var) {
            if (d0Var.f2738o) {
                this.f2790b.remove(d0Var);
            } else {
                this.f2789a.remove(d0Var);
            }
            d0Var.f2737n = null;
            d0Var.f2738o = false;
            d0Var.e();
        }

        void K() {
            o oVar = RecyclerView.this.f2675p;
            this.f2794f = this.f2793e + (oVar != null ? oVar.f2767m : 0);
            for (int size = this.f2791c.size() - 1; size >= 0 && this.f2791c.size() > this.f2794f; size--) {
                A(size);
            }
        }

        boolean L(d0 d0Var) {
            if (d0Var.v()) {
                return RecyclerView.this.f2666k0.e();
            }
            int i3 = d0Var.f2726c;
            if (i3 >= 0 && i3 < RecyclerView.this.f2673o.c()) {
                if (RecyclerView.this.f2666k0.e() || RecyclerView.this.f2673o.e(d0Var.f2726c) == d0Var.l()) {
                    return !RecyclerView.this.f2673o.g() || d0Var.k() == RecyclerView.this.f2673o.d(d0Var.f2726c);
                }
                return false;
            }
            throw new IndexOutOfBoundsException("Inconsistency detected. Invalid view holder adapter position" + d0Var + RecyclerView.this.P());
        }

        void M(int i3, int i4) {
            int i5;
            int i6 = i4 + i3;
            for (int size = this.f2791c.size() - 1; size >= 0; size--) {
                d0 d0Var = this.f2791c.get(size);
                if (d0Var != null && (i5 = d0Var.f2726c) >= i3 && i5 < i6) {
                    d0Var.b(2);
                    A(size);
                }
            }
        }

        void a(d0 d0Var, boolean z2) {
            RecyclerView.r(d0Var);
            View view = d0Var.f2724a;
            androidx.recyclerview.widget.k kVar = RecyclerView.this.f2680r0;
            if (kVar != null) {
                androidx.core.view.a aVarN = kVar.n();
                androidx.core.view.y.r0(view, aVarN instanceof k.a ? ((k.a) aVarN).n(view) : null);
            }
            if (z2) {
                g(d0Var);
            }
            d0Var.f2741r = null;
            i().i(d0Var);
        }

        public void c() {
            this.f2789a.clear();
            z();
        }

        void d() {
            int size = this.f2791c.size();
            for (int i3 = 0; i3 < size; i3++) {
                this.f2791c.get(i3).c();
            }
            int size2 = this.f2789a.size();
            for (int i4 = 0; i4 < size2; i4++) {
                this.f2789a.get(i4).c();
            }
            ArrayList<d0> arrayList = this.f2790b;
            if (arrayList != null) {
                int size3 = arrayList.size();
                for (int i5 = 0; i5 < size3; i5++) {
                    this.f2790b.get(i5).c();
                }
            }
        }

        void e() {
            this.f2789a.clear();
            ArrayList<d0> arrayList = this.f2790b;
            if (arrayList != null) {
                arrayList.clear();
            }
        }

        public int f(int i3) {
            if (i3 >= 0 && i3 < RecyclerView.this.f2666k0.b()) {
                return !RecyclerView.this.f2666k0.e() ? i3 : RecyclerView.this.f2659h.m(i3);
            }
            throw new IndexOutOfBoundsException("invalid position " + i3 + ". State item count is " + RecyclerView.this.f2666k0.b() + RecyclerView.this.P());
        }

        void g(d0 d0Var) {
            w wVar = RecyclerView.this.f2677q;
            if (wVar != null) {
                wVar.a(d0Var);
            }
            g gVar = RecyclerView.this.f2673o;
            if (gVar != null) {
                gVar.q(d0Var);
            }
            RecyclerView recyclerView = RecyclerView.this;
            if (recyclerView.f2666k0 != null) {
                recyclerView.f2663j.q(d0Var);
            }
        }

        d0 h(int i3) {
            int size;
            int iM;
            ArrayList<d0> arrayList = this.f2790b;
            if (arrayList != null && (size = arrayList.size()) != 0) {
                for (int i4 = 0; i4 < size; i4++) {
                    d0 d0Var = this.f2790b.get(i4);
                    if (!d0Var.L() && d0Var.m() == i3) {
                        d0Var.b(32);
                        return d0Var;
                    }
                }
                if (RecyclerView.this.f2673o.g() && (iM = RecyclerView.this.f2659h.m(i3)) > 0 && iM < RecyclerView.this.f2673o.c()) {
                    long jD = RecyclerView.this.f2673o.d(iM);
                    for (int i5 = 0; i5 < size; i5++) {
                        d0 d0Var2 = this.f2790b.get(i5);
                        if (!d0Var2.L() && d0Var2.k() == jD) {
                            d0Var2.b(32);
                            return d0Var2;
                        }
                    }
                }
            }
            return null;
        }

        u i() {
            if (this.f2795g == null) {
                this.f2795g = new u();
            }
            return this.f2795g;
        }

        int j() {
            return this.f2789a.size();
        }

        public List<d0> k() {
            return this.f2792d;
        }

        d0 l(long j3, int i3, boolean z2) {
            for (int size = this.f2789a.size() - 1; size >= 0; size--) {
                d0 d0Var = this.f2789a.get(size);
                if (d0Var.k() == j3 && !d0Var.L()) {
                    if (i3 == d0Var.l()) {
                        d0Var.b(32);
                        if (d0Var.v() && !RecyclerView.this.f2666k0.e()) {
                            d0Var.F(2, 14);
                        }
                        return d0Var;
                    }
                    if (!z2) {
                        this.f2789a.remove(size);
                        RecyclerView.this.removeDetachedView(d0Var.f2724a, false);
                        y(d0Var.f2724a);
                    }
                }
            }
            int size2 = this.f2791c.size();
            while (true) {
                size2--;
                if (size2 < 0) {
                    return null;
                }
                d0 d0Var2 = this.f2791c.get(size2);
                if (d0Var2.k() == j3 && !d0Var2.r()) {
                    if (i3 == d0Var2.l()) {
                        if (!z2) {
                            this.f2791c.remove(size2);
                        }
                        return d0Var2;
                    }
                    if (!z2) {
                        A(size2);
                        return null;
                    }
                }
            }
        }

        d0 m(int i3, boolean z2) {
            View viewE;
            int size = this.f2789a.size();
            for (int i4 = 0; i4 < size; i4++) {
                d0 d0Var = this.f2789a.get(i4);
                if (!d0Var.L() && d0Var.m() == i3 && !d0Var.t() && (RecyclerView.this.f2666k0.f2705h || !d0Var.v())) {
                    d0Var.b(32);
                    return d0Var;
                }
            }
            if (z2 || (viewE = RecyclerView.this.f2661i.e(i3)) == null) {
                int size2 = this.f2791c.size();
                for (int i5 = 0; i5 < size2; i5++) {
                    d0 d0Var2 = this.f2791c.get(i5);
                    if (!d0Var2.t() && d0Var2.m() == i3 && !d0Var2.r()) {
                        if (!z2) {
                            this.f2791c.remove(i5);
                        }
                        return d0Var2;
                    }
                }
                return null;
            }
            d0 d0VarF0 = RecyclerView.f0(viewE);
            RecyclerView.this.f2661i.s(viewE);
            int iM = RecyclerView.this.f2661i.m(viewE);
            if (iM != -1) {
                RecyclerView.this.f2661i.d(iM);
                D(viewE);
                d0VarF0.b(8224);
                return d0VarF0;
            }
            throw new IllegalStateException("layout index should not be -1 after unhiding a view:" + d0VarF0 + RecyclerView.this.P());
        }

        View n(int i3) {
            return this.f2789a.get(i3).f2724a;
        }

        public View o(int i3) {
            return p(i3, false);
        }

        View p(int i3, boolean z2) {
            return I(i3, z2, Long.MAX_VALUE).f2724a;
        }

        void s() {
            int size = this.f2791c.size();
            for (int i3 = 0; i3 < size; i3++) {
                p pVar = (p) this.f2791c.get(i3).f2724a.getLayoutParams();
                if (pVar != null) {
                    pVar.f2781c = true;
                }
            }
        }

        void t() {
            int size = this.f2791c.size();
            for (int i3 = 0; i3 < size; i3++) {
                d0 d0Var = this.f2791c.get(i3);
                if (d0Var != null) {
                    d0Var.b(6);
                    d0Var.a(null);
                }
            }
            g gVar = RecyclerView.this.f2673o;
            if (gVar == null || !gVar.g()) {
                z();
            }
        }

        void u(int i3, int i4) {
            int size = this.f2791c.size();
            for (int i5 = 0; i5 < size; i5++) {
                d0 d0Var = this.f2791c.get(i5);
                if (d0Var != null && d0Var.f2726c >= i3) {
                    d0Var.A(i4, true);
                }
            }
        }

        void v(int i3, int i4) {
            int i5;
            int i6;
            int i7;
            int i8;
            if (i3 < i4) {
                i5 = -1;
                i7 = i3;
                i6 = i4;
            } else {
                i5 = 1;
                i6 = i3;
                i7 = i4;
            }
            int size = this.f2791c.size();
            for (int i9 = 0; i9 < size; i9++) {
                d0 d0Var = this.f2791c.get(i9);
                if (d0Var != null && (i8 = d0Var.f2726c) >= i7 && i8 <= i6) {
                    if (i8 == i3) {
                        d0Var.A(i4 - i3, false);
                    } else {
                        d0Var.A(i5, false);
                    }
                }
            }
        }

        void w(int i3, int i4, boolean z2) {
            int i5 = i3 + i4;
            for (int size = this.f2791c.size() - 1; size >= 0; size--) {
                d0 d0Var = this.f2791c.get(size);
                if (d0Var != null) {
                    int i6 = d0Var.f2726c;
                    if (i6 >= i5) {
                        d0Var.A(-i4, z2);
                    } else if (i6 >= i3) {
                        d0Var.b(8);
                        A(size);
                    }
                }
            }
        }

        void x(g gVar, g gVar2, boolean z2) {
            c();
            i().h(gVar, gVar2, z2);
        }

        void y(View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            d0VarF0.f2737n = null;
            d0VarF0.f2738o = false;
            d0VarF0.e();
            C(d0VarF0);
        }

        void z() {
            for (int size = this.f2791c.size() - 1; size >= 0; size--) {
                A(size);
            }
            this.f2791c.clear();
            if (RecyclerView.E0) {
                RecyclerView.this.f2664j0.b();
            }
        }
    }

    public interface w {
        void a(d0 d0Var);
    }

    private class x extends i {
        x() {
        }

        @Override // androidx.recyclerview.widget.RecyclerView.i
        public void a() {
            RecyclerView.this.o(null);
            RecyclerView recyclerView = RecyclerView.this;
            recyclerView.f2666k0.f2704g = true;
            recyclerView.O0(true);
            if (RecyclerView.this.f2659h.p()) {
                return;
            }
            RecyclerView.this.requestLayout();
        }
    }

    public static abstract class z {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private RecyclerView f2800b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private o f2801c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private boolean f2802d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private boolean f2803e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private View f2804f;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        private boolean f2806h;

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private int f2799a = -1;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final a f2805g = new a(0, 0);

        public static class a {

            /* JADX INFO: renamed from: a, reason: collision with root package name */
            private int f2807a;

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            private int f2808b;

            /* JADX INFO: renamed from: c, reason: collision with root package name */
            private int f2809c;

            /* JADX INFO: renamed from: d, reason: collision with root package name */
            private int f2810d;

            /* JADX INFO: renamed from: e, reason: collision with root package name */
            private Interpolator f2811e;

            /* JADX INFO: renamed from: f, reason: collision with root package name */
            private boolean f2812f;

            /* JADX INFO: renamed from: g, reason: collision with root package name */
            private int f2813g;

            public a(int i3, int i4) {
                this(i3, i4, Integer.MIN_VALUE, null);
            }

            private void e() {
                if (this.f2811e != null && this.f2809c < 1) {
                    throw new IllegalStateException("If you provide an interpolator, you must set a positive duration");
                }
                if (this.f2809c < 1) {
                    throw new IllegalStateException("Scroll duration must be a positive number");
                }
            }

            boolean a() {
                return this.f2810d >= 0;
            }

            public void b(int i3) {
                this.f2810d = i3;
            }

            void c(RecyclerView recyclerView) {
                int i3 = this.f2810d;
                if (i3 >= 0) {
                    this.f2810d = -1;
                    recyclerView.v0(i3);
                    this.f2812f = false;
                } else {
                    if (!this.f2812f) {
                        this.f2813g = 0;
                        return;
                    }
                    e();
                    recyclerView.f2660h0.f(this.f2807a, this.f2808b, this.f2809c, this.f2811e);
                    int i4 = this.f2813g + 1;
                    this.f2813g = i4;
                    if (i4 > 10) {
                        Log.e("RecyclerView", "Smooth Scroll action is being updated too frequently. Make sure you are not changing it unless necessary");
                    }
                    this.f2812f = false;
                }
            }

            public void d(int i3, int i4, int i5, Interpolator interpolator) {
                this.f2807a = i3;
                this.f2808b = i4;
                this.f2809c = i5;
                this.f2811e = interpolator;
                this.f2812f = true;
            }

            public a(int i3, int i4, int i5, Interpolator interpolator) {
                this.f2810d = -1;
                this.f2812f = false;
                this.f2813g = 0;
                this.f2807a = i3;
                this.f2808b = i4;
                this.f2809c = i5;
                this.f2811e = interpolator;
            }
        }

        public interface b {
            PointF a(int i3);
        }

        public PointF a(int i3) {
            Object objE = e();
            if (objE instanceof b) {
                return ((b) objE).a(i3);
            }
            Log.w("RecyclerView", "You should override computeScrollVectorForPosition when the LayoutManager does not implement " + b.class.getCanonicalName());
            return null;
        }

        public View b(int i3) {
            return this.f2800b.f2675p.C(i3);
        }

        public int c() {
            return this.f2800b.f2675p.J();
        }

        public int d(View view) {
            return this.f2800b.d0(view);
        }

        public o e() {
            return this.f2801c;
        }

        public int f() {
            return this.f2799a;
        }

        public boolean g() {
            return this.f2802d;
        }

        public boolean h() {
            return this.f2803e;
        }

        protected void i(PointF pointF) {
            float f3 = pointF.x;
            float f4 = pointF.y;
            float fSqrt = (float) Math.sqrt((f3 * f3) + (f4 * f4));
            pointF.x /= fSqrt;
            pointF.y /= fSqrt;
        }

        void j(int i3, int i4) {
            PointF pointFA;
            RecyclerView recyclerView = this.f2800b;
            if (this.f2799a == -1 || recyclerView == null) {
                r();
            }
            if (this.f2802d && this.f2804f == null && this.f2801c != null && (pointFA = a(this.f2799a)) != null) {
                float f3 = pointFA.x;
                if (f3 != 0.0f || pointFA.y != 0.0f) {
                    recyclerView.f1((int) Math.signum(f3), (int) Math.signum(pointFA.y), null);
                }
            }
            this.f2802d = false;
            View view = this.f2804f;
            if (view != null) {
                if (d(view) == this.f2799a) {
                    o(this.f2804f, recyclerView.f2666k0, this.f2805g);
                    this.f2805g.c(recyclerView);
                    r();
                } else {
                    Log.e("RecyclerView", "Passed over target position while smooth scrolling.");
                    this.f2804f = null;
                }
            }
            if (this.f2803e) {
                l(i3, i4, recyclerView.f2666k0, this.f2805g);
                boolean zA = this.f2805g.a();
                this.f2805g.c(recyclerView);
                if (zA && this.f2803e) {
                    this.f2802d = true;
                    recyclerView.f2660h0.e();
                }
            }
        }

        protected void k(View view) {
            if (d(view) == f()) {
                this.f2804f = view;
            }
        }

        protected abstract void l(int i3, int i4, a0 a0Var, a aVar);

        protected abstract void m();

        protected abstract void n();

        protected abstract void o(View view, a0 a0Var, a aVar);

        public void p(int i3) {
            this.f2799a = i3;
        }

        void q(RecyclerView recyclerView, o oVar) {
            recyclerView.f2660h0.g();
            if (this.f2806h) {
                Log.w("RecyclerView", "An instance of " + getClass().getSimpleName() + " was started more than once. Each instance of" + getClass().getSimpleName() + " is intended to only be used once. You should create a new instance for each use.");
            }
            this.f2800b = recyclerView;
            this.f2801c = oVar;
            int i3 = this.f2799a;
            if (i3 == -1) {
                throw new IllegalArgumentException("Invalid target position");
            }
            recyclerView.f2666k0.f2698a = i3;
            this.f2803e = true;
            this.f2802d = true;
            this.f2804f = b(f());
            m();
            this.f2800b.f2660h0.e();
            this.f2806h = true;
        }

        protected final void r() {
            if (this.f2803e) {
                this.f2803e = false;
                n();
                this.f2800b.f2666k0.f2698a = -1;
                this.f2804f = null;
                this.f2799a = -1;
                this.f2802d = false;
                this.f2801c.f1(this);
                this.f2801c = null;
                this.f2800b = null;
            }
        }
    }

    static {
        int i3 = Build.VERSION.SDK_INT;
        C0 = i3 == 18 || i3 == 19 || i3 == 20;
        D0 = i3 >= 23;
        E0 = i3 >= 21;
        F0 = i3 <= 15;
        G0 = i3 <= 15;
        Class<?> cls = Integer.TYPE;
        H0 = new Class[]{Context.class, AttributeSet.class, cls, cls};
        I0 = new c();
    }

    public RecyclerView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, f0.a.f4621a);
    }

    private void A() {
        int i3 = this.C;
        this.C = 0;
        if (i3 == 0 || !s0()) {
            return;
        }
        AccessibilityEvent accessibilityEventObtain = AccessibilityEvent.obtain();
        accessibilityEventObtain.setEventType(2048);
        androidx.core.view.accessibility.b.b(accessibilityEventObtain, i3);
        sendAccessibilityEventUnchecked(accessibilityEventObtain);
    }

    private void C() {
        this.f2666k0.a(1);
        Q(this.f2666k0);
        this.f2666k0.f2707j = false;
        p1();
        this.f2663j.f();
        F0();
        N0();
        c1();
        a0 a0Var = this.f2666k0;
        a0Var.f2706i = a0Var.f2708k && this.f2674o0;
        this.f2674o0 = false;
        this.f2672n0 = false;
        a0Var.f2705h = a0Var.f2709l;
        a0Var.f2703f = this.f2673o.c();
        U(this.f2684t0);
        if (this.f2666k0.f2708k) {
            int iG = this.f2661i.g();
            for (int i3 = 0; i3 < iG; i3++) {
                d0 d0VarF0 = f0(this.f2661i.f(i3));
                if (!d0VarF0.J() && (!d0VarF0.t() || this.f2673o.g())) {
                    this.f2663j.e(d0VarF0, this.P.t(this.f2666k0, d0VarF0, l.e(d0VarF0), d0VarF0.o()));
                    if (this.f2666k0.f2706i && d0VarF0.y() && !d0VarF0.v() && !d0VarF0.J() && !d0VarF0.t()) {
                        this.f2663j.c(c0(d0VarF0), d0VarF0);
                    }
                }
            }
        }
        if (this.f2666k0.f2709l) {
            d1();
            a0 a0Var2 = this.f2666k0;
            boolean z2 = a0Var2.f2704g;
            a0Var2.f2704g = false;
            this.f2675p.X0(this.f2655f, a0Var2);
            this.f2666k0.f2704g = z2;
            for (int i4 = 0; i4 < this.f2661i.g(); i4++) {
                d0 d0VarF02 = f0(this.f2661i.f(i4));
                if (!d0VarF02.J() && !this.f2663j.i(d0VarF02)) {
                    int iE = l.e(d0VarF02);
                    boolean zP = d0VarF02.p(8192);
                    if (!zP) {
                        iE |= 4096;
                    }
                    l.c cVarT = this.P.t(this.f2666k0, d0VarF02, iE, d0VarF02.o());
                    if (zP) {
                        Q0(d0VarF02, cVarT);
                    } else {
                        this.f2663j.a(d0VarF02, cVarT);
                    }
                }
            }
            s();
        } else {
            s();
        }
        G0();
        r1(false);
        this.f2666k0.f2702e = 2;
    }

    private void D() {
        p1();
        F0();
        this.f2666k0.a(6);
        this.f2659h.j();
        this.f2666k0.f2703f = this.f2673o.c();
        a0 a0Var = this.f2666k0;
        a0Var.f2701d = 0;
        a0Var.f2705h = false;
        this.f2675p.X0(this.f2655f, a0Var);
        a0 a0Var2 = this.f2666k0;
        a0Var2.f2704g = false;
        this.f2657g = null;
        a0Var2.f2708k = a0Var2.f2708k && this.P != null;
        a0Var2.f2702e = 4;
        G0();
        r1(false);
    }

    private void E() {
        this.f2666k0.a(4);
        p1();
        F0();
        a0 a0Var = this.f2666k0;
        a0Var.f2702e = 1;
        if (a0Var.f2708k) {
            for (int iG = this.f2661i.g() - 1; iG >= 0; iG--) {
                d0 d0VarF0 = f0(this.f2661i.f(iG));
                if (!d0VarF0.J()) {
                    long jC0 = c0(d0VarF0);
                    l.c cVarS = this.P.s(this.f2666k0, d0VarF0);
                    d0 d0VarG = this.f2663j.g(jC0);
                    if (d0VarG == null || d0VarG.J()) {
                        this.f2663j.d(d0VarF0, cVarS);
                    } else {
                        boolean zH = this.f2663j.h(d0VarG);
                        boolean zH2 = this.f2663j.h(d0VarF0);
                        if (zH && d0VarG == d0VarF0) {
                            this.f2663j.d(d0VarF0, cVarS);
                        } else {
                            l.c cVarN = this.f2663j.n(d0VarG);
                            this.f2663j.d(d0VarF0, cVarS);
                            l.c cVarM = this.f2663j.m(d0VarF0);
                            if (cVarN == null) {
                                k0(jC0, d0VarF0, d0VarG);
                            } else {
                                m(d0VarG, d0VarF0, cVarN, cVarM, zH, zH2);
                            }
                        }
                    }
                }
            }
            this.f2663j.o(this.A0);
        }
        this.f2675p.l1(this.f2655f);
        a0 a0Var2 = this.f2666k0;
        a0Var2.f2700c = a0Var2.f2703f;
        this.G = false;
        this.H = false;
        a0Var2.f2708k = false;
        a0Var2.f2709l = false;
        this.f2675p.f2762h = false;
        ArrayList<d0> arrayList = this.f2655f.f2790b;
        if (arrayList != null) {
            arrayList.clear();
        }
        o oVar = this.f2675p;
        if (oVar.f2768n) {
            oVar.f2767m = 0;
            oVar.f2768n = false;
            this.f2655f.K();
        }
        this.f2675p.Y0(this.f2666k0);
        G0();
        r1(false);
        this.f2663j.f();
        int[] iArr = this.f2684t0;
        if (x(iArr[0], iArr[1])) {
            I(0, 0);
        }
        R0();
        a1();
    }

    private void I0(MotionEvent motionEvent) {
        int actionIndex = motionEvent.getActionIndex();
        if (motionEvent.getPointerId(actionIndex) == this.R) {
            int i3 = actionIndex == 0 ? 1 : 0;
            this.R = motionEvent.getPointerId(i3);
            int x2 = (int) (motionEvent.getX(i3) + 0.5f);
            this.V = x2;
            this.T = x2;
            int y2 = (int) (motionEvent.getY(i3) + 0.5f);
            this.W = y2;
            this.U = y2;
        }
    }

    private boolean K(MotionEvent motionEvent) {
        s sVar = this.f2683t;
        if (sVar == null) {
            if (motionEvent.getAction() == 0) {
                return false;
            }
            return T(motionEvent);
        }
        sVar.b(this, motionEvent);
        int action = motionEvent.getAction();
        if (action == 3 || action == 1) {
            this.f2683t = null;
        }
        return true;
    }

    private boolean M0() {
        return this.P != null && this.f2675p.L1();
    }

    private void N0() {
        boolean z2;
        if (this.G) {
            this.f2659h.u();
            if (this.H) {
                this.f2675p.S0(this);
            }
        }
        if (M0()) {
            this.f2659h.s();
        } else {
            this.f2659h.j();
        }
        boolean z3 = false;
        boolean z4 = this.f2672n0 || this.f2674o0;
        this.f2666k0.f2708k = this.f2691x && this.P != null && ((z2 = this.G) || z4 || this.f2675p.f2762h) && (!z2 || this.f2673o.g());
        a0 a0Var = this.f2666k0;
        if (a0Var.f2708k && z4 && !this.G && M0()) {
            z3 = true;
        }
        a0Var.f2709l = z3;
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x0040  */
    /* JADX WARN: Removed duplicated region for block: B:13:0x0056  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    private void P0(float r7, float r8, float r9, float r10) {
        /*
            r6 = this;
            r0 = 0
            int r1 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1))
            r2 = 1065353216(0x3f800000, float:1.0)
            r3 = 1
            if (r1 >= 0) goto L21
            r6.M()
            android.widget.EdgeEffect r1 = r6.L
            float r4 = -r8
            int r5 = r6.getWidth()
            float r5 = (float) r5
            float r4 = r4 / r5
            int r5 = r6.getHeight()
            float r5 = (float) r5
            float r9 = r9 / r5
            float r9 = r2 - r9
            androidx.core.widget.e.c(r1, r4, r9)
        L1f:
            r9 = r3
            goto L3c
        L21:
            int r1 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1))
            if (r1 <= 0) goto L3b
            r6.N()
            android.widget.EdgeEffect r1 = r6.N
            int r4 = r6.getWidth()
            float r4 = (float) r4
            float r4 = r8 / r4
            int r5 = r6.getHeight()
            float r5 = (float) r5
            float r9 = r9 / r5
            androidx.core.widget.e.c(r1, r4, r9)
            goto L1f
        L3b:
            r9 = 0
        L3c:
            int r1 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
            if (r1 >= 0) goto L56
            r6.O()
            android.widget.EdgeEffect r9 = r6.M
            float r1 = -r10
            int r2 = r6.getHeight()
            float r2 = (float) r2
            float r1 = r1 / r2
            int r2 = r6.getWidth()
            float r2 = (float) r2
            float r7 = r7 / r2
            androidx.core.widget.e.c(r9, r1, r7)
            goto L72
        L56:
            int r1 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
            if (r1 <= 0) goto L71
            r6.L()
            android.widget.EdgeEffect r9 = r6.O
            int r1 = r6.getHeight()
            float r1 = (float) r1
            float r1 = r10 / r1
            int r4 = r6.getWidth()
            float r4 = (float) r4
            float r7 = r7 / r4
            float r2 = r2 - r7
            androidx.core.widget.e.c(r9, r1, r2)
            goto L72
        L71:
            r3 = r9
        L72:
            if (r3 != 0) goto L7c
            int r7 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1))
            if (r7 != 0) goto L7c
            int r7 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
            if (r7 == 0) goto L7f
        L7c:
            androidx.core.view.y.i0(r6)
        L7f:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.P0(float, float, float, float):void");
    }

    private void R0() {
        View viewFindViewById;
        if (!this.f2658g0 || this.f2673o == null || !hasFocus() || getDescendantFocusability() == 393216) {
            return;
        }
        if (getDescendantFocusability() == 131072 && isFocused()) {
            return;
        }
        if (!isFocused()) {
            View focusedChild = getFocusedChild();
            if (!G0 || (focusedChild.getParent() != null && focusedChild.hasFocus())) {
                if (!this.f2661i.n(focusedChild)) {
                    return;
                }
            } else if (this.f2661i.g() == 0) {
                requestFocus();
                return;
            }
        }
        View viewW = null;
        d0 d0VarY = (this.f2666k0.f2711n == -1 || !this.f2673o.g()) ? null : Y(this.f2666k0.f2711n);
        if (d0VarY != null && !this.f2661i.n(d0VarY.f2724a) && d0VarY.f2724a.hasFocusable()) {
            viewW = d0VarY.f2724a;
        } else if (this.f2661i.g() > 0) {
            viewW = W();
        }
        if (viewW != null) {
            int i3 = this.f2666k0.f2712o;
            if (i3 != -1 && (viewFindViewById = viewW.findViewById(i3)) != null && viewFindViewById.isFocusable()) {
                viewW = viewFindViewById;
            }
            viewW.requestFocus();
        }
    }

    private void S0() {
        boolean zIsFinished;
        EdgeEffect edgeEffect = this.L;
        if (edgeEffect != null) {
            edgeEffect.onRelease();
            zIsFinished = this.L.isFinished();
        } else {
            zIsFinished = false;
        }
        EdgeEffect edgeEffect2 = this.M;
        if (edgeEffect2 != null) {
            edgeEffect2.onRelease();
            zIsFinished |= this.M.isFinished();
        }
        EdgeEffect edgeEffect3 = this.N;
        if (edgeEffect3 != null) {
            edgeEffect3.onRelease();
            zIsFinished |= this.N.isFinished();
        }
        EdgeEffect edgeEffect4 = this.O;
        if (edgeEffect4 != null) {
            edgeEffect4.onRelease();
            zIsFinished |= this.O.isFinished();
        }
        if (zIsFinished) {
            androidx.core.view.y.i0(this);
        }
    }

    private boolean T(MotionEvent motionEvent) {
        int action = motionEvent.getAction();
        int size = this.f2681s.size();
        for (int i3 = 0; i3 < size; i3++) {
            s sVar = this.f2681s.get(i3);
            if (sVar.a(this, motionEvent) && action != 3) {
                this.f2683t = sVar;
                return true;
            }
        }
        return false;
    }

    private void U(int[] iArr) {
        int iG = this.f2661i.g();
        if (iG == 0) {
            iArr[0] = -1;
            iArr[1] = -1;
            return;
        }
        int i3 = Integer.MAX_VALUE;
        int i4 = Integer.MIN_VALUE;
        for (int i5 = 0; i5 < iG; i5++) {
            d0 d0VarF0 = f0(this.f2661i.f(i5));
            if (!d0VarF0.J()) {
                int iM = d0VarF0.m();
                if (iM < i3) {
                    i3 = iM;
                }
                if (iM > i4) {
                    i4 = iM;
                }
            }
        }
        iArr[0] = i3;
        iArr[1] = i4;
    }

    static RecyclerView V(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 i3 = 0; i3 < childCount; i3++) {
            RecyclerView recyclerViewV = V(viewGroup.getChildAt(i3));
            if (recyclerViewV != null) {
                return recyclerViewV;
            }
        }
        return null;
    }

    private View W() {
        d0 d0VarX;
        a0 a0Var = this.f2666k0;
        int i3 = a0Var.f2710m;
        if (i3 == -1) {
            i3 = 0;
        }
        int iB = a0Var.b();
        for (int i4 = i3; i4 < iB; i4++) {
            d0 d0VarX2 = X(i4);
            if (d0VarX2 == null) {
                break;
            }
            if (d0VarX2.f2724a.hasFocusable()) {
                return d0VarX2.f2724a;
            }
        }
        int iMin = Math.min(iB, i3);
        do {
            iMin--;
            if (iMin < 0 || (d0VarX = X(iMin)) == null) {
                return null;
            }
        } while (!d0VarX.f2724a.hasFocusable());
        return d0VarX.f2724a;
    }

    private void Z0(View view, View view2) {
        View view3 = view2 != null ? view2 : view;
        this.f2667l.set(0, 0, view3.getWidth(), view3.getHeight());
        ViewGroup.LayoutParams layoutParams = view3.getLayoutParams();
        if (layoutParams instanceof p) {
            p pVar = (p) layoutParams;
            if (!pVar.f2781c) {
                Rect rect = pVar.f2780b;
                Rect rect2 = this.f2667l;
                rect2.left -= rect.left;
                rect2.right += rect.right;
                rect2.top -= rect.top;
                rect2.bottom += rect.bottom;
            }
        }
        if (view2 != null) {
            offsetDescendantRectToMyCoords(view2, this.f2667l);
            offsetRectIntoDescendantCoords(view, this.f2667l);
        }
        this.f2675p.s1(this, view, this.f2667l, !this.f2691x, view2 == null);
    }

    private void a1() {
        a0 a0Var = this.f2666k0;
        a0Var.f2711n = -1L;
        a0Var.f2710m = -1;
        a0Var.f2712o = -1;
    }

    private void b1() {
        VelocityTracker velocityTracker = this.S;
        if (velocityTracker != null) {
            velocityTracker.clear();
        }
        s1(0);
        S0();
    }

    private void c1() {
        View focusedChild = (this.f2658g0 && hasFocus() && this.f2673o != null) ? getFocusedChild() : null;
        d0 d0VarS = focusedChild != null ? S(focusedChild) : null;
        if (d0VarS == null) {
            a1();
            return;
        }
        this.f2666k0.f2711n = this.f2673o.g() ? d0VarS.k() : -1L;
        this.f2666k0.f2710m = this.G ? -1 : d0VarS.v() ? d0VarS.f2727d : d0VarS.j();
        this.f2666k0.f2712o = h0(d0VarS.f2724a);
    }

    static d0 f0(View view) {
        if (view == null) {
            return null;
        }
        return ((p) view.getLayoutParams()).f2779a;
    }

    private void g(d0 d0Var) {
        View view = d0Var.f2724a;
        boolean z2 = view.getParent() == this;
        this.f2655f.J(e0(view));
        if (d0Var.x()) {
            this.f2661i.c(view, -1, view.getLayoutParams(), true);
        } else if (z2) {
            this.f2661i.k(view);
        } else {
            this.f2661i.b(view, true);
        }
    }

    static void g0(View view, Rect rect) {
        p pVar = (p) view.getLayoutParams();
        Rect rect2 = pVar.f2780b;
        rect.set((view.getLeft() - rect2.left) - ((ViewGroup.MarginLayoutParams) pVar).leftMargin, (view.getTop() - rect2.top) - ((ViewGroup.MarginLayoutParams) pVar).topMargin, view.getRight() + rect2.right + ((ViewGroup.MarginLayoutParams) pVar).rightMargin, view.getBottom() + rect2.bottom + ((ViewGroup.MarginLayoutParams) pVar).bottomMargin);
    }

    private androidx.core.view.n getScrollingChildHelper() {
        if (this.f2686u0 == null) {
            this.f2686u0 = new androidx.core.view.n(this);
        }
        return this.f2686u0;
    }

    private int h0(View view) {
        int id = view.getId();
        while (!view.isFocused() && (view instanceof ViewGroup) && view.hasFocus()) {
            view = ((ViewGroup) view).getFocusedChild();
            if (view.getId() != -1) {
                id = view.getId();
            }
        }
        return id;
    }

    private void h1(g gVar, boolean z2, boolean z3) {
        g gVar2 = this.f2673o;
        if (gVar2 != null) {
            gVar2.t(this.f2653e);
            this.f2673o.m(this);
        }
        if (!z2 || z3) {
            T0();
        }
        this.f2659h.u();
        g gVar3 = this.f2673o;
        this.f2673o = gVar;
        if (gVar != null) {
            gVar.r(this.f2653e);
            gVar.i(this);
        }
        o oVar = this.f2675p;
        if (oVar != null) {
            oVar.E0(gVar3, this.f2673o);
        }
        this.f2655f.x(gVar3, this.f2673o, z2);
        this.f2666k0.f2704g = true;
    }

    private String i0(Context context, String str) {
        if (str.charAt(0) == '.') {
            return context.getPackageName() + str;
        }
        if (str.contains(".")) {
            return str;
        }
        return RecyclerView.class.getPackage().getName() + '.' + str;
    }

    private void k0(long j3, d0 d0Var, d0 d0Var2) {
        int iG = this.f2661i.g();
        for (int i3 = 0; i3 < iG; i3++) {
            d0 d0VarF0 = f0(this.f2661i.f(i3));
            if (d0VarF0 != d0Var && c0(d0VarF0) == j3) {
                g gVar = this.f2673o;
                if (gVar == null || !gVar.g()) {
                    throw new IllegalStateException("Two different ViewHolders have the same change ID. This might happen due to inconsistent Adapter update events or if the LayoutManager lays out the same View multiple times.\n ViewHolder 1:" + d0VarF0 + " \n View Holder 2:" + d0Var + P());
                }
                throw new IllegalStateException("Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.\n ViewHolder 1:" + d0VarF0 + " \n View Holder 2:" + d0Var + P());
            }
        }
        Log.e("RecyclerView", "Problem while matching changed view holders with the newones. The pre-layout information for the change holder " + d0Var2 + " cannot be found but it is necessary for " + d0Var + P());
    }

    private void m(d0 d0Var, d0 d0Var2, l.c cVar, l.c cVar2, boolean z2, boolean z3) {
        d0Var.G(false);
        if (z2) {
            g(d0Var);
        }
        if (d0Var != d0Var2) {
            if (z3) {
                g(d0Var2);
            }
            d0Var.f2731h = d0Var2;
            g(d0Var);
            this.f2655f.J(d0Var);
            d0Var2.G(false);
            d0Var2.f2732i = d0Var;
        }
        if (this.P.b(d0Var, d0Var2, cVar, cVar2)) {
            L0();
        }
    }

    private boolean m0() {
        int iG = this.f2661i.g();
        for (int i3 = 0; i3 < iG; i3++) {
            d0 d0VarF0 = f0(this.f2661i.f(i3));
            if (d0VarF0 != null && !d0VarF0.J() && d0VarF0.y()) {
                return true;
            }
        }
        return false;
    }

    @SuppressLint({"InlinedApi"})
    private void o0() {
        if (androidx.core.view.y.D(this) == 0) {
            androidx.core.view.y.C0(this, 8);
        }
    }

    private void p0() {
        this.f2661i = new androidx.recyclerview.widget.b(new e());
    }

    private void q() {
        b1();
        setScrollState(0);
    }

    static void r(d0 d0Var) {
        WeakReference<RecyclerView> weakReference = d0Var.f2725b;
        if (weakReference != null) {
            RecyclerView recyclerView = weakReference.get();
            while (recyclerView != null) {
                if (recyclerView == d0Var.f2724a) {
                    return;
                }
                Object parent = recyclerView.getParent();
                recyclerView = parent instanceof View ? (View) parent : null;
            }
            d0Var.f2725b = null;
        }
    }

    private boolean u0(View view, View view2, int i3) {
        int i4;
        if (view2 == null || view2 == this || R(view2) == null) {
            return false;
        }
        if (view == null || R(view) == null) {
            return true;
        }
        this.f2667l.set(0, 0, view.getWidth(), view.getHeight());
        this.f2669m.set(0, 0, view2.getWidth(), view2.getHeight());
        offsetDescendantRectToMyCoords(view, this.f2667l);
        offsetDescendantRectToMyCoords(view2, this.f2669m);
        byte b3 = -1;
        int i5 = this.f2675p.Z() == 1 ? -1 : 1;
        Rect rect = this.f2667l;
        int i6 = rect.left;
        Rect rect2 = this.f2669m;
        int i7 = rect2.left;
        if ((i6 < i7 || rect.right <= i7) && rect.right < rect2.right) {
            i4 = 1;
        } else {
            int i8 = rect.right;
            int i9 = rect2.right;
            i4 = ((i8 > i9 || i6 >= i9) && i6 > i7) ? -1 : 0;
        }
        int i10 = rect.top;
        int i11 = rect2.top;
        if ((i10 < i11 || rect.bottom <= i11) && rect.bottom < rect2.bottom) {
            b3 = 1;
        } else {
            int i12 = rect.bottom;
            int i13 = rect2.bottom;
            if ((i12 <= i13 && i10 < i13) || i10 <= i11) {
                b3 = 0;
            }
        }
        if (i3 == 1) {
            return b3 < 0 || (b3 == 0 && i4 * i5 <= 0);
        }
        if (i3 == 2) {
            return b3 > 0 || (b3 == 0 && i4 * i5 >= 0);
        }
        if (i3 == 17) {
            return i4 < 0;
        }
        if (i3 == 33) {
            return b3 < 0;
        }
        if (i3 == 66) {
            return i4 > 0;
        }
        if (i3 == 130) {
            return b3 > 0;
        }
        throw new IllegalArgumentException("Invalid direction: " + i3 + P());
    }

    private void u1() {
        this.f2660h0.g();
        o oVar = this.f2675p;
        if (oVar != null) {
            oVar.K1();
        }
    }

    private void v(Context context, String str, AttributeSet attributeSet, int i3, int i4) {
        Constructor constructor;
        if (str != null) {
            String strTrim = str.trim();
            if (strTrim.isEmpty()) {
                return;
            }
            String strI0 = i0(context, strTrim);
            try {
                Class<? extends U> clsAsSubclass = Class.forName(strI0, false, isInEditMode() ? getClass().getClassLoader() : context.getClassLoader()).asSubclass(o.class);
                Object[] objArr = null;
                try {
                    constructor = clsAsSubclass.getConstructor(H0);
                    objArr = new Object[]{context, attributeSet, Integer.valueOf(i3), Integer.valueOf(i4)};
                } catch (NoSuchMethodException e3) {
                    try {
                        constructor = clsAsSubclass.getConstructor(new Class[0]);
                    } catch (NoSuchMethodException e4) {
                        e4.initCause(e3);
                        throw new IllegalStateException(attributeSet.getPositionDescription() + ": Error creating LayoutManager " + strI0, e4);
                    }
                }
                constructor.setAccessible(true);
                setLayoutManager((o) constructor.newInstance(objArr));
            } catch (ClassCastException e5) {
                throw new IllegalStateException(attributeSet.getPositionDescription() + ": Class is not a LayoutManager " + strI0, e5);
            } catch (ClassNotFoundException e6) {
                throw new IllegalStateException(attributeSet.getPositionDescription() + ": Unable to find LayoutManager " + strI0, e6);
            } catch (IllegalAccessException e7) {
                throw new IllegalStateException(attributeSet.getPositionDescription() + ": Cannot access non-public constructor " + strI0, e7);
            } catch (InstantiationException e8) {
                throw new IllegalStateException(attributeSet.getPositionDescription() + ": Could not instantiate the LayoutManager: " + strI0, e8);
            } catch (InvocationTargetException e9) {
                throw new IllegalStateException(attributeSet.getPositionDescription() + ": Could not instantiate the LayoutManager: " + strI0, e9);
            }
        }
    }

    private boolean x(int i3, int i4) {
        U(this.f2684t0);
        int[] iArr = this.f2684t0;
        return (iArr[0] == i3 && iArr[1] == i4) ? false : true;
    }

    void A0(int i3, int i4) {
        int iJ = this.f2661i.j();
        for (int i5 = 0; i5 < iJ; i5++) {
            d0 d0VarF0 = f0(this.f2661i.i(i5));
            if (d0VarF0 != null && !d0VarF0.J() && d0VarF0.f2726c >= i3) {
                d0VarF0.A(i4, false);
                this.f2666k0.f2704g = true;
            }
        }
        this.f2655f.u(i3, i4);
        requestLayout();
    }

    void B() {
        if (this.f2673o == null) {
            Log.e("RecyclerView", "No adapter attached; skipping layout");
            return;
        }
        if (this.f2675p == null) {
            Log.e("RecyclerView", "No layout manager attached; skipping layout");
            return;
        }
        a0 a0Var = this.f2666k0;
        a0Var.f2707j = false;
        if (a0Var.f2702e == 1) {
            C();
            this.f2675p.z1(this);
            D();
        } else if (!this.f2659h.q() && this.f2675p.o0() == getWidth() && this.f2675p.W() == getHeight()) {
            this.f2675p.z1(this);
        } else {
            this.f2675p.z1(this);
            D();
        }
        E();
    }

    void B0(int i3, int i4) {
        int i5;
        int i6;
        int i7;
        int i8;
        int iJ = this.f2661i.j();
        if (i3 < i4) {
            i7 = -1;
            i6 = i3;
            i5 = i4;
        } else {
            i5 = i3;
            i6 = i4;
            i7 = 1;
        }
        for (int i9 = 0; i9 < iJ; i9++) {
            d0 d0VarF0 = f0(this.f2661i.i(i9));
            if (d0VarF0 != null && (i8 = d0VarF0.f2726c) >= i6 && i8 <= i5) {
                if (i8 == i3) {
                    d0VarF0.A(i4 - i3, false);
                } else {
                    d0VarF0.A(i7, false);
                }
                this.f2666k0.f2704g = true;
            }
        }
        this.f2655f.v(i3, i4);
        requestLayout();
    }

    void C0(int i3, int i4, boolean z2) {
        int i5 = i3 + i4;
        int iJ = this.f2661i.j();
        for (int i6 = 0; i6 < iJ; i6++) {
            d0 d0VarF0 = f0(this.f2661i.i(i6));
            if (d0VarF0 != null && !d0VarF0.J()) {
                int i7 = d0VarF0.f2726c;
                if (i7 >= i5) {
                    d0VarF0.A(-i4, z2);
                    this.f2666k0.f2704g = true;
                } else if (i7 >= i3) {
                    d0VarF0.i(i3 - 1, -i4, z2);
                    this.f2666k0.f2704g = true;
                }
            }
        }
        this.f2655f.w(i3, i4, z2);
        requestLayout();
    }

    public void D0(View view) {
    }

    public void E0(View view) {
    }

    public boolean F(int i3, int i4, int[] iArr, int[] iArr2, int i5) {
        return getScrollingChildHelper().d(i3, i4, iArr, iArr2, i5);
    }

    void F0() {
        this.I++;
    }

    public final void G(int i3, int i4, int i5, int i6, int[] iArr, int i7, int[] iArr2) {
        getScrollingChildHelper().e(i3, i4, i5, i6, iArr, i7, iArr2);
    }

    void G0() {
        H0(true);
    }

    void H(int i3) {
        o oVar = this.f2675p;
        if (oVar != null) {
            oVar.e1(i3);
        }
        J0(i3);
        t tVar = this.f2668l0;
        if (tVar != null) {
            tVar.a(this, i3);
        }
        List<t> list = this.f2670m0;
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                this.f2670m0.get(size).a(this, i3);
            }
        }
    }

    void H0(boolean z2) {
        int i3 = this.I - 1;
        this.I = i3;
        if (i3 < 1) {
            this.I = 0;
            if (z2) {
                A();
                J();
            }
        }
    }

    void I(int i3, int i4) {
        this.J++;
        int scrollX = getScrollX();
        int scrollY = getScrollY();
        onScrollChanged(scrollX, scrollY, scrollX - i3, scrollY - i4);
        K0(i3, i4);
        t tVar = this.f2668l0;
        if (tVar != null) {
            tVar.b(this, i3, i4);
        }
        List<t> list = this.f2670m0;
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                this.f2670m0.get(size).b(this, i3, i4);
            }
        }
        this.J--;
    }

    void J() {
        int i3;
        for (int size = this.f2694y0.size() - 1; size >= 0; size--) {
            d0 d0Var = this.f2694y0.get(size);
            if (d0Var.f2724a.getParent() == this && !d0Var.J() && (i3 = d0Var.f2740q) != -1) {
                androidx.core.view.y.B0(d0Var.f2724a, i3);
                d0Var.f2740q = -1;
            }
        }
        this.f2694y0.clear();
    }

    public void J0(int i3) {
    }

    public void K0(int i3, int i4) {
    }

    void L() {
        if (this.O != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.K.a(this, 3);
        this.O = edgeEffectA;
        if (this.f2665k) {
            edgeEffectA.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffectA.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    void L0() {
        if (this.f2678q0 || !this.f2685u) {
            return;
        }
        androidx.core.view.y.j0(this, this.f2696z0);
        this.f2678q0 = true;
    }

    void M() {
        if (this.L != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.K.a(this, 0);
        this.L = edgeEffectA;
        if (this.f2665k) {
            edgeEffectA.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
        } else {
            edgeEffectA.setSize(getMeasuredHeight(), getMeasuredWidth());
        }
    }

    void N() {
        if (this.N != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.K.a(this, 2);
        this.N = edgeEffectA;
        if (this.f2665k) {
            edgeEffectA.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
        } else {
            edgeEffectA.setSize(getMeasuredHeight(), getMeasuredWidth());
        }
    }

    void O() {
        if (this.M != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.K.a(this, 1);
        this.M = edgeEffectA;
        if (this.f2665k) {
            edgeEffectA.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffectA.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    void O0(boolean z2) {
        this.H = z2 | this.H;
        this.G = true;
        x0();
    }

    String P() {
        return " " + super.toString() + ", adapter:" + this.f2673o + ", layout:" + this.f2675p + ", context:" + getContext();
    }

    final void Q(a0 a0Var) {
        if (getScrollState() != 2) {
            a0Var.f2713p = 0;
            return;
        }
        OverScroller overScroller = this.f2660h0.f2717g;
        a0Var.f2713p = overScroller.getFinalX() - overScroller.getCurrX();
        overScroller.getFinalY();
        overScroller.getCurrY();
    }

    void Q0(d0 d0Var, l.c cVar) {
        d0Var.F(0, 8192);
        if (this.f2666k0.f2706i && d0Var.y() && !d0Var.v() && !d0Var.J()) {
            this.f2663j.c(c0(d0Var), d0Var);
        }
        this.f2663j.e(d0Var, cVar);
    }

    public View R(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;
    }

    public d0 S(View view) {
        View viewR = R(view);
        if (viewR == null) {
            return null;
        }
        return e0(viewR);
    }

    void T0() {
        l lVar = this.P;
        if (lVar != null) {
            lVar.k();
        }
        o oVar = this.f2675p;
        if (oVar != null) {
            oVar.k1(this.f2655f);
            this.f2675p.l1(this.f2655f);
        }
        this.f2655f.c();
    }

    boolean U0(View view) {
        p1();
        boolean zR = this.f2661i.r(view);
        if (zR) {
            d0 d0VarF0 = f0(view);
            this.f2655f.J(d0VarF0);
            this.f2655f.C(d0VarF0);
        }
        r1(!zR);
        return zR;
    }

    public void V0(n nVar) {
        o oVar = this.f2675p;
        if (oVar != null) {
            oVar.g("Cannot remove item decoration during a scroll  or layout");
        }
        this.f2679r.remove(nVar);
        if (this.f2679r.isEmpty()) {
            setWillNotDraw(getOverScrollMode() == 2);
        }
        w0();
        requestLayout();
    }

    public void W0(s sVar) {
        this.f2681s.remove(sVar);
        if (this.f2683t == sVar) {
            this.f2683t = null;
        }
    }

    public d0 X(int i3) {
        d0 d0Var = null;
        if (this.G) {
            return null;
        }
        int iJ = this.f2661i.j();
        for (int i4 = 0; i4 < iJ; i4++) {
            d0 d0VarF0 = f0(this.f2661i.i(i4));
            if (d0VarF0 != null && !d0VarF0.v() && b0(d0VarF0) == i3) {
                if (!this.f2661i.n(d0VarF0.f2724a)) {
                    return d0VarF0;
                }
                d0Var = d0VarF0;
            }
        }
        return d0Var;
    }

    public void X0(t tVar) {
        List<t> list = this.f2670m0;
        if (list != null) {
            list.remove(tVar);
        }
    }

    public d0 Y(long j3) {
        g gVar = this.f2673o;
        d0 d0Var = null;
        if (gVar != null && gVar.g()) {
            int iJ = this.f2661i.j();
            for (int i3 = 0; i3 < iJ; i3++) {
                d0 d0VarF0 = f0(this.f2661i.i(i3));
                if (d0VarF0 != null && !d0VarF0.v() && d0VarF0.k() == j3) {
                    if (!this.f2661i.n(d0VarF0.f2724a)) {
                        return d0VarF0;
                    }
                    d0Var = d0VarF0;
                }
            }
        }
        return d0Var;
    }

    void Y0() {
        d0 d0Var;
        int iG = this.f2661i.g();
        for (int i3 = 0; i3 < iG; i3++) {
            View viewF = this.f2661i.f(i3);
            d0 d0VarE0 = e0(viewF);
            if (d0VarE0 != null && (d0Var = d0VarE0.f2732i) != null) {
                View view = d0Var.f2724a;
                int left = viewF.getLeft();
                int top = viewF.getTop();
                if (left != view.getLeft() || top != view.getTop()) {
                    view.layout(left, top, view.getWidth() + left, view.getHeight() + top);
                }
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:15:0x002a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    androidx.recyclerview.widget.RecyclerView.d0 Z(int r6, boolean r7) {
        /*
            r5 = this;
            androidx.recyclerview.widget.b r0 = r5.f2661i
            int r0 = r0.j()
            r1 = 0
            r2 = 0
        L8:
            if (r2 >= r0) goto L3a
            androidx.recyclerview.widget.b r3 = r5.f2661i
            android.view.View r3 = r3.i(r2)
            androidx.recyclerview.widget.RecyclerView$d0 r3 = f0(r3)
            if (r3 == 0) goto L37
            boolean r4 = r3.v()
            if (r4 != 0) goto L37
            if (r7 == 0) goto L23
            int r4 = r3.f2726c
            if (r4 == r6) goto L2a
            goto L37
        L23:
            int r4 = r3.m()
            if (r4 == r6) goto L2a
            goto L37
        L2a:
            androidx.recyclerview.widget.b r1 = r5.f2661i
            android.view.View r4 = r3.f2724a
            boolean r1 = r1.n(r4)
            if (r1 == 0) goto L36
            r1 = r3
            goto L37
        L36:
            return r3
        L37:
            int r2 = r2 + 1
            goto L8
        L3a:
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.Z(int, boolean):androidx.recyclerview.widget.RecyclerView$d0");
    }

    void a(int i3, int i4) {
        if (i3 < 0) {
            M();
            if (this.L.isFinished()) {
                this.L.onAbsorb(-i3);
            }
        } else if (i3 > 0) {
            N();
            if (this.N.isFinished()) {
                this.N.onAbsorb(i3);
            }
        }
        if (i4 < 0) {
            O();
            if (this.M.isFinished()) {
                this.M.onAbsorb(-i4);
            }
        } else if (i4 > 0) {
            L();
            if (this.O.isFinished()) {
                this.O.onAbsorb(i4);
            }
        }
        if (i3 == 0 && i4 == 0) {
            return;
        }
        androidx.core.view.y.i0(this);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r0v1, types: [boolean] */
    /* JADX WARN: Type inference failed for: r0v5 */
    public boolean a0(int i3, int i4) {
        o oVar = this.f2675p;
        if (oVar == null) {
            Log.e("RecyclerView", "Cannot fling without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return false;
        }
        if (this.A) {
            return false;
        }
        int iK = oVar.k();
        boolean zL = this.f2675p.l();
        if (iK == 0 || Math.abs(i3) < this.f2651c0) {
            i3 = 0;
        }
        if (!zL || Math.abs(i4) < this.f2651c0) {
            i4 = 0;
        }
        if (i3 == 0 && i4 == 0) {
            return false;
        }
        float f3 = i3;
        float f4 = i4;
        if (!dispatchNestedPreFling(f3, f4)) {
            boolean z2 = iK != 0 || zL;
            dispatchNestedFling(f3, f4, z2);
            r rVar = this.f2650b0;
            if (rVar != null && rVar.a(i3, i4)) {
                return true;
            }
            if (z2) {
                if (zL) {
                    iK = (iK == true ? 1 : 0) | 2;
                }
                q1(iK, 1);
                int i5 = this.f2652d0;
                int iMax = Math.max(-i5, Math.min(i3, i5));
                int i6 = this.f2652d0;
                this.f2660h0.c(iMax, Math.max(-i6, Math.min(i4, i6)));
                return true;
            }
        }
        return false;
    }

    @Override // android.view.ViewGroup, android.view.View
    public void addFocusables(ArrayList<View> arrayList, int i3, int i4) {
        o oVar = this.f2675p;
        if (oVar == null || !oVar.F0(this, arrayList, i3, i4)) {
            super.addFocusables(arrayList, i3, i4);
        }
    }

    int b0(d0 d0Var) {
        if (d0Var.p(524) || !d0Var.s()) {
            return -1;
        }
        return this.f2659h.e(d0Var.f2726c);
    }

    long c0(d0 d0Var) {
        return this.f2673o.g() ? d0Var.k() : d0Var.f2726c;
    }

    @Override // android.view.ViewGroup
    protected boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return (layoutParams instanceof p) && this.f2675p.m((p) layoutParams);
    }

    @Override // android.view.View
    public int computeHorizontalScrollExtent() {
        o oVar = this.f2675p;
        if (oVar != null && oVar.k()) {
            return this.f2675p.q(this.f2666k0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeHorizontalScrollOffset() {
        o oVar = this.f2675p;
        if (oVar != null && oVar.k()) {
            return this.f2675p.r(this.f2666k0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeHorizontalScrollRange() {
        o oVar = this.f2675p;
        if (oVar != null && oVar.k()) {
            return this.f2675p.s(this.f2666k0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollExtent() {
        o oVar = this.f2675p;
        if (oVar != null && oVar.l()) {
            return this.f2675p.t(this.f2666k0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollOffset() {
        o oVar = this.f2675p;
        if (oVar != null && oVar.l()) {
            return this.f2675p.u(this.f2666k0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollRange() {
        o oVar = this.f2675p;
        if (oVar != null && oVar.l()) {
            return this.f2675p.v(this.f2666k0);
        }
        return 0;
    }

    public int d0(View view) {
        d0 d0VarF0 = f0(view);
        if (d0VarF0 != null) {
            return d0VarF0.m();
        }
        return -1;
    }

    void d1() {
        int iJ = this.f2661i.j();
        for (int i3 = 0; i3 < iJ; i3++) {
            d0 d0VarF0 = f0(this.f2661i.i(i3));
            if (!d0VarF0.J()) {
                d0VarF0.E();
            }
        }
    }

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

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

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

    @Override // android.view.View
    public boolean dispatchNestedScroll(int i3, int i4, int i5, int i6, int[] iArr) {
        return getScrollingChildHelper().f(i3, i4, i5, i6, iArr);
    }

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

    @Override // android.view.ViewGroup, android.view.View
    protected void dispatchRestoreInstanceState(SparseArray<Parcelable> sparseArray) {
        dispatchThawSelfOnly(sparseArray);
    }

    @Override // android.view.ViewGroup, android.view.View
    protected void dispatchSaveInstanceState(SparseArray<Parcelable> sparseArray) {
        dispatchFreezeSelfOnly(sparseArray);
    }

    @Override // android.view.View
    public void draw(Canvas canvas) {
        boolean z2;
        super.draw(canvas);
        int size = this.f2679r.size();
        boolean z3 = false;
        for (int i3 = 0; i3 < size; i3++) {
            this.f2679r.get(i3).i(canvas, this, this.f2666k0);
        }
        EdgeEffect edgeEffect = this.L;
        if (edgeEffect == null || edgeEffect.isFinished()) {
            z2 = false;
        } else {
            int iSave = canvas.save();
            int paddingBottom = this.f2665k ? getPaddingBottom() : 0;
            canvas.rotate(270.0f);
            canvas.translate((-getHeight()) + paddingBottom, 0.0f);
            EdgeEffect edgeEffect2 = this.L;
            z2 = edgeEffect2 != null && edgeEffect2.draw(canvas);
            canvas.restoreToCount(iSave);
        }
        EdgeEffect edgeEffect3 = this.M;
        if (edgeEffect3 != null && !edgeEffect3.isFinished()) {
            int iSave2 = canvas.save();
            if (this.f2665k) {
                canvas.translate(getPaddingLeft(), getPaddingTop());
            }
            EdgeEffect edgeEffect4 = this.M;
            z2 |= edgeEffect4 != null && edgeEffect4.draw(canvas);
            canvas.restoreToCount(iSave2);
        }
        EdgeEffect edgeEffect5 = this.N;
        if (edgeEffect5 != null && !edgeEffect5.isFinished()) {
            int iSave3 = canvas.save();
            int width = getWidth();
            int paddingTop = this.f2665k ? getPaddingTop() : 0;
            canvas.rotate(90.0f);
            canvas.translate(-paddingTop, -width);
            EdgeEffect edgeEffect6 = this.N;
            z2 |= edgeEffect6 != null && edgeEffect6.draw(canvas);
            canvas.restoreToCount(iSave3);
        }
        EdgeEffect edgeEffect7 = this.O;
        if (edgeEffect7 != null && !edgeEffect7.isFinished()) {
            int iSave4 = canvas.save();
            canvas.rotate(180.0f);
            if (this.f2665k) {
                canvas.translate((-getWidth()) + getPaddingRight(), (-getHeight()) + getPaddingBottom());
            } else {
                canvas.translate(-getWidth(), -getHeight());
            }
            EdgeEffect edgeEffect8 = this.O;
            if (edgeEffect8 != null && edgeEffect8.draw(canvas)) {
                z3 = true;
            }
            z2 |= z3;
            canvas.restoreToCount(iSave4);
        }
        if ((z2 || this.P == null || this.f2679r.size() <= 0 || !this.P.p()) ? z2 : true) {
            androidx.core.view.y.i0(this);
        }
    }

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

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

    boolean e1(int i3, int i4, MotionEvent motionEvent) {
        int i5;
        int i6;
        int i7;
        int i8;
        u();
        if (this.f2673o != null) {
            int[] iArr = this.f2692x0;
            iArr[0] = 0;
            iArr[1] = 0;
            f1(i3, i4, iArr);
            int[] iArr2 = this.f2692x0;
            int i9 = iArr2[0];
            int i10 = iArr2[1];
            i5 = i10;
            i6 = i9;
            i7 = i3 - i9;
            i8 = i4 - i10;
        } else {
            i5 = 0;
            i6 = 0;
            i7 = 0;
            i8 = 0;
        }
        if (!this.f2679r.isEmpty()) {
            invalidate();
        }
        int[] iArr3 = this.f2692x0;
        iArr3[0] = 0;
        iArr3[1] = 0;
        G(i6, i5, i7, i8, this.f2688v0, 0, iArr3);
        int[] iArr4 = this.f2692x0;
        int i11 = i7 - iArr4[0];
        int i12 = i8 - iArr4[1];
        boolean z2 = (iArr4[0] == 0 && iArr4[1] == 0) ? false : true;
        int i13 = this.V;
        int[] iArr5 = this.f2688v0;
        this.V = i13 - iArr5[0];
        this.W -= iArr5[1];
        int[] iArr6 = this.f2690w0;
        iArr6[0] = iArr6[0] + iArr5[0];
        iArr6[1] = iArr6[1] + iArr5[1];
        if (getOverScrollMode() != 2) {
            if (motionEvent != null && !androidx.core.view.l.a(motionEvent, 8194)) {
                P0(motionEvent.getX(), i11, motionEvent.getY(), i12);
            }
            t(i3, i4);
        }
        if (i6 != 0 || i5 != 0) {
            I(i6, i5);
        }
        if (!awakenScrollBars()) {
            invalidate();
        }
        return (!z2 && i6 == 0 && i5 == 0) ? false : true;
    }

    void f1(int i3, int i4, int[] iArr) {
        p1();
        F0();
        androidx.core.os.f.a("RV Scroll");
        Q(this.f2666k0);
        int iW1 = i3 != 0 ? this.f2675p.w1(i3, this.f2655f, this.f2666k0) : 0;
        int iY1 = i4 != 0 ? this.f2675p.y1(i4, this.f2655f, this.f2666k0) : 0;
        androidx.core.os.f.b();
        Y0();
        G0();
        r1(false);
        if (iArr != null) {
            iArr[0] = iW1;
            iArr[1] = iY1;
        }
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public View focusSearch(View view, int i3) {
        View viewJ0;
        boolean z2;
        View viewQ0 = this.f2675p.Q0(view, i3);
        if (viewQ0 != null) {
            return viewQ0;
        }
        boolean z3 = (this.f2673o == null || this.f2675p == null || t0() || this.A) ? false : true;
        FocusFinder focusFinder = FocusFinder.getInstance();
        if (z3 && (i3 == 2 || i3 == 1)) {
            if (this.f2675p.l()) {
                int i4 = i3 == 2 ? 130 : 33;
                z2 = focusFinder.findNextFocus(this, view, i4) == null;
                if (F0) {
                    i3 = i4;
                }
            } else {
                z2 = false;
            }
            if (!z2 && this.f2675p.k()) {
                int i5 = (this.f2675p.Z() == 1) ^ (i3 == 2) ? 66 : 17;
                boolean z4 = focusFinder.findNextFocus(this, view, i5) == null;
                if (F0) {
                    i3 = i5;
                }
                z2 = z4;
            }
            if (z2) {
                u();
                if (R(view) == null) {
                    return null;
                }
                p1();
                this.f2675p.J0(view, i3, this.f2655f, this.f2666k0);
                r1(false);
            }
            viewJ0 = focusFinder.findNextFocus(this, view, i3);
        } else {
            View viewFindNextFocus = focusFinder.findNextFocus(this, view, i3);
            if (viewFindNextFocus == null && z3) {
                u();
                if (R(view) == null) {
                    return null;
                }
                p1();
                viewJ0 = this.f2675p.J0(view, i3, this.f2655f, this.f2666k0);
                r1(false);
            } else {
                viewJ0 = viewFindNextFocus;
            }
        }
        if (viewJ0 == null || viewJ0.hasFocusable()) {
            return u0(view, viewJ0, i3) ? viewJ0 : super.focusSearch(view, i3);
        }
        if (getFocusedChild() == null) {
            return super.focusSearch(view, i3);
        }
        Z0(viewJ0, null);
        return view;
    }

    public void g1(int i3) {
        if (this.A) {
            return;
        }
        t1();
        o oVar = this.f2675p;
        if (oVar == null) {
            Log.e("RecyclerView", "Cannot scroll to position a LayoutManager set. Call setLayoutManager with a non-null argument.");
        } else {
            oVar.x1(i3);
            awakenScrollBars();
        }
    }

    @Override // android.view.ViewGroup
    protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
        o oVar = this.f2675p;
        if (oVar != null) {
            return oVar.D();
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + P());
    }

    @Override // android.view.ViewGroup
    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        o oVar = this.f2675p;
        if (oVar != null) {
            return oVar.E(getContext(), attributeSet);
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + P());
    }

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

    public g getAdapter() {
        return this.f2673o;
    }

    @Override // android.view.View
    public int getBaseline() {
        o oVar = this.f2675p;
        return oVar != null ? oVar.G() : super.getBaseline();
    }

    @Override // android.view.ViewGroup
    protected int getChildDrawingOrder(int i3, int i4) {
        j jVar = this.f2682s0;
        return jVar == null ? super.getChildDrawingOrder(i3, i4) : jVar.a(i3, i4);
    }

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

    public androidx.recyclerview.widget.k getCompatAccessibilityDelegate() {
        return this.f2680r0;
    }

    public k getEdgeEffectFactory() {
        return this.K;
    }

    public l getItemAnimator() {
        return this.P;
    }

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

    public o getLayoutManager() {
        return this.f2675p;
    }

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

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

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

    public r getOnFlingListener() {
        return this.f2650b0;
    }

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

    public u getRecycledViewPool() {
        return this.f2655f.i();
    }

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

    public void h(n nVar) {
        i(nVar, -1);
    }

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

    public void i(n nVar, int i3) {
        o oVar = this.f2675p;
        if (oVar != null) {
            oVar.g("Cannot add item decoration during a scroll  or layout");
        }
        if (this.f2679r.isEmpty()) {
            setWillNotDraw(false);
        }
        if (i3 < 0) {
            this.f2679r.add(nVar);
        } else {
            this.f2679r.add(i3, nVar);
        }
        w0();
        requestLayout();
    }

    boolean i1(d0 d0Var, int i3) {
        if (!t0()) {
            androidx.core.view.y.B0(d0Var.f2724a, i3);
            return true;
        }
        d0Var.f2740q = i3;
        this.f2694y0.add(d0Var);
        return false;
    }

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

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

    @Override // android.view.View, androidx.core.view.m
    public boolean isNestedScrollingEnabled() {
        return getScrollingChildHelper().l();
    }

    public void j(s sVar) {
        this.f2681s.add(sVar);
    }

    Rect j0(View view) {
        p pVar = (p) view.getLayoutParams();
        if (!pVar.f2781c) {
            return pVar.f2780b;
        }
        if (this.f2666k0.e() && (pVar.b() || pVar.d())) {
            return pVar.f2780b;
        }
        Rect rect = pVar.f2780b;
        rect.set(0, 0, 0, 0);
        int size = this.f2679r.size();
        for (int i3 = 0; i3 < size; i3++) {
            this.f2667l.set(0, 0, 0, 0);
            this.f2679r.get(i3).e(this.f2667l, view, this, this.f2666k0);
            int i4 = rect.left;
            Rect rect2 = this.f2667l;
            rect.left = i4 + rect2.left;
            rect.top += rect2.top;
            rect.right += rect2.right;
            rect.bottom += rect2.bottom;
        }
        pVar.f2781c = false;
        return rect;
    }

    boolean j1(AccessibilityEvent accessibilityEvent) {
        if (!t0()) {
            return false;
        }
        int iA = accessibilityEvent != null ? androidx.core.view.accessibility.b.a(accessibilityEvent) : 0;
        this.C |= iA != 0 ? iA : 0;
        return true;
    }

    public void k(t tVar) {
        if (this.f2670m0 == null) {
            this.f2670m0 = new ArrayList();
        }
        this.f2670m0.add(tVar);
    }

    public void k1(int i3, int i4) {
        l1(i3, i4, null);
    }

    void l(d0 d0Var, l.c cVar, l.c cVar2) {
        d0Var.G(false);
        if (this.P.a(d0Var, cVar, cVar2)) {
            L0();
        }
    }

    public boolean l0() {
        return !this.f2691x || this.G || this.f2659h.p();
    }

    public void l1(int i3, int i4, Interpolator interpolator) {
        m1(i3, i4, interpolator, Integer.MIN_VALUE);
    }

    public void m1(int i3, int i4, Interpolator interpolator, int i5) {
        n1(i3, i4, interpolator, i5, false);
    }

    void n(d0 d0Var, l.c cVar, l.c cVar2) {
        g(d0Var);
        d0Var.G(false);
        if (this.P.c(d0Var, cVar, cVar2)) {
            L0();
        }
    }

    void n0() {
        this.f2659h = new androidx.recyclerview.widget.a(new f());
    }

    void n1(int i3, int i4, Interpolator interpolator, int i5, boolean z2) {
        o oVar = this.f2675p;
        if (oVar == null) {
            Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.A) {
            return;
        }
        if (!oVar.k()) {
            i3 = 0;
        }
        if (!this.f2675p.l()) {
            i4 = 0;
        }
        if (i3 == 0 && i4 == 0) {
            return;
        }
        if (!(i5 == Integer.MIN_VALUE || i5 > 0)) {
            scrollBy(i3, i4);
            return;
        }
        if (z2) {
            int i6 = i3 != 0 ? 1 : 0;
            if (i4 != 0) {
                i6 |= 2;
            }
            q1(i6, 1);
        }
        this.f2660h0.f(i3, i4, i5, interpolator);
    }

    void o(String str) {
        if (t0()) {
            if (str != null) {
                throw new IllegalStateException(str);
            }
            throw new IllegalStateException("Cannot call this method while RecyclerView is computing a layout or scrolling" + P());
        }
        if (this.J > 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("" + P()));
        }
    }

    public void o1(int i3) {
        if (this.A) {
            return;
        }
        o oVar = this.f2675p;
        if (oVar == null) {
            Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
        } else {
            oVar.I1(this, this.f2666k0, i3);
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.I = 0;
        this.f2685u = true;
        this.f2691x = this.f2691x && !isLayoutRequested();
        o oVar = this.f2675p;
        if (oVar != null) {
            oVar.z(this);
        }
        this.f2678q0 = false;
        if (E0) {
            ThreadLocal<androidx.recyclerview.widget.e> threadLocal = androidx.recyclerview.widget.e.f2953i;
            androidx.recyclerview.widget.e eVar = threadLocal.get();
            this.f2662i0 = eVar;
            if (eVar == null) {
                this.f2662i0 = new androidx.recyclerview.widget.e();
                Display displayX = androidx.core.view.y.x(this);
                float f3 = 60.0f;
                if (!isInEditMode() && displayX != null) {
                    float refreshRate = displayX.getRefreshRate();
                    if (refreshRate >= 30.0f) {
                        f3 = refreshRate;
                    }
                }
                androidx.recyclerview.widget.e eVar2 = this.f2662i0;
                eVar2.f2957g = (long) (1.0E9f / f3);
                threadLocal.set(eVar2);
            }
            this.f2662i0.a(this);
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    protected void onDetachedFromWindow() {
        androidx.recyclerview.widget.e eVar;
        super.onDetachedFromWindow();
        l lVar = this.P;
        if (lVar != null) {
            lVar.k();
        }
        t1();
        this.f2685u = false;
        o oVar = this.f2675p;
        if (oVar != null) {
            oVar.A(this, this.f2655f);
        }
        this.f2694y0.clear();
        removeCallbacks(this.f2696z0);
        this.f2663j.j();
        if (!E0 || (eVar = this.f2662i0) == null) {
            return;
        }
        eVar.j(this);
        this.f2662i0 = null;
    }

    @Override // android.view.View
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int size = this.f2679r.size();
        for (int i3 = 0; i3 < size; i3++) {
            this.f2679r.get(i3).g(canvas, this, this.f2666k0);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:28:0x0062  */
    /* JADX WARN: Removed duplicated region for block: B:31:0x0068  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x006c  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean onGenericMotionEvent(android.view.MotionEvent r6) {
        /*
            r5 = this;
            androidx.recyclerview.widget.RecyclerView$o r0 = r5.f2675p
            r1 = 0
            if (r0 != 0) goto L6
            return r1
        L6:
            boolean r0 = r5.A
            if (r0 == 0) goto Lb
            return r1
        Lb:
            int r0 = r6.getAction()
            r2 = 8
            if (r0 != r2) goto L77
            int r0 = r6.getSource()
            r0 = r0 & 2
            r2 = 0
            if (r0 == 0) goto L3e
            androidx.recyclerview.widget.RecyclerView$o r0 = r5.f2675p
            boolean r0 = r0.l()
            if (r0 == 0) goto L2c
            r0 = 9
            float r0 = r6.getAxisValue(r0)
            float r0 = -r0
            goto L2d
        L2c:
            r0 = r2
        L2d:
            androidx.recyclerview.widget.RecyclerView$o r3 = r5.f2675p
            boolean r3 = r3.k()
            if (r3 == 0) goto L3c
            r3 = 10
            float r3 = r6.getAxisValue(r3)
            goto L64
        L3c:
            r3 = r2
            goto L64
        L3e:
            int r0 = r6.getSource()
            r3 = 4194304(0x400000, float:5.877472E-39)
            r0 = r0 & r3
            if (r0 == 0) goto L62
            r0 = 26
            float r0 = r6.getAxisValue(r0)
            androidx.recyclerview.widget.RecyclerView$o r3 = r5.f2675p
            boolean r3 = r3.l()
            if (r3 == 0) goto L57
            float r0 = -r0
            goto L3c
        L57:
            androidx.recyclerview.widget.RecyclerView$o r3 = r5.f2675p
            boolean r3 = r3.k()
            if (r3 == 0) goto L62
            r3 = r0
            r0 = r2
            goto L64
        L62:
            r0 = r2
            r3 = r0
        L64:
            int r4 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
            if (r4 != 0) goto L6c
            int r2 = (r3 > r2 ? 1 : (r3 == r2 ? 0 : -1))
            if (r2 == 0) goto L77
        L6c:
            float r2 = r5.f2654e0
            float r3 = r3 * r2
            int r2 = (int) r3
            float r3 = r5.f2656f0
            float r0 = r0 * r3
            int r0 = (int) r0
            r5.e1(r2, r0, r6)
        L77:
            return r1
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.onGenericMotionEvent(android.view.MotionEvent):boolean");
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // android.view.ViewGroup
    public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        boolean z2;
        if (this.A) {
            return false;
        }
        this.f2683t = null;
        if (T(motionEvent)) {
            q();
            return true;
        }
        o oVar = this.f2675p;
        if (oVar == null) {
            return false;
        }
        boolean zK = oVar.k();
        boolean zL = this.f2675p.l();
        if (this.S == null) {
            this.S = VelocityTracker.obtain();
        }
        this.S.addMovement(motionEvent);
        int actionMasked = motionEvent.getActionMasked();
        int actionIndex = motionEvent.getActionIndex();
        if (actionMasked == 0) {
            if (this.B) {
                this.B = false;
            }
            this.R = motionEvent.getPointerId(0);
            int x2 = (int) (motionEvent.getX() + 0.5f);
            this.V = x2;
            this.T = x2;
            int y2 = (int) (motionEvent.getY() + 0.5f);
            this.W = y2;
            this.U = y2;
            if (this.Q == 2) {
                getParent().requestDisallowInterceptTouchEvent(true);
                setScrollState(1);
                s1(1);
            }
            int[] iArr = this.f2690w0;
            iArr[1] = 0;
            iArr[0] = 0;
            int i3 = zK;
            if (zL) {
                i3 = (zK ? 1 : 0) | 2;
            }
            q1(i3, 0);
        } else if (actionMasked == 1) {
            this.S.clear();
            s1(0);
        } else if (actionMasked == 2) {
            int iFindPointerIndex = motionEvent.findPointerIndex(this.R);
            if (iFindPointerIndex < 0) {
                Log.e("RecyclerView", "Error processing scroll; pointer index for id " + this.R + " not found. Did any MotionEvents get skipped?");
                return false;
            }
            int x3 = (int) (motionEvent.getX(iFindPointerIndex) + 0.5f);
            int y3 = (int) (motionEvent.getY(iFindPointerIndex) + 0.5f);
            if (this.Q != 1) {
                int i4 = x3 - this.T;
                int i5 = y3 - this.U;
                if (!zK || Math.abs(i4) <= this.f2649a0) {
                    z2 = false;
                } else {
                    this.V = x3;
                    z2 = true;
                }
                if (zL && Math.abs(i5) > this.f2649a0) {
                    this.W = y3;
                    z2 = true;
                }
                if (z2) {
                    setScrollState(1);
                }
            }
        } else if (actionMasked == 3) {
            q();
        } else if (actionMasked == 5) {
            this.R = motionEvent.getPointerId(actionIndex);
            int x4 = (int) (motionEvent.getX(actionIndex) + 0.5f);
            this.V = x4;
            this.T = x4;
            int y4 = (int) (motionEvent.getY(actionIndex) + 0.5f);
            this.W = y4;
            this.U = y4;
        } else if (actionMasked == 6) {
            I0(motionEvent);
        }
        return this.Q == 1;
    }

    @Override // android.view.ViewGroup, android.view.View
    protected void onLayout(boolean z2, int i3, int i4, int i5, int i6) {
        androidx.core.os.f.a("RV OnLayout");
        B();
        androidx.core.os.f.b();
        this.f2691x = true;
    }

    @Override // android.view.View
    protected void onMeasure(int i3, int i4) {
        o oVar = this.f2675p;
        if (oVar == null) {
            w(i3, i4);
            return;
        }
        boolean z2 = false;
        if (oVar.s0()) {
            int mode = View.MeasureSpec.getMode(i3);
            int mode2 = View.MeasureSpec.getMode(i4);
            this.f2675p.Z0(this.f2655f, this.f2666k0, i3, i4);
            if (mode == 1073741824 && mode2 == 1073741824) {
                z2 = true;
            }
            if (z2 || this.f2673o == null) {
                return;
            }
            if (this.f2666k0.f2702e == 1) {
                C();
            }
            this.f2675p.A1(i3, i4);
            this.f2666k0.f2707j = true;
            D();
            this.f2675p.D1(i3, i4);
            if (this.f2675p.G1()) {
                this.f2675p.A1(View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), 1073741824));
                this.f2666k0.f2707j = true;
                D();
                this.f2675p.D1(i3, i4);
                return;
            }
            return;
        }
        if (this.f2687v) {
            this.f2675p.Z0(this.f2655f, this.f2666k0, i3, i4);
            return;
        }
        if (this.D) {
            p1();
            F0();
            N0();
            G0();
            a0 a0Var = this.f2666k0;
            if (a0Var.f2709l) {
                a0Var.f2705h = true;
            } else {
                this.f2659h.j();
                this.f2666k0.f2705h = false;
            }
            this.D = false;
            r1(false);
        } else if (this.f2666k0.f2709l) {
            setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight());
            return;
        }
        g gVar = this.f2673o;
        if (gVar != null) {
            this.f2666k0.f2703f = gVar.c();
        } else {
            this.f2666k0.f2703f = 0;
        }
        p1();
        this.f2675p.Z0(this.f2655f, this.f2666k0, i3, i4);
        r1(false);
        this.f2666k0.f2705h = false;
    }

    @Override // android.view.ViewGroup
    protected boolean onRequestFocusInDescendants(int i3, Rect rect) {
        if (t0()) {
            return false;
        }
        return super.onRequestFocusInDescendants(i3, rect);
    }

    @Override // android.view.View
    protected void onRestoreInstanceState(Parcelable parcelable) {
        Parcelable parcelable2;
        if (!(parcelable instanceof y)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        y yVar = (y) parcelable;
        this.f2657g = yVar;
        super.onRestoreInstanceState(yVar.j());
        o oVar = this.f2675p;
        if (oVar == null || (parcelable2 = this.f2657g.f2798g) == null) {
            return;
        }
        oVar.c1(parcelable2);
    }

    @Override // android.view.View
    protected Parcelable onSaveInstanceState() {
        y yVar = new y(super.onSaveInstanceState());
        y yVar2 = this.f2657g;
        if (yVar2 != null) {
            yVar.k(yVar2);
        } else {
            o oVar = this.f2675p;
            if (oVar != null) {
                yVar.f2798g = oVar.d1();
            } else {
                yVar.f2798g = null;
            }
        }
        return yVar;
    }

    @Override // android.view.View
    protected void onSizeChanged(int i3, int i4, int i5, int i6) {
        super.onSizeChanged(i3, i4, i5, i6);
        if (i3 == i5 && i4 == i6) {
            return;
        }
        r0();
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:47:0x00df A[PHI: r0
      0x00df: PHI (r0v36 int) = (r0v26 int), (r0v40 int) binds: [B:41:0x00c8, B:45:0x00db] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:49:0x00e2  */
    /* JADX WARN: Removed duplicated region for block: B:55:0x00f8  */
    @Override // android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean onTouchEvent(android.view.MotionEvent r18) {
        /*
            Method dump skipped, instruction units count: 480
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.onTouchEvent(android.view.MotionEvent):boolean");
    }

    boolean p(d0 d0Var) {
        l lVar = this.P;
        return lVar == null || lVar.g(d0Var, d0Var.o());
    }

    void p1() {
        int i3 = this.f2693y + 1;
        this.f2693y = i3;
        if (i3 != 1 || this.A) {
            return;
        }
        this.f2695z = false;
    }

    void q0(StateListDrawable stateListDrawable, Drawable drawable, StateListDrawable stateListDrawable2, Drawable drawable2) {
        if (stateListDrawable != null && drawable != null && stateListDrawable2 != null && drawable2 != null) {
            Resources resources = getContext().getResources();
            new androidx.recyclerview.widget.d(this, stateListDrawable, drawable, stateListDrawable2, drawable2, resources.getDimensionPixelSize(f0.b.f4622a), resources.getDimensionPixelSize(f0.b.f4624c), resources.getDimensionPixelOffset(f0.b.f4623b));
        } else {
            throw new IllegalArgumentException("Trying to set fast scroller without both required drawables." + P());
        }
    }

    public boolean q1(int i3, int i4) {
        return getScrollingChildHelper().p(i3, i4);
    }

    void r0() {
        this.O = null;
        this.M = null;
        this.N = null;
        this.L = null;
    }

    void r1(boolean z2) {
        if (this.f2693y < 1) {
            this.f2693y = 1;
        }
        if (!z2 && !this.A) {
            this.f2695z = false;
        }
        if (this.f2693y == 1) {
            if (z2 && this.f2695z && !this.A && this.f2675p != null && this.f2673o != null) {
                B();
            }
            if (!this.A) {
                this.f2695z = false;
            }
        }
        this.f2693y--;
    }

    @Override // android.view.ViewGroup
    protected void removeDetachedView(View view, boolean z2) {
        d0 d0VarF0 = f0(view);
        if (d0VarF0 != null) {
            if (d0VarF0.x()) {
                d0VarF0.f();
            } else if (!d0VarF0.J()) {
                throw new IllegalArgumentException("Called removeDetachedView with a view which is not flagged as tmp detached." + d0VarF0 + P());
            }
        }
        view.clearAnimation();
        z(view);
        super.removeDetachedView(view, z2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public void requestChildFocus(View view, View view2) {
        if (!this.f2675p.b1(this, this.f2666k0, view, view2) && view2 != null) {
            Z0(view, view2);
        }
        super.requestChildFocus(view, view2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public boolean requestChildRectangleOnScreen(View view, Rect rect, boolean z2) {
        return this.f2675p.r1(this, view, rect, z2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public void requestDisallowInterceptTouchEvent(boolean z2) {
        int size = this.f2681s.size();
        for (int i3 = 0; i3 < size; i3++) {
            this.f2681s.get(i3).c(z2);
        }
        super.requestDisallowInterceptTouchEvent(z2);
    }

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

    void s() {
        int iJ = this.f2661i.j();
        for (int i3 = 0; i3 < iJ; i3++) {
            d0 d0VarF0 = f0(this.f2661i.i(i3));
            if (!d0VarF0.J()) {
                d0VarF0.c();
            }
        }
        this.f2655f.d();
    }

    boolean s0() {
        AccessibilityManager accessibilityManager = this.E;
        return accessibilityManager != null && accessibilityManager.isEnabled();
    }

    public void s1(int i3) {
        getScrollingChildHelper().r(i3);
    }

    @Override // android.view.View
    public void scrollBy(int i3, int i4) {
        o oVar = this.f2675p;
        if (oVar == null) {
            Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.A) {
            return;
        }
        boolean zK = oVar.k();
        boolean zL = this.f2675p.l();
        if (zK || zL) {
            if (!zK) {
                i3 = 0;
            }
            if (!zL) {
                i4 = 0;
            }
            e1(i3, i4, null);
        }
    }

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

    @Override // android.view.View, android.view.accessibility.AccessibilityEventSource
    public void sendAccessibilityEventUnchecked(AccessibilityEvent accessibilityEvent) {
        if (j1(accessibilityEvent)) {
            return;
        }
        super.sendAccessibilityEventUnchecked(accessibilityEvent);
    }

    public void setAccessibilityDelegateCompat(androidx.recyclerview.widget.k kVar) {
        this.f2680r0 = kVar;
        androidx.core.view.y.r0(this, kVar);
    }

    public void setAdapter(g gVar) {
        setLayoutFrozen(false);
        h1(gVar, false, true);
        O0(false);
        requestLayout();
    }

    public void setChildDrawingOrderCallback(j jVar) {
        if (jVar == this.f2682s0) {
            return;
        }
        this.f2682s0 = jVar;
        setChildrenDrawingOrderEnabled(jVar != null);
    }

    @Override // android.view.ViewGroup
    public void setClipToPadding(boolean z2) {
        if (z2 != this.f2665k) {
            r0();
        }
        this.f2665k = z2;
        super.setClipToPadding(z2);
        if (this.f2691x) {
            requestLayout();
        }
    }

    public void setEdgeEffectFactory(k kVar) {
        androidx.core.util.h.f(kVar);
        this.K = kVar;
        r0();
    }

    public void setHasFixedSize(boolean z2) {
        this.f2687v = z2;
    }

    public void setItemAnimator(l lVar) {
        l lVar2 = this.P;
        if (lVar2 != null) {
            lVar2.k();
            this.P.v(null);
        }
        this.P = lVar;
        if (lVar != null) {
            lVar.v(this.f2676p0);
        }
    }

    public void setItemViewCacheSize(int i3) {
        this.f2655f.G(i3);
    }

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

    public void setLayoutManager(o oVar) {
        if (oVar == this.f2675p) {
            return;
        }
        t1();
        if (this.f2675p != null) {
            l lVar = this.P;
            if (lVar != null) {
                lVar.k();
            }
            this.f2675p.k1(this.f2655f);
            this.f2675p.l1(this.f2655f);
            this.f2655f.c();
            if (this.f2685u) {
                this.f2675p.A(this, this.f2655f);
            }
            this.f2675p.E1(null);
            this.f2675p = null;
        } else {
            this.f2655f.c();
        }
        this.f2661i.o();
        this.f2675p = oVar;
        if (oVar != null) {
            if (oVar.f2756b != null) {
                throw new IllegalArgumentException("LayoutManager " + oVar + " is already attached to a RecyclerView:" + oVar.f2756b.P());
            }
            oVar.E1(this);
            if (this.f2685u) {
                this.f2675p.z(this);
            }
        }
        this.f2655f.K();
        requestLayout();
    }

    @Override // android.view.ViewGroup
    @Deprecated
    public void setLayoutTransition(LayoutTransition layoutTransition) {
        if (Build.VERSION.SDK_INT < 18) {
            if (layoutTransition == null) {
                suppressLayout(false);
                return;
            } else if (layoutTransition.getAnimator(0) == null && layoutTransition.getAnimator(1) == null && layoutTransition.getAnimator(2) == null && layoutTransition.getAnimator(3) == null && layoutTransition.getAnimator(4) == null) {
                suppressLayout(true);
                return;
            }
        }
        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 z2) {
        getScrollingChildHelper().m(z2);
    }

    public void setOnFlingListener(r rVar) {
        this.f2650b0 = rVar;
    }

    @Deprecated
    public void setOnScrollListener(t tVar) {
        this.f2668l0 = tVar;
    }

    public void setPreserveFocusAfterLayout(boolean z2) {
        this.f2658g0 = z2;
    }

    public void setRecycledViewPool(u uVar) {
        this.f2655f.E(uVar);
    }

    public void setRecyclerListener(w wVar) {
        this.f2677q = wVar;
    }

    void setScrollState(int i3) {
        if (i3 == this.Q) {
            return;
        }
        this.Q = i3;
        if (i3 != 2) {
            u1();
        }
        H(i3);
    }

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

    public void setViewCacheExtension(b0 b0Var) {
        this.f2655f.F(b0Var);
    }

    @Override // android.view.View
    public boolean startNestedScroll(int i3) {
        return getScrollingChildHelper().o(i3);
    }

    @Override // android.view.View, androidx.core.view.m
    public void stopNestedScroll() {
        getScrollingChildHelper().q();
    }

    @Override // android.view.ViewGroup
    public final void suppressLayout(boolean z2) {
        if (z2 != this.A) {
            o("Do not suppressLayout in layout or scroll");
            if (z2) {
                long jUptimeMillis = SystemClock.uptimeMillis();
                onTouchEvent(MotionEvent.obtain(jUptimeMillis, jUptimeMillis, 3, 0.0f, 0.0f, 0));
                this.A = true;
                this.B = true;
                t1();
                return;
            }
            this.A = false;
            if (this.f2695z && this.f2675p != null && this.f2673o != null) {
                requestLayout();
            }
            this.f2695z = false;
        }
    }

    void t(int i3, int i4) {
        boolean zIsFinished;
        EdgeEffect edgeEffect = this.L;
        if (edgeEffect == null || edgeEffect.isFinished() || i3 <= 0) {
            zIsFinished = false;
        } else {
            this.L.onRelease();
            zIsFinished = this.L.isFinished();
        }
        EdgeEffect edgeEffect2 = this.N;
        if (edgeEffect2 != null && !edgeEffect2.isFinished() && i3 < 0) {
            this.N.onRelease();
            zIsFinished |= this.N.isFinished();
        }
        EdgeEffect edgeEffect3 = this.M;
        if (edgeEffect3 != null && !edgeEffect3.isFinished() && i4 > 0) {
            this.M.onRelease();
            zIsFinished |= this.M.isFinished();
        }
        EdgeEffect edgeEffect4 = this.O;
        if (edgeEffect4 != null && !edgeEffect4.isFinished() && i4 < 0) {
            this.O.onRelease();
            zIsFinished |= this.O.isFinished();
        }
        if (zIsFinished) {
            androidx.core.view.y.i0(this);
        }
    }

    public boolean t0() {
        return this.I > 0;
    }

    public void t1() {
        setScrollState(0);
        u1();
    }

    void u() {
        if (!this.f2691x || this.G) {
            androidx.core.os.f.a("RV FullInvalidate");
            B();
            androidx.core.os.f.b();
            return;
        }
        if (this.f2659h.p()) {
            if (!this.f2659h.o(4) || this.f2659h.o(11)) {
                if (this.f2659h.p()) {
                    androidx.core.os.f.a("RV FullInvalidate");
                    B();
                    androidx.core.os.f.b();
                    return;
                }
                return;
            }
            androidx.core.os.f.a("RV PartialInvalidate");
            p1();
            F0();
            this.f2659h.s();
            if (!this.f2695z) {
                if (m0()) {
                    B();
                } else {
                    this.f2659h.i();
                }
            }
            r1(true);
            G0();
            androidx.core.os.f.b();
        }
    }

    void v0(int i3) {
        if (this.f2675p == null) {
            return;
        }
        setScrollState(2);
        this.f2675p.x1(i3);
        awakenScrollBars();
    }

    void v1(int i3, int i4, Object obj) {
        int i5;
        int iJ = this.f2661i.j();
        int i6 = i3 + i4;
        for (int i7 = 0; i7 < iJ; i7++) {
            View viewI = this.f2661i.i(i7);
            d0 d0VarF0 = f0(viewI);
            if (d0VarF0 != null && !d0VarF0.J() && (i5 = d0VarF0.f2726c) >= i3 && i5 < i6) {
                d0VarF0.b(2);
                d0VarF0.a(obj);
                ((p) viewI.getLayoutParams()).f2781c = true;
            }
        }
        this.f2655f.M(i3, i4);
    }

    void w(int i3, int i4) {
        setMeasuredDimension(o.n(i3, getPaddingLeft() + getPaddingRight(), androidx.core.view.y.G(this)), o.n(i4, getPaddingTop() + getPaddingBottom(), androidx.core.view.y.F(this)));
    }

    void w0() {
        int iJ = this.f2661i.j();
        for (int i3 = 0; i3 < iJ; i3++) {
            ((p) this.f2661i.i(i3).getLayoutParams()).f2781c = true;
        }
        this.f2655f.s();
    }

    void x0() {
        int iJ = this.f2661i.j();
        for (int i3 = 0; i3 < iJ; i3++) {
            d0 d0VarF0 = f0(this.f2661i.i(i3));
            if (d0VarF0 != null && !d0VarF0.J()) {
                d0VarF0.b(6);
            }
        }
        w0();
        this.f2655f.t();
    }

    void y(View view) {
        d0 d0VarF0 = f0(view);
        D0(view);
        g gVar = this.f2673o;
        if (gVar != null && d0VarF0 != null) {
            gVar.o(d0VarF0);
        }
        List<q> list = this.F;
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                this.F.get(size).a(view);
            }
        }
    }

    public void y0(int i3) {
        int iG = this.f2661i.g();
        for (int i4 = 0; i4 < iG; i4++) {
            this.f2661i.f(i4).offsetLeftAndRight(i3);
        }
    }

    void z(View view) {
        d0 d0VarF0 = f0(view);
        E0(view);
        g gVar = this.f2673o;
        if (gVar != null && d0VarF0 != null) {
            gVar.p(d0VarF0);
        }
        List<q> list = this.F;
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                this.F.get(size).b(view);
            }
        }
    }

    public void z0(int i3) {
        int iG = this.f2661i.g();
        for (int i4 = 0; i4 < iG; i4++) {
            this.f2661i.f(i4).offsetTopAndBottom(i3);
        }
    }

    public RecyclerView(Context context, AttributeSet attributeSet, int i3) {
        super(context, attributeSet, i3);
        this.f2653e = new x();
        this.f2655f = new v();
        this.f2663j = new androidx.recyclerview.widget.p();
        new a();
        this.f2667l = new Rect();
        this.f2669m = new Rect();
        this.f2671n = new RectF();
        this.f2679r = new ArrayList<>();
        this.f2681s = new ArrayList<>();
        this.f2693y = 0;
        this.G = false;
        this.H = false;
        this.I = 0;
        this.J = 0;
        this.K = new k();
        this.P = new androidx.recyclerview.widget.c();
        this.Q = 0;
        this.R = -1;
        this.f2654e0 = Float.MIN_VALUE;
        this.f2656f0 = Float.MIN_VALUE;
        boolean z2 = true;
        this.f2658g0 = true;
        this.f2660h0 = new c0();
        this.f2664j0 = E0 ? new e.b() : null;
        this.f2666k0 = new a0();
        this.f2672n0 = false;
        this.f2674o0 = false;
        this.f2676p0 = new m();
        this.f2678q0 = false;
        this.f2684t0 = new int[2];
        this.f2688v0 = new int[2];
        this.f2690w0 = new int[2];
        this.f2692x0 = new int[2];
        this.f2694y0 = new ArrayList();
        this.f2696z0 = new b();
        this.A0 = new d();
        setScrollContainer(true);
        setFocusableInTouchMode(true);
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        this.f2649a0 = viewConfiguration.getScaledTouchSlop();
        this.f2654e0 = androidx.core.view.a0.b(viewConfiguration, context);
        this.f2656f0 = androidx.core.view.a0.d(viewConfiguration, context);
        this.f2651c0 = viewConfiguration.getScaledMinimumFlingVelocity();
        this.f2652d0 = viewConfiguration.getScaledMaximumFlingVelocity();
        setWillNotDraw(getOverScrollMode() == 2);
        this.P.v(this.f2676p0);
        n0();
        p0();
        o0();
        if (androidx.core.view.y.C(this) == 0) {
            androidx.core.view.y.B0(this, 1);
        }
        this.E = (AccessibilityManager) getContext().getSystemService("accessibility");
        setAccessibilityDelegateCompat(new androidx.recyclerview.widget.k(this));
        int[] iArr = f0.c.f4625a;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, iArr, i3, 0);
        int i4 = Build.VERSION.SDK_INT;
        if (i4 >= 29) {
            saveAttributeDataForStyleable(context, iArr, attributeSet, typedArrayObtainStyledAttributes, i3, 0);
        }
        String string = typedArrayObtainStyledAttributes.getString(f0.c.f4634j);
        if (typedArrayObtainStyledAttributes.getInt(f0.c.f4628d, -1) == -1) {
            setDescendantFocusability(262144);
        }
        this.f2665k = typedArrayObtainStyledAttributes.getBoolean(f0.c.f4627c, true);
        boolean z3 = typedArrayObtainStyledAttributes.getBoolean(f0.c.f4629e, false);
        this.f2689w = z3;
        if (z3) {
            q0((StateListDrawable) typedArrayObtainStyledAttributes.getDrawable(f0.c.f4632h), typedArrayObtainStyledAttributes.getDrawable(f0.c.f4633i), (StateListDrawable) typedArrayObtainStyledAttributes.getDrawable(f0.c.f4630f), typedArrayObtainStyledAttributes.getDrawable(f0.c.f4631g));
        }
        typedArrayObtainStyledAttributes.recycle();
        v(context, string, attributeSet, i3, 0);
        if (i4 >= 21) {
            int[] iArr2 = B0;
            TypedArray typedArrayObtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, iArr2, i3, 0);
            if (i4 >= 29) {
                saveAttributeDataForStyleable(context, iArr2, attributeSet, typedArrayObtainStyledAttributes2, i3, 0);
            }
            z2 = typedArrayObtainStyledAttributes2.getBoolean(0, true);
            typedArrayObtainStyledAttributes2.recycle();
        }
        setNestedScrollingEnabled(z2);
    }

    public static class p extends ViewGroup.MarginLayoutParams {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        d0 f2779a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        final Rect f2780b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        boolean f2781c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        boolean f2782d;

        public p(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
            this.f2780b = new Rect();
            this.f2781c = true;
            this.f2782d = false;
        }

        public int a() {
            return this.f2779a.m();
        }

        public boolean b() {
            return this.f2779a.y();
        }

        public boolean c() {
            return this.f2779a.v();
        }

        public boolean d() {
            return this.f2779a.t();
        }

        public p(int i3, int i4) {
            super(i3, i4);
            this.f2780b = new Rect();
            this.f2781c = true;
            this.f2782d = false;
        }

        public p(ViewGroup.MarginLayoutParams marginLayoutParams) {
            super(marginLayoutParams);
            this.f2780b = new Rect();
            this.f2781c = true;
            this.f2782d = false;
        }

        public p(ViewGroup.LayoutParams layoutParams) {
            super(layoutParams);
            this.f2780b = new Rect();
            this.f2781c = true;
            this.f2782d = false;
        }

        public p(p pVar) {
            super((ViewGroup.LayoutParams) pVar);
            this.f2780b = new Rect();
            this.f2781c = true;
            this.f2782d = false;
        }
    }

    public static class y extends w.a {
        public static final Parcelable.Creator<y> CREATOR = new a();

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        Parcelable f2798g;

        static class a implements Parcelable.ClassLoaderCreator<y> {
            a() {
            }

            @Override // android.os.Parcelable.Creator
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public y createFromParcel(Parcel parcel) {
                return new y(parcel, null);
            }

            @Override // android.os.Parcelable.ClassLoaderCreator
            /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
            public y createFromParcel(Parcel parcel, ClassLoader classLoader) {
                return new y(parcel, classLoader);
            }

            @Override // android.os.Parcelable.Creator
            /* JADX INFO: renamed from: c, reason: merged with bridge method [inline-methods] */
            public y[] newArray(int i3) {
                return new y[i3];
            }
        }

        y(Parcel parcel, ClassLoader classLoader) {
            super(parcel, classLoader);
            this.f2798g = parcel.readParcelable(classLoader == null ? o.class.getClassLoader() : classLoader);
        }

        void k(y yVar) {
            this.f2798g = yVar.f2798g;
        }

        @Override // w.a, android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i3) {
            super.writeToParcel(parcel, i3);
            parcel.writeParcelable(this.f2798g, 0);
        }

        y(Parcelable parcelable) {
            super(parcelable);
        }
    }

    @Override // android.view.ViewGroup
    protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        o oVar = this.f2675p;
        if (oVar != null) {
            return oVar.F(layoutParams);
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + P());
    }
}
