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.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
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.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewPropertyAnimator;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
import android.widget.EdgeEffect;
import android.widget.OverScroller;
import androidx.customview.view.AbsSavedState;
import c.f.f.g;
import c.f.j.a0;
import c.f.j.b0;
import c.f.j.f0;
import c.f.j.i0;
import c.n.c.a;
import c.n.c.b;
import c.n.c.k;
import c.n.c.m;
import c.n.c.u;
import c.n.c.w;
import c.n.c.x;
import com.cvte.vman.instance.InvokeCmd;
import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.WeakHashMap;

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

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

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

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

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

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

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public static final Class<?>[] f422i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public static final Interpolator f423j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public static final w f424k;
    public final List<t> A;
    public h A0;
    public final ArrayList<l> B;
    public final int[] B0;
    public final ArrayList<p> C;
    public c.f.j.o C0;
    public p D;
    public final int[] D0;
    public boolean E;
    public final int[] E0;
    public boolean F;
    public final int[] F0;
    public boolean G;
    public final List<z> G0;
    public boolean H;
    public Runnable H0;
    public int I;
    public boolean I0;
    public boolean J;
    public int J0;
    public boolean K;
    public int K0;
    public boolean L;
    public final x.b L0;
    public int M;
    public boolean N;
    public final AccessibilityManager O;
    public boolean P;
    public boolean Q;
    public int R;
    public int S;
    public i T;
    public EdgeEffect U;
    public EdgeEffect V;
    public EdgeEffect W;
    public EdgeEffect a0;
    public j b0;
    public int c0;
    public int d0;
    public VelocityTracker e0;
    public int f0;
    public int g0;
    public int h0;
    public int i0;
    public int j0;
    public final int k0;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final float f425l;
    public final int l0;
    public final u m;
    public float m0;
    public final s n;
    public float n0;
    public SavedState o;
    public boolean o0;
    public c.n.c.a p;
    public final y p0;
    public c.n.c.b q;
    public c.n.c.m q0;
    public final c.n.c.x r;
    public m.b r0;
    public boolean s;
    public final v s0;
    public final Runnable t;
    public q t0;
    public final Rect u;
    public List<q> u0;
    public final Rect v;
    public boolean v0;
    public final RectF w;
    public boolean w0;
    public e x;
    public j.b x0;
    public m y;
    public boolean y0;
    public t z;
    public c.n.c.u z0;

    public class a implements Runnable {
        public a() {
        }

        @Override // java.lang.Runnable
        public void run() {
            RecyclerView recyclerView = RecyclerView.this;
            if (!recyclerView.H || recyclerView.isLayoutRequested()) {
                return;
            }
            RecyclerView recyclerView2 = RecyclerView.this;
            if (!recyclerView2.E) {
                recyclerView2.requestLayout();
            } else if (recyclerView2.K) {
                recyclerView2.J = true;
            } else {
                recyclerView2.l();
            }
        }
    }

    public class b implements Runnable {
        public b() {
        }

        @Override // java.lang.Runnable
        public void run() {
            j jVar = RecyclerView.this.b0;
            if (jVar != null) {
                c.n.c.k kVar = (c.n.c.k) jVar;
                boolean z = !kVar.f1849i.isEmpty();
                boolean z2 = !kVar.f1851k.isEmpty();
                boolean z3 = !kVar.f1852l.isEmpty();
                boolean z4 = !kVar.f1850j.isEmpty();
                if (z || z2 || z4 || z3) {
                    for (z zVar : kVar.f1849i) {
                        View view = zVar.f483b;
                        ViewPropertyAnimator viewPropertyAnimatorAnimate = view.animate();
                        kVar.r.add(zVar);
                        viewPropertyAnimatorAnimate.setDuration(kVar.f432d).alpha(0.0f).setListener(new c.n.c.f(kVar, zVar, viewPropertyAnimatorAnimate, view)).start();
                    }
                    kVar.f1849i.clear();
                    if (z2) {
                        ArrayList<k.b> arrayList = new ArrayList<>();
                        arrayList.addAll(kVar.f1851k);
                        kVar.n.add(arrayList);
                        kVar.f1851k.clear();
                        c.n.c.c cVar = new c.n.c.c(kVar, arrayList);
                        if (z) {
                            View view2 = arrayList.get(0).a.f483b;
                            long j2 = kVar.f432d;
                            WeakHashMap<View, i0> weakHashMap = a0.a;
                            a0.d.n(view2, cVar, j2);
                        } else {
                            cVar.run();
                        }
                    }
                    if (z3) {
                        ArrayList<k.a> arrayList2 = new ArrayList<>();
                        arrayList2.addAll(kVar.f1852l);
                        kVar.o.add(arrayList2);
                        kVar.f1852l.clear();
                        c.n.c.d dVar = new c.n.c.d(kVar, arrayList2);
                        if (z) {
                            View view3 = arrayList2.get(0).a.f483b;
                            long j3 = kVar.f432d;
                            WeakHashMap<View, i0> weakHashMap2 = a0.a;
                            a0.d.n(view3, dVar, j3);
                        } else {
                            dVar.run();
                        }
                    }
                    if (z4) {
                        ArrayList<z> arrayList3 = new ArrayList<>();
                        arrayList3.addAll(kVar.f1850j);
                        kVar.m.add(arrayList3);
                        kVar.f1850j.clear();
                        c.n.c.e eVar = new c.n.c.e(kVar, arrayList3);
                        if (z || z2 || z3) {
                            long jMax = Math.max(z2 ? kVar.f433e : 0L, z3 ? kVar.f434f : 0L) + (z ? kVar.f432d : 0L);
                            View view4 = arrayList3.get(0).f483b;
                            WeakHashMap<View, i0> weakHashMap3 = a0.a;
                            a0.d.n(view4, eVar, jMax);
                        } else {
                            eVar.run();
                        }
                    }
                }
            }
            RecyclerView.this.y0 = false;
        }
    }

    public class c implements Interpolator {
        @Override // android.animation.TimeInterpolator
        public float getInterpolation(float f2) {
            float f3 = f2 - 1.0f;
            return (f3 * f3 * f3 * f3 * f3) + 1.0f;
        }
    }

    public class d implements x.b {
        public d() {
        }

        public void a(z zVar, j.c cVar, j.c cVar2) {
            boolean zI;
            int i2;
            int i3;
            RecyclerView recyclerView = RecyclerView.this;
            Objects.requireNonNull(recyclerView);
            zVar.t(false);
            c.n.c.v vVar = (c.n.c.v) recyclerView.b0;
            Objects.requireNonNull(vVar);
            if (cVar == null || ((i2 = cVar.a) == (i3 = cVar2.a) && cVar.f435b == cVar2.f435b)) {
                c.n.c.k kVar = (c.n.c.k) vVar;
                kVar.n(zVar);
                zVar.f483b.setAlpha(0.0f);
                kVar.f1850j.add(zVar);
                zI = true;
            } else {
                zI = vVar.i(zVar, i2, cVar.f435b, i3, cVar2.f435b);
            }
            if (zI) {
                recyclerView.X();
            }
        }

        public void b(z zVar, j.c cVar, j.c cVar2) {
            boolean zI;
            RecyclerView.this.n.m(zVar);
            RecyclerView recyclerView = RecyclerView.this;
            recyclerView.e(zVar);
            zVar.t(false);
            c.n.c.v vVar = (c.n.c.v) recyclerView.b0;
            Objects.requireNonNull(vVar);
            int i2 = cVar.a;
            int i3 = cVar.f435b;
            View view = zVar.f483b;
            int left = cVar2 == null ? view.getLeft() : cVar2.a;
            int top = cVar2 == null ? view.getTop() : cVar2.f435b;
            if (zVar.m() || (i2 == left && i3 == top)) {
                c.n.c.k kVar = (c.n.c.k) vVar;
                kVar.n(zVar);
                kVar.f1849i.add(zVar);
                zI = true;
            } else {
                view.layout(left, top, view.getWidth() + left, view.getHeight() + top);
                zI = vVar.i(zVar, i2, i3, left, top);
            }
            if (zI) {
                recyclerView.X();
            }
        }
    }

    public static abstract class e<VH extends z> {
        public final f a = new f();

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public a f429b = a.ALLOW;

        public enum a {
            ALLOW,
            PREVENT_WHEN_EMPTY,
            PREVENT
        }

        public abstract int a();

        public int b(int i2) {
            return 0;
        }

        public abstract void c(VH vh, int i2);

        public abstract VH d(ViewGroup viewGroup, int i2);

        public void e(VH vh) {
        }
    }

    public static class f extends Observable<g> {
        public void a() {
            for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
                ((g) ((Observable) this).mObservers.get(size)).a();
            }
        }

        public void b(int i2, int i3) {
            int size = ((Observable) this).mObservers.size();
            while (true) {
                size--;
                if (size < 0) {
                    return;
                } else {
                    ((g) ((Observable) this).mObservers.get(size)).b(i2, i3, null);
                }
            }
        }
    }

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

        public void b(int i2, int i3, Object obj) {
        }
    }

    public interface h {
        int a(int i2, int i3);
    }

    public static class i {
        public EdgeEffect a(RecyclerView recyclerView, int i2) {
            throw null;
        }
    }

    public static abstract class j {
        public b a = null;

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

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

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

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

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

        public interface a {
            void a();
        }

        public interface b {
        }

        public static class c {
            public int a;

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

        public static int b(z zVar) {
            int i2 = zVar.f492k & 14;
            if (zVar.k()) {
                return 4;
            }
            if ((i2 & 4) != 0) {
                return i2;
            }
            int i3 = zVar.f486e;
            int iE = zVar.e();
            return (i3 == -1 || iE == -1 || i3 == iE) ? i2 : i2 | 2048;
        }

        public abstract boolean a(z zVar, z zVar2, c cVar, c cVar2);

        public final void c(z zVar) {
            b bVar = this.a;
            if (bVar != null) {
                k kVar = (k) bVar;
                Objects.requireNonNull(kVar);
                boolean z = true;
                zVar.t(true);
                if (zVar.f490i != null && zVar.f491j == null) {
                    zVar.f490i = null;
                }
                zVar.f491j = null;
                if ((zVar.f492k & 16) != 0) {
                    return;
                }
                RecyclerView recyclerView = RecyclerView.this;
                View view = zVar.f483b;
                recyclerView.m0();
                c.n.c.b bVar2 = recyclerView.q;
                int iIndexOfChild = ((c.n.c.s) bVar2.a).a.indexOfChild(view);
                if (iIndexOfChild == -1) {
                    bVar2.l(view);
                } else if (bVar2.f1822b.d(iIndexOfChild)) {
                    bVar2.f1822b.f(iIndexOfChild);
                    bVar2.l(view);
                    ((c.n.c.s) bVar2.a).c(iIndexOfChild);
                } else {
                    z = false;
                }
                if (z) {
                    z zVarJ = RecyclerView.J(view);
                    recyclerView.n.m(zVarJ);
                    recyclerView.n.j(zVarJ);
                }
                recyclerView.o0(!z);
                if (z || !zVar.o()) {
                    return;
                }
                RecyclerView.this.removeDetachedView(zVar.f483b, false);
            }
        }

        public final void d() {
            int size = this.f430b.size();
            for (int i2 = 0; i2 < size; i2++) {
                this.f430b.get(i2).a();
            }
            this.f430b.clear();
        }

        public abstract void e(z zVar);

        public abstract void f();

        public abstract boolean g();

        public c h(z zVar) {
            c cVar = new c();
            View view = zVar.f483b;
            cVar.a = view.getLeft();
            cVar.f435b = view.getTop();
            view.getRight();
            view.getBottom();
            return cVar;
        }
    }

    public class k implements j.b {
        public k() {
        }
    }

    public static abstract class l {
        public void d(Canvas canvas, RecyclerView recyclerView, v vVar) {
        }
    }

    public static abstract class m {
        public c.n.c.b a;

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

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public final w.b f437c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public final w.b f438d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public c.n.c.w f439e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public c.n.c.w f440f;

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

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

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

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

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

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        public boolean f446l;
        public int m;
        public int n;
        public int o;
        public int p;

        public class a implements w.b {
            public a() {
            }

            @Override // c.n.c.w.b
            public int a(View view) {
                n nVar = (n) view.getLayoutParams();
                Objects.requireNonNull(m.this);
                return (view.getLeft() - ((n) view.getLayoutParams()).f450b.left) - ((ViewGroup.MarginLayoutParams) nVar).leftMargin;
            }

            @Override // c.n.c.w.b
            public int b() {
                return m.this.I();
            }

            @Override // c.n.c.w.b
            public int c() {
                m mVar = m.this;
                return mVar.o - mVar.J();
            }

            @Override // c.n.c.w.b
            public View d(int i2) {
                return m.this.w(i2);
            }

            @Override // c.n.c.w.b
            public int e(View view) {
                n nVar = (n) view.getLayoutParams();
                Objects.requireNonNull(m.this);
                return view.getRight() + ((n) view.getLayoutParams()).f450b.right + ((ViewGroup.MarginLayoutParams) nVar).rightMargin;
            }
        }

        public class b implements w.b {
            public b() {
            }

            @Override // c.n.c.w.b
            public int a(View view) {
                n nVar = (n) view.getLayoutParams();
                Objects.requireNonNull(m.this);
                return (view.getTop() - ((n) view.getLayoutParams()).f450b.top) - ((ViewGroup.MarginLayoutParams) nVar).topMargin;
            }

            @Override // c.n.c.w.b
            public int b() {
                return m.this.K();
            }

            @Override // c.n.c.w.b
            public int c() {
                m mVar = m.this;
                return mVar.p - mVar.H();
            }

            @Override // c.n.c.w.b
            public View d(int i2) {
                return m.this.w(i2);
            }

            @Override // c.n.c.w.b
            public int e(View view) {
                n nVar = (n) view.getLayoutParams();
                Objects.requireNonNull(m.this);
                return view.getBottom() + ((n) view.getLayoutParams()).f450b.bottom + ((ViewGroup.MarginLayoutParams) nVar).bottomMargin;
            }
        }

        public interface c {
        }

        public static class d {
            public int a;

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

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

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

        public m() {
            a aVar = new a();
            this.f437c = aVar;
            b bVar = new b();
            this.f438d = bVar;
            this.f439e = new c.n.c.w(aVar);
            this.f440f = new c.n.c.w(bVar);
            this.f441g = false;
            this.f442h = false;
            this.f443i = true;
            this.f444j = true;
        }

        public static d M(Context context, AttributeSet attributeSet, int i2, int i3) {
            d dVar = new d();
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, c.n.b.a, i2, i3);
            dVar.a = typedArrayObtainStyledAttributes.getInt(0, 1);
            dVar.f447b = typedArrayObtainStyledAttributes.getInt(10, 1);
            dVar.f448c = typedArrayObtainStyledAttributes.getBoolean(9, false);
            dVar.f449d = typedArrayObtainStyledAttributes.getBoolean(11, false);
            typedArrayObtainStyledAttributes.recycle();
            return dVar;
        }

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

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

        /* 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 y(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.m.y(int, int, int, int, boolean):int");
        }

        public void A(View view, Rect rect) {
            int[] iArr = RecyclerView.f417b;
            n nVar = (n) view.getLayoutParams();
            Rect rect2 = nVar.f450b;
            rect.set((view.getLeft() - rect2.left) - ((ViewGroup.MarginLayoutParams) nVar).leftMargin, (view.getTop() - rect2.top) - ((ViewGroup.MarginLayoutParams) nVar).topMargin, view.getRight() + rect2.right + ((ViewGroup.MarginLayoutParams) nVar).rightMargin, view.getBottom() + rect2.bottom + ((ViewGroup.MarginLayoutParams) nVar).bottomMargin);
        }

        public void A0(s sVar) {
            int size = sVar.a.size();
            for (int i2 = size - 1; i2 >= 0; i2--) {
                View view = sVar.a.get(i2).f483b;
                z zVarJ = RecyclerView.J(view);
                if (!zVarJ.u()) {
                    zVarJ.t(false);
                    if (zVarJ.o()) {
                        this.f436b.removeDetachedView(view, false);
                    }
                    j jVar = this.f436b.b0;
                    if (jVar != null) {
                        jVar.e(zVarJ);
                    }
                    zVarJ.t(true);
                    z zVarJ2 = RecyclerView.J(view);
                    zVarJ2.o = null;
                    zVarJ2.p = false;
                    zVarJ2.d();
                    sVar.j(zVarJ2);
                }
            }
            sVar.a.clear();
            ArrayList<z> arrayList = sVar.f458b;
            if (arrayList != null) {
                arrayList.clear();
            }
            if (size > 0) {
                this.f436b.invalidate();
            }
        }

        public int B(View view) {
            Rect rect = ((n) view.getLayoutParams()).f450b;
            return view.getMeasuredHeight() + rect.top + rect.bottom;
        }

        public void B0(View view, s sVar) {
            c.n.c.b bVar = this.a;
            int iIndexOfChild = ((c.n.c.s) bVar.a).a.indexOfChild(view);
            if (iIndexOfChild >= 0) {
                if (bVar.f1822b.f(iIndexOfChild)) {
                    bVar.l(view);
                }
                ((c.n.c.s) bVar.a).c(iIndexOfChild);
            }
            sVar.i(view);
        }

        public int C(View view) {
            Rect rect = ((n) view.getLayoutParams()).f450b;
            return view.getMeasuredWidth() + rect.left + rect.right;
        }

        public void C0(int i2, s sVar) {
            View viewW = w(i2);
            D0(i2);
            sVar.i(viewW);
        }

        public View D() {
            View focusedChild;
            RecyclerView recyclerView = this.f436b;
            if (recyclerView == null || (focusedChild = recyclerView.getFocusedChild()) == null || this.a.f1823c.contains(focusedChild)) {
                return null;
            }
            return focusedChild;
        }

        public void D0(int i2) {
            c.n.c.b bVar;
            int iF;
            View viewA;
            if (w(i2) == null || (viewA = ((c.n.c.s) bVar.a).a((iF = (bVar = this.a).f(i2)))) == null) {
                return;
            }
            if (bVar.f1822b.f(iF)) {
                bVar.l(viewA);
            }
            ((c.n.c.s) bVar.a).c(iF);
        }

        public int E() {
            RecyclerView recyclerView = this.f436b;
            WeakHashMap<View, i0> weakHashMap = a0.a;
            return a0.e.d(recyclerView);
        }

        /* JADX WARN: Removed duplicated region for block: B:18:0x007e  */
        /* JADX WARN: Removed duplicated region for block: B:30:0x00b5  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public boolean E0(androidx.recyclerview.widget.RecyclerView r10, android.view.View r11, android.graphics.Rect r12, boolean r13, boolean r14) {
            /*
                r9 = this;
                r0 = 2
                int[] r0 = new int[r0]
                int r1 = r9.I()
                int r2 = r9.K()
                int r3 = r9.o
                int r4 = r9.J()
                int r3 = r3 - r4
                int r4 = r9.p
                int r5 = r9.H()
                int r4 = r4 - r5
                int r5 = r11.getLeft()
                int r6 = r12.left
                int r5 = r5 + r6
                int r6 = r11.getScrollX()
                int r5 = r5 - r6
                int r6 = r11.getTop()
                int r7 = r12.top
                int r6 = r6 + r7
                int r11 = r11.getScrollY()
                int r6 = r6 - r11
                int r11 = r12.width()
                int r11 = r11 + r5
                int r12 = r12.height()
                int r12 = r12 + r6
                int r5 = r5 - r1
                r1 = 0
                int r7 = java.lang.Math.min(r1, r5)
                int r6 = r6 - r2
                int r2 = java.lang.Math.min(r1, r6)
                int r11 = r11 - r3
                int r3 = java.lang.Math.max(r1, r11)
                int r12 = r12 - r4
                int r12 = java.lang.Math.max(r1, r12)
                int r4 = r9.E()
                r8 = 1
                if (r4 != r8) goto L5f
                if (r3 == 0) goto L5a
                goto L67
            L5a:
                int r3 = java.lang.Math.max(r7, r11)
                goto L67
            L5f:
                if (r7 == 0) goto L62
                goto L66
            L62:
                int r7 = java.lang.Math.min(r5, r3)
            L66:
                r3 = r7
            L67:
                if (r2 == 0) goto L6a
                goto L6e
            L6a:
                int r2 = java.lang.Math.min(r6, r12)
            L6e:
                r0[r1] = r3
                r0[r8] = r2
                r11 = r0[r1]
                r12 = r0[r8]
                if (r14 == 0) goto Lb5
                android.view.View r14 = r10.getFocusedChild()
                if (r14 != 0) goto L80
            L7e:
                r14 = r1
                goto Lb3
            L80:
                int r0 = r9.I()
                int r2 = r9.K()
                int r3 = r9.o
                int r4 = r9.J()
                int r3 = r3 - r4
                int r4 = r9.p
                int r5 = r9.H()
                int r4 = r4 - r5
                androidx.recyclerview.widget.RecyclerView r5 = r9.f436b
                android.graphics.Rect r5 = r5.u
                r9.A(r14, r5)
                int r14 = r5.left
                int r14 = r14 - r11
                if (r14 >= r3) goto L7e
                int r14 = r5.right
                int r14 = r14 - r11
                if (r14 <= r0) goto L7e
                int r14 = r5.top
                int r14 = r14 - r12
                if (r14 >= r4) goto L7e
                int r14 = r5.bottom
                int r14 = r14 - r12
                if (r14 > r2) goto Lb2
                goto L7e
            Lb2:
                r14 = r8
            Lb3:
                if (r14 == 0) goto Lba
            Lb5:
                if (r11 != 0) goto Lbb
                if (r12 == 0) goto Lba
                goto Lbb
            Lba:
                return r1
            Lbb:
                if (r13 == 0) goto Lc1
                r10.scrollBy(r11, r12)
                goto Lc4
            Lc1:
                r10.k0(r11, r12)
            Lc4:
                return r8
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.m.E0(androidx.recyclerview.widget.RecyclerView, android.view.View, android.graphics.Rect, boolean, boolean):boolean");
        }

        public int F() {
            RecyclerView recyclerView = this.f436b;
            WeakHashMap<View, i0> weakHashMap = a0.a;
            return a0.d.d(recyclerView);
        }

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

        public int G() {
            RecyclerView recyclerView = this.f436b;
            WeakHashMap<View, i0> weakHashMap = a0.a;
            return a0.d.e(recyclerView);
        }

        @SuppressLint({"UnknownNullness"})
        public int G0(int i2, s sVar, v vVar) {
            return 0;
        }

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

        @SuppressLint({"UnknownNullness"})
        public int H0(int i2, s sVar, v vVar) {
            return 0;
        }

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

        public void I0(RecyclerView recyclerView) {
            J0(View.MeasureSpec.makeMeasureSpec(recyclerView.getWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(recyclerView.getHeight(), 1073741824));
        }

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

        public void J0(int i2, int i3) {
            this.o = View.MeasureSpec.getSize(i2);
            int mode = View.MeasureSpec.getMode(i2);
            this.m = mode;
            if (mode == 0 && !RecyclerView.f419f) {
                this.o = 0;
            }
            this.p = View.MeasureSpec.getSize(i3);
            int mode2 = View.MeasureSpec.getMode(i3);
            this.n = mode2;
            if (mode2 != 0 || RecyclerView.f419f) {
                return;
            }
            this.p = 0;
        }

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

        public void K0(Rect rect, int i2, int i3) {
            int iJ = J() + I() + rect.width();
            int iH = H() + K() + rect.height();
            this.f436b.setMeasuredDimension(g(i2, iJ, G()), g(i3, iH, F()));
        }

        public int L(View view) {
            return ((n) view.getLayoutParams()).a();
        }

        public void L0(int i2, int i3) {
            int iX = x();
            if (iX == 0) {
                this.f436b.m(i2, i3);
                return;
            }
            int i4 = Integer.MIN_VALUE;
            int i5 = Integer.MAX_VALUE;
            int i6 = Integer.MAX_VALUE;
            int i7 = Integer.MIN_VALUE;
            for (int i8 = 0; i8 < iX; i8++) {
                View viewW = w(i8);
                Rect rect = this.f436b.u;
                A(viewW, rect);
                int i9 = rect.left;
                if (i9 < i5) {
                    i5 = i9;
                }
                int i10 = rect.right;
                if (i10 > i4) {
                    i4 = i10;
                }
                int i11 = rect.top;
                if (i11 < i6) {
                    i6 = i11;
                }
                int i12 = rect.bottom;
                if (i12 > i7) {
                    i7 = i12;
                }
            }
            this.f436b.u.set(i5, i6, i4, i7);
            K0(this.f436b.u, i2, i3);
        }

        public void M0(RecyclerView recyclerView) {
            if (recyclerView == null) {
                this.f436b = null;
                this.a = null;
                this.o = 0;
                this.p = 0;
            } else {
                this.f436b = recyclerView;
                this.a = recyclerView.q;
                this.o = recyclerView.getWidth();
                this.p = recyclerView.getHeight();
            }
            this.m = 1073741824;
            this.n = 1073741824;
        }

        public int N(s sVar, v vVar) {
            return -1;
        }

        public boolean N0(View view, int i2, int i3, n nVar) {
            return (!view.isLayoutRequested() && this.f443i && S(view.getWidth(), i2, ((ViewGroup.MarginLayoutParams) nVar).width) && S(view.getHeight(), i3, ((ViewGroup.MarginLayoutParams) nVar).height)) ? false : true;
        }

        public int O() {
            return 0;
        }

        public boolean O0() {
            return false;
        }

        public void P(View view, boolean z, Rect rect) {
            Matrix matrix;
            if (z) {
                Rect rect2 = ((n) view.getLayoutParams()).f450b;
                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.f436b != null && (matrix = view.getMatrix()) != null && !matrix.isIdentity()) {
                RectF rectF = this.f436b.w;
                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 boolean P0(View view, int i2, int i3, n nVar) {
            return (this.f443i && S(view.getMeasuredWidth(), i2, ((ViewGroup.MarginLayoutParams) nVar).width) && S(view.getMeasuredHeight(), i3, ((ViewGroup.MarginLayoutParams) nVar).height)) ? false : true;
        }

        public boolean Q() {
            return false;
        }

        public boolean Q0() {
            return false;
        }

        public boolean R() {
            return false;
        }

        public boolean T(View view, boolean z) {
            boolean z2 = this.f439e.b(view, 24579) && this.f440f.b(view, 24579);
            return z ? z2 : !z2;
        }

        public void U(View view, int i2, int i3, int i4, int i5) {
            n nVar = (n) view.getLayoutParams();
            Rect rect = nVar.f450b;
            view.layout(i2 + rect.left + ((ViewGroup.MarginLayoutParams) nVar).leftMargin, i3 + rect.top + ((ViewGroup.MarginLayoutParams) nVar).topMargin, (i4 - rect.right) - ((ViewGroup.MarginLayoutParams) nVar).rightMargin, (i5 - rect.bottom) - ((ViewGroup.MarginLayoutParams) nVar).bottomMargin);
        }

        public void V(int i2) {
            RecyclerView recyclerView = this.f436b;
            if (recyclerView != null) {
                int iE = recyclerView.q.e();
                for (int i3 = 0; i3 < iE; i3++) {
                    recyclerView.q.d(i3).offsetLeftAndRight(i2);
                }
            }
        }

        public void W(int i2) {
            RecyclerView recyclerView = this.f436b;
            if (recyclerView != null) {
                int iE = recyclerView.q.e();
                for (int i3 = 0; i3 < iE; i3++) {
                    recyclerView.q.d(i3).offsetTopAndBottom(i2);
                }
            }
        }

        public void X(e eVar, e eVar2) {
        }

        public boolean Y() {
            return false;
        }

        public void Z() {
        }

        @SuppressLint({"UnknownNullness"})
        public void a(View view) {
            b(view, -1, false);
        }

        @Deprecated
        public void a0() {
        }

        public final void b(View view, int i2, boolean z) {
            z zVarJ = RecyclerView.J(view);
            if (z || zVarJ.m()) {
                this.f436b.r.a(zVarJ);
            } else {
                this.f436b.r.f(zVarJ);
            }
            n nVar = (n) view.getLayoutParams();
            if (zVarJ.v() || zVarJ.n()) {
                if (zVarJ.n()) {
                    zVarJ.o.m(zVarJ);
                } else {
                    zVarJ.d();
                }
                this.a.b(view, i2, view.getLayoutParams(), false);
            } else if (view.getParent() == this.f436b) {
                int iJ = this.a.j(view);
                if (i2 == -1) {
                    i2 = this.a.e();
                }
                if (iJ == -1) {
                    StringBuilder sbB = d.b.a.a.a.B("Added View has RecyclerView as parent but view is not a real child. Unfiltered index:");
                    sbB.append(this.f436b.indexOfChild(view));
                    throw new IllegalStateException(d.b.a.a.a.g(this.f436b, sbB));
                }
                if (iJ != i2) {
                    m mVar = this.f436b.y;
                    View viewW = mVar.w(iJ);
                    if (viewW == null) {
                        throw new IllegalArgumentException("Cannot move a child from non-existing index:" + iJ + mVar.f436b.toString());
                    }
                    mVar.w(iJ);
                    mVar.q(iJ);
                    n nVar2 = (n) viewW.getLayoutParams();
                    z zVarJ2 = RecyclerView.J(viewW);
                    if (zVarJ2.m()) {
                        mVar.f436b.r.a(zVarJ2);
                    } else {
                        mVar.f436b.r.f(zVarJ2);
                    }
                    mVar.a.b(viewW, i2, nVar2, zVarJ2.m());
                }
            } else {
                this.a.a(view, i2, false);
                nVar.f451c = true;
            }
            if (nVar.f452d) {
                zVarJ.f483b.invalidate();
                nVar.f452d = false;
            }
        }

        @SuppressLint({"UnknownNullness"})
        public void b0(RecyclerView recyclerView, s sVar) {
            a0();
        }

        @SuppressLint({"UnknownNullness"})
        public void c(String str) {
            RecyclerView recyclerView = this.f436b;
            if (recyclerView != null) {
                recyclerView.f(str);
            }
        }

        public View c0(View view, int i2, s sVar, v vVar) {
            return null;
        }

        public boolean d() {
            return false;
        }

        public void d0(AccessibilityEvent accessibilityEvent) {
            RecyclerView recyclerView = this.f436b;
            s sVar = recyclerView.n;
            v vVar = recyclerView.s0;
            e0(accessibilityEvent);
        }

        public boolean e() {
            return false;
        }

        public void e0(AccessibilityEvent accessibilityEvent) {
            RecyclerView recyclerView = this.f436b;
            if (recyclerView == null || accessibilityEvent == null) {
                return;
            }
            boolean z = true;
            if (!recyclerView.canScrollVertically(1) && !this.f436b.canScrollVertically(-1) && !this.f436b.canScrollHorizontally(-1) && !this.f436b.canScrollHorizontally(1)) {
                z = false;
            }
            accessibilityEvent.setScrollable(z);
            e eVar = this.f436b.x;
            if (eVar != null) {
                accessibilityEvent.setItemCount(eVar.a());
            }
        }

        public boolean f(n nVar) {
            return nVar != null;
        }

        public void f0(s sVar, v vVar, c.f.j.n0.c cVar) {
            if (this.f436b.canScrollVertically(-1) || this.f436b.canScrollHorizontally(-1)) {
                cVar.a.addAction(InvokeCmd.CMD_TOUCH_CTRL_START);
                cVar.a.setScrollable(true);
            }
            if (this.f436b.canScrollVertically(1) || this.f436b.canScrollHorizontally(1)) {
                cVar.a.addAction(4096);
                cVar.a.setScrollable(true);
            }
            cVar.a.setCollectionInfo(AccessibilityNodeInfo.CollectionInfo.obtain(N(sVar, vVar), z(sVar, vVar), R(), O()));
        }

        public void g0(View view, c.f.j.n0.c cVar) {
            z zVarJ = RecyclerView.J(view);
            if (zVarJ == null || zVarJ.m() || this.a.k(zVarJ.f483b)) {
                return;
            }
            RecyclerView recyclerView = this.f436b;
            h0(recyclerView.n, recyclerView.s0, view, cVar);
        }

        @SuppressLint({"UnknownNullness"})
        public void h(int i2, int i3, v vVar, c cVar) {
        }

        public void h0(s sVar, v vVar, View view, c.f.j.n0.c cVar) {
        }

        @SuppressLint({"UnknownNullness"})
        public void i(int i2, c cVar) {
        }

        public View i0() {
            return null;
        }

        public int j(v vVar) {
            return 0;
        }

        public void j0(RecyclerView recyclerView, int i2, int i3) {
        }

        public int k(v vVar) {
            return 0;
        }

        public void k0(RecyclerView recyclerView) {
        }

        public int l(v vVar) {
            return 0;
        }

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

        public int m(v vVar) {
            return 0;
        }

        public void m0(RecyclerView recyclerView, int i2, int i3) {
        }

        public int n(v vVar) {
            return 0;
        }

        public void n0() {
        }

        public int o(v vVar) {
            return 0;
        }

        public void o0(RecyclerView recyclerView, int i2, int i3, Object obj) {
            n0();
        }

        public void p(s sVar) {
            for (int iX = x() - 1; iX >= 0; iX--) {
                View viewW = w(iX);
                z zVarJ = RecyclerView.J(viewW);
                if (!zVarJ.u()) {
                    if (!zVarJ.k() || zVarJ.m()) {
                        w(iX);
                        q(iX);
                        sVar.k(viewW);
                        this.f436b.r.f(zVarJ);
                    } else {
                        Objects.requireNonNull(this.f436b.x);
                        D0(iX);
                        sVar.j(zVarJ);
                    }
                }
            }
        }

        @SuppressLint({"UnknownNullness"})
        public void p0(s sVar, v vVar) {
            Log.e("RecyclerView", "You must override onLayoutChildren(Recycler recycler, State state) ");
        }

        public final void q(int i2) {
            this.a.c(i2);
        }

        @SuppressLint({"UnknownNullness"})
        public void q0(v vVar) {
        }

        public View r(View view) {
            View viewA;
            RecyclerView recyclerView = this.f436b;
            if (recyclerView == null || (viewA = recyclerView.A(view)) == null || this.a.f1823c.contains(viewA)) {
                return null;
            }
            return viewA;
        }

        public void r0(int i2, int i3) {
            this.f436b.m(i2, i3);
        }

        public View s(int i2) {
            int iX = x();
            for (int i3 = 0; i3 < iX; i3++) {
                View viewW = w(i3);
                z zVarJ = RecyclerView.J(viewW);
                if (zVarJ != null && zVarJ.f() == i2 && !zVarJ.u() && (this.f436b.s0.f469f || !zVarJ.m())) {
                    return viewW;
                }
            }
            return null;
        }

        @Deprecated
        public boolean s0(RecyclerView recyclerView) {
            return recyclerView.N();
        }

        @SuppressLint({"UnknownNullness"})
        public abstract n t();

        public boolean t0(RecyclerView recyclerView, View view, View view2) {
            return s0(recyclerView);
        }

        @SuppressLint({"UnknownNullness"})
        public n u(Context context, AttributeSet attributeSet) {
            return new n(context, attributeSet);
        }

        @SuppressLint({"UnknownNullness"})
        public void u0(Parcelable parcelable) {
        }

        @SuppressLint({"UnknownNullness"})
        public n v(ViewGroup.LayoutParams layoutParams) {
            return layoutParams instanceof n ? new n((n) layoutParams) : layoutParams instanceof ViewGroup.MarginLayoutParams ? new n((ViewGroup.MarginLayoutParams) layoutParams) : new n(layoutParams);
        }

        public Parcelable v0() {
            return null;
        }

        public View w(int i2) {
            c.n.c.b bVar = this.a;
            if (bVar == null) {
                return null;
            }
            return ((c.n.c.s) bVar.a).a(bVar.f(i2));
        }

        public void w0(int i2) {
        }

        public int x() {
            c.n.c.b bVar = this.a;
            if (bVar != null) {
                return bVar.e();
            }
            return 0;
        }

        public boolean x0(int i2) {
            int iK;
            int I;
            int i3;
            int i4;
            if (this.f436b == null) {
                return false;
            }
            int iHeight = this.p;
            int iWidth = this.o;
            Rect rect = new Rect();
            if (this.f436b.getMatrix().isIdentity() && this.f436b.getGlobalVisibleRect(rect)) {
                iHeight = rect.height();
                iWidth = rect.width();
            }
            if (i2 == 4096) {
                iK = this.f436b.canScrollVertically(1) ? (iHeight - K()) - H() : 0;
                if (this.f436b.canScrollHorizontally(1)) {
                    I = (iWidth - I()) - J();
                    i3 = iK;
                    i4 = I;
                }
                i3 = iK;
                i4 = 0;
            } else if (i2 != 8192) {
                i4 = 0;
                i3 = 0;
            } else {
                iK = this.f436b.canScrollVertically(-1) ? -((iHeight - K()) - H()) : 0;
                if (this.f436b.canScrollHorizontally(-1)) {
                    I = -((iWidth - I()) - J());
                    i3 = iK;
                    i4 = I;
                }
                i3 = iK;
                i4 = 0;
            }
            if (i3 == 0 && i4 == 0) {
                return false;
            }
            this.f436b.l0(i4, i3, null, Integer.MIN_VALUE, true);
            return true;
        }

        public boolean y0() {
            return false;
        }

        public int z(s sVar, v vVar) {
            return -1;
        }

        public void z0(s sVar) {
            for (int iX = x() - 1; iX >= 0; iX--) {
                if (!RecyclerView.J(w(iX)).u()) {
                    C0(iX, sVar);
                }
            }
        }
    }

    public static abstract class o {
    }

    public interface p {
        void a(RecyclerView recyclerView, MotionEvent motionEvent);

        boolean b(RecyclerView recyclerView, MotionEvent motionEvent);

        void c(boolean z);
    }

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

    public static class r {
        public SparseArray<a> a = new SparseArray<>();

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

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public Set<e<?>> f454c = Collections.newSetFromMap(new IdentityHashMap());

        public static class a {
            public final ArrayList<z> a = new ArrayList<>();

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

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

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

        public void a() {
            for (int i2 = 0; i2 < this.a.size(); i2++) {
                a aVarValueAt = this.a.valueAt(i2);
                Iterator<z> it = aVarValueAt.a.iterator();
                while (it.hasNext()) {
                    c.h.a.a.a(it.next().f483b);
                }
                aVarValueAt.a.clear();
            }
        }

        public final a b(int i2) {
            a aVar = this.a.get(i2);
            if (aVar != null) {
                return aVar;
            }
            a aVar2 = new a();
            this.a.put(i2, aVar2);
            return aVar2;
        }

        public long c(long j2, long j3) {
            if (j2 == 0) {
                return j3;
            }
            return (j3 / 4) + ((j2 / 4) * 3);
        }
    }

    public final class s {
        public final ArrayList<z> a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public ArrayList<z> f458b;

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

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public final List<z> f460d;

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

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

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

        public s() {
            ArrayList<z> arrayList = new ArrayList<>();
            this.a = arrayList;
            this.f458b = null;
            this.f459c = new ArrayList<>();
            this.f460d = Collections.unmodifiableList(arrayList);
            this.f461e = 2;
            this.f462f = 2;
        }

        public void a(z zVar, boolean z) {
            RecyclerView.h(zVar);
            View view = zVar.f483b;
            c.n.c.u uVar = RecyclerView.this.z0;
            if (uVar != null) {
                u.a aVar = uVar.f1899e;
                a0.l(view, aVar instanceof u.a ? aVar.f1901e.remove(view) : null);
            }
            if (z) {
                t tVar = RecyclerView.this.z;
                if (tVar != null) {
                    tVar.a(zVar);
                }
                int size = RecyclerView.this.A.size();
                for (int i2 = 0; i2 < size; i2++) {
                    RecyclerView.this.A.get(i2).a(zVar);
                }
                e eVar = RecyclerView.this.x;
                if (eVar != null) {
                    eVar.e(zVar);
                }
                RecyclerView recyclerView = RecyclerView.this;
                if (recyclerView.s0 != null) {
                    recyclerView.r.g(zVar);
                }
            }
            zVar.t = null;
            zVar.s = null;
            r rVarD = d();
            Objects.requireNonNull(rVarD);
            int i3 = zVar.f488g;
            ArrayList<z> arrayList = rVarD.b(i3).a;
            if (rVarD.a.get(i3).f455b <= arrayList.size()) {
                c.h.a.a.a(zVar.f483b);
            } else {
                zVar.r();
                arrayList.add(zVar);
            }
        }

        public void b() {
            this.a.clear();
            g();
        }

        public int c(int i2) {
            if (i2 >= 0 && i2 < RecyclerView.this.s0.b()) {
                RecyclerView recyclerView = RecyclerView.this;
                return !recyclerView.s0.f469f ? i2 : recyclerView.p.f(i2, 0);
            }
            StringBuilder sbC = d.b.a.a.a.C("invalid position ", i2, ". State item count is ");
            sbC.append(RecyclerView.this.s0.b());
            throw new IndexOutOfBoundsException(d.b.a.a.a.g(RecyclerView.this, sbC));
        }

        public r d() {
            if (this.f463g == null) {
                this.f463g = new r();
                e();
            }
            return this.f463g;
        }

        public final void e() {
            if (this.f463g != null) {
                RecyclerView recyclerView = RecyclerView.this;
                if (recyclerView.x == null || !recyclerView.isAttachedToWindow()) {
                    return;
                }
                r rVar = this.f463g;
                rVar.f454c.add(RecyclerView.this.x);
            }
        }

        public final void f(e<?> eVar, boolean z) {
            r rVar = this.f463g;
            if (rVar != null) {
                rVar.f454c.remove(eVar);
                if (rVar.f454c.size() != 0 || z) {
                    return;
                }
                for (int i2 = 0; i2 < rVar.a.size(); i2++) {
                    SparseArray<r.a> sparseArray = rVar.a;
                    ArrayList<z> arrayList = sparseArray.get(sparseArray.keyAt(i2)).a;
                    for (int i3 = 0; i3 < arrayList.size(); i3++) {
                        c.h.a.a.a(arrayList.get(i3).f483b);
                    }
                }
            }
        }

        public void g() {
            for (int size = this.f459c.size() - 1; size >= 0; size--) {
                h(size);
            }
            this.f459c.clear();
            if (RecyclerView.f421h) {
                m.b bVar = RecyclerView.this.r0;
                int[] iArr = bVar.f1882c;
                if (iArr != null) {
                    Arrays.fill(iArr, -1);
                }
                bVar.f1883d = 0;
            }
        }

        public void h(int i2) {
            a(this.f459c.get(i2), true);
            this.f459c.remove(i2);
        }

        public void i(View view) {
            z zVarJ = RecyclerView.J(view);
            if (zVarJ.o()) {
                RecyclerView.this.removeDetachedView(view, false);
            }
            if (zVarJ.n()) {
                zVarJ.o.m(zVarJ);
            } else if (zVarJ.v()) {
                zVarJ.d();
            }
            j(zVarJ);
            if (RecyclerView.this.b0 == null || zVarJ.l()) {
                return;
            }
            RecyclerView.this.b0.e(zVarJ);
        }

        /* JADX WARN: Removed duplicated region for block: B:16:0x0030  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public void j(androidx.recyclerview.widget.RecyclerView.z r7) {
            /*
                Method dump skipped, instruction units count: 258
                To view this dump add '--comments-level debug' option
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.s.j(androidx.recyclerview.widget.RecyclerView$z):void");
        }

        /* JADX WARN: Removed duplicated region for block: B:20:0x0039  */
        /* JADX WARN: Removed duplicated region for block: B:23:0x003d  */
        /* JADX WARN: Removed duplicated region for block: B:24:0x003f  */
        /* JADX WARN: Removed duplicated region for block: B:27:0x0043  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public void k(android.view.View r5) {
            /*
                r4 = this;
                androidx.recyclerview.widget.RecyclerView$z r5 = androidx.recyclerview.widget.RecyclerView.J(r5)
                r0 = 12
                boolean r0 = r5.h(r0)
                r1 = 0
                if (r0 != 0) goto L58
                boolean r0 = r5.p()
                if (r0 == 0) goto L58
                androidx.recyclerview.widget.RecyclerView r0 = androidx.recyclerview.widget.RecyclerView.this
                androidx.recyclerview.widget.RecyclerView$j r0 = r0.b0
                r2 = 1
                if (r0 == 0) goto L3f
                java.util.List r3 = r5.g()
                c.n.c.k r0 = (c.n.c.k) r0
                boolean r3 = r3.isEmpty()
                if (r3 == 0) goto L39
                boolean r0 = r0.f1902g
                if (r0 == 0) goto L33
                boolean r0 = r5.k()
                if (r0 == 0) goto L31
                goto L33
            L31:
                r0 = r1
                goto L34
            L33:
                r0 = r2
            L34:
                if (r0 == 0) goto L37
                goto L39
            L37:
                r0 = r1
                goto L3a
            L39:
                r0 = r2
            L3a:
                if (r0 == 0) goto L3d
                goto L3f
            L3d:
                r0 = r1
                goto L40
            L3f:
                r0 = r2
            L40:
                if (r0 == 0) goto L43
                goto L58
            L43:
                java.util.ArrayList<androidx.recyclerview.widget.RecyclerView$z> r0 = r4.f458b
                if (r0 != 0) goto L4e
                java.util.ArrayList r0 = new java.util.ArrayList
                r0.<init>()
                r4.f458b = r0
            L4e:
                r5.o = r4
                r5.p = r2
                java.util.ArrayList<androidx.recyclerview.widget.RecyclerView$z> r0 = r4.f458b
                r0.add(r5)
                goto L87
            L58:
                boolean r0 = r5.k()
                if (r0 == 0) goto L7e
                boolean r0 = r5.m()
                if (r0 == 0) goto L65
                goto L7e
            L65:
                androidx.recyclerview.widget.RecyclerView r5 = androidx.recyclerview.widget.RecyclerView.this
                androidx.recyclerview.widget.RecyclerView$e r5 = r5.x
                java.util.Objects.requireNonNull(r5)
                java.lang.IllegalArgumentException r5 = new java.lang.IllegalArgumentException
                java.lang.String r0 = "Called scrap view with an invalid view. Invalid views cannot be reused from scrap, they should rebound from recycler pool."
                java.lang.StringBuilder r0 = d.b.a.a.a.B(r0)
                androidx.recyclerview.widget.RecyclerView r1 = androidx.recyclerview.widget.RecyclerView.this
                java.lang.String r0 = d.b.a.a.a.g(r1, r0)
                r5.<init>(r0)
                throw r5
            L7e:
                r5.o = r4
                r5.p = r1
                java.util.ArrayList<androidx.recyclerview.widget.RecyclerView$z> r0 = r4.a
                r0.add(r5)
            L87:
                return
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.s.k(android.view.View):void");
        }

        /* JADX WARN: Removed duplicated region for block: B:111:0x020a  */
        /* JADX WARN: Removed duplicated region for block: B:129:0x0268  */
        /* JADX WARN: Removed duplicated region for block: B:166:0x0337  */
        /* JADX WARN: Removed duplicated region for block: B:172:0x035b  */
        /* JADX WARN: Removed duplicated region for block: B:174:0x0361  */
        /* JADX WARN: Removed duplicated region for block: B:181:0x0372  */
        /* JADX WARN: Removed duplicated region for block: B:235:0x045b  */
        /* JADX WARN: Removed duplicated region for block: B:236:0x0469  */
        /* JADX WARN: Removed duplicated region for block: B:242:0x0485 A[ADDED_TO_REGION] */
        /* JADX WARN: Removed duplicated region for block: B:24:0x004f  */
        /* JADX WARN: Removed duplicated region for block: B:29:0x0056  */
        /* JADX WARN: Removed duplicated region for block: B:69:0x0152  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        public androidx.recyclerview.widget.RecyclerView.z l(int r17, boolean r18, long r19) {
            /*
                Method dump skipped, instruction units count: 1212
                To view this dump add '--comments-level debug' option
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.s.l(int, boolean, long):androidx.recyclerview.widget.RecyclerView$z");
        }

        public void m(z zVar) {
            if (zVar.p) {
                this.f458b.remove(zVar);
            } else {
                this.a.remove(zVar);
            }
            zVar.o = null;
            zVar.p = false;
            zVar.d();
        }

        public void n() {
            m mVar = RecyclerView.this.y;
            this.f462f = this.f461e + (mVar != null ? mVar.f445k : 0);
            for (int size = this.f459c.size() - 1; size >= 0 && this.f459c.size() > this.f462f; size--) {
                h(size);
            }
        }
    }

    public interface t {
        void a(z zVar);
    }

    public class u extends g {
        public u() {
        }

        @Override // androidx.recyclerview.widget.RecyclerView.g
        public void a() {
            RecyclerView.this.f(null);
            RecyclerView recyclerView = RecyclerView.this;
            recyclerView.s0.f468e = true;
            recyclerView.Z(true);
            if (RecyclerView.this.p.g()) {
                return;
            }
            RecyclerView.this.requestLayout();
        }

        @Override // androidx.recyclerview.widget.RecyclerView.g
        public void b(int i2, int i3, Object obj) {
            RecyclerView.this.f(null);
            c.n.c.a aVar = RecyclerView.this.p;
            Objects.requireNonNull(aVar);
            boolean z = false;
            if (i3 >= 1) {
                aVar.f1814b.add(aVar.h(4, i2, i3, obj));
                aVar.f1818f |= 4;
                if (aVar.f1814b.size() == 1) {
                    z = true;
                }
            }
            if (z) {
                if (RecyclerView.f420g) {
                    RecyclerView recyclerView = RecyclerView.this;
                    if (recyclerView.F && recyclerView.E) {
                        Runnable runnable = recyclerView.t;
                        WeakHashMap<View, i0> weakHashMap = a0.a;
                        a0.d.m(recyclerView, runnable);
                        return;
                    }
                }
                RecyclerView recyclerView2 = RecyclerView.this;
                recyclerView2.N = true;
                recyclerView2.requestLayout();
            }
        }
    }

    public static class v {
        public int a = 0;

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

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

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

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public boolean f468e = false;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public boolean f469f = false;

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

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

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

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

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

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        public long f475l;
        public int m;

        public void a(int i2) {
            if ((this.f466c & i2) != 0) {
                return;
            }
            StringBuilder sbB = d.b.a.a.a.B("Layout state should be one of ");
            sbB.append(Integer.toBinaryString(i2));
            sbB.append(" but it is ");
            sbB.append(Integer.toBinaryString(this.f466c));
            throw new IllegalStateException(sbB.toString());
        }

        public int b() {
            return this.f469f ? this.a - this.f465b : this.f467d;
        }

        public String toString() {
            return "State{mTargetPosition=-1, mData=" + ((Object) null) + ", mItemCount=" + this.f467d + ", mIsMeasuring=" + this.f471h + ", mPreviousLayoutItemCount=" + this.a + ", mDeletedInvisibleItemCountSincePreviousLayout=" + this.f465b + ", mStructureChanged=" + this.f468e + ", mInPreLayout=" + this.f469f + ", mRunSimpleAnimations=" + this.f472i + ", mRunPredictiveAnimations=" + this.f473j + '}';
        }
    }

    public static class w extends i {
        @Override // androidx.recyclerview.widget.RecyclerView.i
        public EdgeEffect a(RecyclerView recyclerView, int i2) {
            return new EdgeEffect(recyclerView.getContext());
        }
    }

    public static abstract class x {
    }

    public class y implements Runnable {

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

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

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public OverScroller f478f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        public Interpolator f479g;

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

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

        public y() {
            Interpolator interpolator = RecyclerView.f423j;
            this.f479g = interpolator;
            this.f480h = false;
            this.f481i = false;
            this.f478f = new OverScroller(RecyclerView.this.getContext(), interpolator);
        }

        public void a(int i2, int i3) {
            RecyclerView.this.setScrollState(2);
            this.f477e = 0;
            this.f476b = 0;
            Interpolator interpolator = this.f479g;
            Interpolator interpolator2 = RecyclerView.f423j;
            if (interpolator != interpolator2) {
                this.f479g = interpolator2;
                this.f478f = new OverScroller(RecyclerView.this.getContext(), interpolator2);
            }
            this.f478f.fling(0, 0, i2, i3, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE);
            b();
        }

        public void b() {
            if (this.f480h) {
                this.f481i = true;
                return;
            }
            RecyclerView.this.removeCallbacks(this);
            RecyclerView recyclerView = RecyclerView.this;
            WeakHashMap<View, i0> weakHashMap = a0.a;
            a0.d.m(recyclerView, this);
        }

        @Override // java.lang.Runnable
        public void run() {
            int i2;
            int i3;
            RecyclerView recyclerView = RecyclerView.this;
            if (recyclerView.y == null) {
                recyclerView.removeCallbacks(this);
                this.f478f.abortAnimation();
                return;
            }
            this.f481i = false;
            this.f480h = true;
            recyclerView.l();
            OverScroller overScroller = this.f478f;
            if (overScroller.computeScrollOffset()) {
                int currX = overScroller.getCurrX();
                int currY = overScroller.getCurrY();
                int i4 = currX - this.f476b;
                int i5 = currY - this.f477e;
                this.f476b = currX;
                this.f477e = currY;
                RecyclerView recyclerView2 = RecyclerView.this;
                int iK = recyclerView2.k(i4, recyclerView2.U, recyclerView2.W, recyclerView2.getWidth());
                RecyclerView recyclerView3 = RecyclerView.this;
                int iK2 = recyclerView3.k(i5, recyclerView3.V, recyclerView3.a0, recyclerView3.getHeight());
                RecyclerView recyclerView4 = RecyclerView.this;
                int[] iArr = recyclerView4.F0;
                iArr[0] = 0;
                iArr[1] = 0;
                if (recyclerView4.r(iK, iK2, iArr, null, 1)) {
                    int[] iArr2 = RecyclerView.this.F0;
                    iK -= iArr2[0];
                    iK2 -= iArr2[1];
                }
                if (RecyclerView.this.getOverScrollMode() != 2) {
                    RecyclerView.this.j(iK, iK2);
                }
                RecyclerView recyclerView5 = RecyclerView.this;
                if (recyclerView5.x != null) {
                    int[] iArr3 = recyclerView5.F0;
                    iArr3[0] = 0;
                    iArr3[1] = 0;
                    recyclerView5.h0(iK, iK2, iArr3);
                    RecyclerView recyclerView6 = RecyclerView.this;
                    int[] iArr4 = recyclerView6.F0;
                    i3 = iArr4[0];
                    i2 = iArr4[1];
                    iK -= i3;
                    iK2 -= i2;
                    Objects.requireNonNull(recyclerView6.y);
                } else {
                    i2 = 0;
                    i3 = 0;
                }
                if (!RecyclerView.this.B.isEmpty()) {
                    RecyclerView.this.invalidate();
                }
                RecyclerView recyclerView7 = RecyclerView.this;
                int[] iArr5 = recyclerView7.F0;
                iArr5[0] = 0;
                iArr5[1] = 0;
                recyclerView7.s(i3, i2, iK, iK2, null, 1, iArr5);
                RecyclerView recyclerView8 = RecyclerView.this;
                int[] iArr6 = recyclerView8.F0;
                int i6 = iK - iArr6[0];
                int i7 = iK2 - iArr6[1];
                if (i3 != 0 || i2 != 0) {
                    recyclerView8.t(i3, i2);
                }
                if (!RecyclerView.this.awakenScrollBars()) {
                    RecyclerView.this.invalidate();
                }
                boolean z = overScroller.isFinished() || (((overScroller.getCurrX() == overScroller.getFinalX()) || i6 != 0) && ((overScroller.getCurrY() == overScroller.getFinalY()) || i7 != 0));
                Objects.requireNonNull(RecyclerView.this.y);
                if (z) {
                    if (RecyclerView.this.getOverScrollMode() != 2) {
                        int currVelocity = (int) overScroller.getCurrVelocity();
                        int i8 = i6 < 0 ? -currVelocity : i6 > 0 ? currVelocity : 0;
                        if (i7 < 0) {
                            currVelocity = -currVelocity;
                        } else if (i7 <= 0) {
                            currVelocity = 0;
                        }
                        RecyclerView recyclerView9 = RecyclerView.this;
                        Objects.requireNonNull(recyclerView9);
                        if (i8 < 0) {
                            recyclerView9.v();
                            if (recyclerView9.U.isFinished()) {
                                recyclerView9.U.onAbsorb(-i8);
                            }
                        } else if (i8 > 0) {
                            recyclerView9.w();
                            if (recyclerView9.W.isFinished()) {
                                recyclerView9.W.onAbsorb(i8);
                            }
                        }
                        if (currVelocity < 0) {
                            recyclerView9.x();
                            if (recyclerView9.V.isFinished()) {
                                recyclerView9.V.onAbsorb(-currVelocity);
                            }
                        } else if (currVelocity > 0) {
                            recyclerView9.u();
                            if (recyclerView9.a0.isFinished()) {
                                recyclerView9.a0.onAbsorb(currVelocity);
                            }
                        }
                        if (i8 != 0 || currVelocity != 0) {
                            WeakHashMap<View, i0> weakHashMap = a0.a;
                            a0.d.k(recyclerView9);
                        }
                    }
                    if (RecyclerView.f421h) {
                        m.b bVar = RecyclerView.this.r0;
                        int[] iArr7 = bVar.f1882c;
                        if (iArr7 != null) {
                            Arrays.fill(iArr7, -1);
                        }
                        bVar.f1883d = 0;
                    }
                } else {
                    b();
                    RecyclerView recyclerView10 = RecyclerView.this;
                    c.n.c.m mVar = recyclerView10.q0;
                    if (mVar != null) {
                        mVar.a(recyclerView10, i3, i2);
                    }
                }
            }
            Objects.requireNonNull(RecyclerView.this.y);
            this.f480h = false;
            if (!this.f481i) {
                RecyclerView.this.setScrollState(0);
                RecyclerView.this.p0(1);
            } else {
                RecyclerView.this.removeCallbacks(this);
                RecyclerView recyclerView11 = RecyclerView.this;
                WeakHashMap<View, i0> weakHashMap2 = a0.a;
                a0.d.m(recyclerView11, this);
            }
        }
    }

    public static abstract class z {
        public static final List<Object> a = Collections.emptyList();

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

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public WeakReference<RecyclerView> f484c;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        public int f492k;
        public RecyclerView s;
        public e<? extends z> t;

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

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

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public long f487f = -1;

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

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        public int f489h = -1;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        public z f490i = null;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        public z f491j = null;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        public List<Object> f493l = null;
        public List<Object> m = null;
        public int n = 0;
        public s o = null;
        public boolean p = false;
        public int q = 0;
        public int r = -1;

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

        public void a(Object obj) {
            if (obj == null) {
                b(1024);
                return;
            }
            if ((1024 & this.f492k) == 0) {
                if (this.f493l == null) {
                    ArrayList arrayList = new ArrayList();
                    this.f493l = arrayList;
                    this.m = Collections.unmodifiableList(arrayList);
                }
                this.f493l.add(obj);
            }
        }

        public void b(int i2) {
            this.f492k = i2 | this.f492k;
        }

        public void c() {
            this.f486e = -1;
            this.f489h = -1;
        }

        public void d() {
            this.f492k &= -33;
        }

        public final int e() {
            RecyclerView recyclerView = this.s;
            if (recyclerView == null) {
                return -1;
            }
            return recyclerView.F(this);
        }

        public final int f() {
            int i2 = this.f489h;
            return i2 == -1 ? this.f485d : i2;
        }

        public List<Object> g() {
            if ((this.f492k & 1024) != 0) {
                return a;
            }
            List<Object> list = this.f493l;
            return (list == null || list.size() == 0) ? a : this.m;
        }

        public boolean h(int i2) {
            return (i2 & this.f492k) != 0;
        }

        public boolean i() {
            return (this.f483b.getParent() == null || this.f483b.getParent() == this.s) ? false : true;
        }

        public boolean j() {
            return (this.f492k & 1) != 0;
        }

        public boolean k() {
            return (this.f492k & 4) != 0;
        }

        public final boolean l() {
            if ((this.f492k & 16) == 0) {
                View view = this.f483b;
                WeakHashMap<View, i0> weakHashMap = a0.a;
                if (!a0.d.i(view)) {
                    return true;
                }
            }
            return false;
        }

        public boolean m() {
            return (this.f492k & 8) != 0;
        }

        public boolean n() {
            return this.o != null;
        }

        public boolean o() {
            return (this.f492k & 256) != 0;
        }

        public boolean p() {
            return (this.f492k & 2) != 0;
        }

        public void q(int i2, boolean z) {
            if (this.f486e == -1) {
                this.f486e = this.f485d;
            }
            if (this.f489h == -1) {
                this.f489h = this.f485d;
            }
            if (z) {
                this.f489h += i2;
            }
            this.f485d += i2;
            if (this.f483b.getLayoutParams() != null) {
                ((n) this.f483b.getLayoutParams()).f451c = true;
            }
        }

        public void r() {
            this.f492k = 0;
            this.f485d = -1;
            this.f486e = -1;
            this.f487f = -1L;
            this.f489h = -1;
            this.n = 0;
            this.f490i = null;
            this.f491j = null;
            List<Object> list = this.f493l;
            if (list != null) {
                list.clear();
            }
            this.f492k &= -1025;
            this.q = 0;
            this.r = -1;
            RecyclerView.h(this);
        }

        public void s(int i2, int i3) {
            this.f492k = (i2 & i3) | (this.f492k & (~i3));
        }

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

        public String toString() {
            StringBuilder sbD = d.b.a.a.a.D(getClass().isAnonymousClass() ? "ViewHolder" : getClass().getSimpleName(), "{");
            sbD.append(Integer.toHexString(hashCode()));
            sbD.append(" position=");
            sbD.append(this.f485d);
            sbD.append(" id=");
            sbD.append(this.f487f);
            sbD.append(", oldPos=");
            sbD.append(this.f486e);
            sbD.append(", pLpos:");
            sbD.append(this.f489h);
            StringBuilder sb = new StringBuilder(sbD.toString());
            if (n()) {
                sb.append(" scrap ");
                sb.append(this.p ? "[changeScrap]" : "[attachedScrap]");
            }
            if (k()) {
                sb.append(" invalid");
            }
            if (!j()) {
                sb.append(" unbound");
            }
            boolean z = true;
            if ((this.f492k & 2) != 0) {
                sb.append(" update");
            }
            if (m()) {
                sb.append(" removed");
            }
            if (u()) {
                sb.append(" ignored");
            }
            if (o()) {
                sb.append(" tmpDetached");
            }
            if (!l()) {
                StringBuilder sbB = d.b.a.a.a.B(" not recyclable(");
                sbB.append(this.n);
                sbB.append(")");
                sb.append(sbB.toString());
            }
            if ((this.f492k & 512) == 0 && !k()) {
                z = false;
            }
            if (z) {
                sb.append(" undefined adapter position");
            }
            if (this.f483b.getParent() == null) {
                sb.append(" no parent");
            }
            sb.append("}");
            return sb.toString();
        }

        public boolean u() {
            return (this.f492k & 128) != 0;
        }

        public boolean v() {
            return (this.f492k & 32) != 0;
        }
    }

    static {
        Class<?> cls = Integer.TYPE;
        f422i = new Class[]{Context.class, AttributeSet.class, cls, cls};
        f423j = new c();
        f424k = new w();
    }

    public RecyclerView(Context context, AttributeSet attributeSet) {
        Constructor constructor;
        Object[] objArr;
        super(context, attributeSet, com.ifpdos.debugmenu.R.attr.recyclerViewStyle);
        this.m = new u();
        this.n = new s();
        this.r = new c.n.c.x();
        this.t = new a();
        this.u = new Rect();
        this.v = new Rect();
        this.w = new RectF();
        this.A = new ArrayList();
        this.B = new ArrayList<>();
        this.C = new ArrayList<>();
        this.I = 0;
        this.P = false;
        this.Q = false;
        this.R = 0;
        this.S = 0;
        this.T = f424k;
        this.b0 = new c.n.c.k();
        this.c0 = 0;
        this.d0 = -1;
        this.m0 = Float.MIN_VALUE;
        this.n0 = Float.MIN_VALUE;
        this.o0 = true;
        this.p0 = new y();
        this.r0 = f421h ? new m.b() : null;
        this.s0 = new v();
        this.v0 = false;
        this.w0 = false;
        this.x0 = new k();
        this.y0 = false;
        char c2 = 2;
        this.B0 = new int[2];
        this.D0 = new int[2];
        this.E0 = new int[2];
        this.F0 = new int[2];
        this.G0 = new ArrayList();
        this.H0 = new b();
        this.J0 = 0;
        this.K0 = 0;
        this.L0 = new d();
        setScrollContainer(true);
        setFocusableInTouchMode(true);
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        this.j0 = viewConfiguration.getScaledTouchSlop();
        this.m0 = b0.a(viewConfiguration);
        this.n0 = b0.b(viewConfiguration);
        this.k0 = viewConfiguration.getScaledMinimumFlingVelocity();
        this.l0 = viewConfiguration.getScaledMaximumFlingVelocity();
        this.f425l = context.getResources().getDisplayMetrics().density * 160.0f * 386.0878f * 0.84f;
        setWillNotDraw(getOverScrollMode() == 2);
        this.b0.a = this.x0;
        this.p = new c.n.c.a(new c.n.c.t(this));
        this.q = new c.n.c.b(new c.n.c.s(this));
        WeakHashMap<View, i0> weakHashMap = a0.a;
        if (a0.j.b(this) == 0) {
            a0.j.l(this, 8);
        }
        if (a0.d.c(this) == 0) {
            a0.d.s(this, 1);
        }
        this.O = (AccessibilityManager) getContext().getSystemService("accessibility");
        setAccessibilityDelegateCompat(new c.n.c.u(this));
        int[] iArr = c.n.b.a;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, iArr, com.ifpdos.debugmenu.R.attr.recyclerViewStyle, 0);
        a0.k(this, context, iArr, attributeSet, typedArrayObtainStyledAttributes, com.ifpdos.debugmenu.R.attr.recyclerViewStyle, 0);
        String string = typedArrayObtainStyledAttributes.getString(8);
        if (typedArrayObtainStyledAttributes.getInt(2, -1) == -1) {
            setDescendantFocusability(262144);
        }
        this.s = typedArrayObtainStyledAttributes.getBoolean(1, true);
        boolean z2 = typedArrayObtainStyledAttributes.getBoolean(3, false);
        this.G = z2;
        int i2 = 4;
        if (z2) {
            StateListDrawable stateListDrawable = (StateListDrawable) typedArrayObtainStyledAttributes.getDrawable(6);
            Drawable drawable = typedArrayObtainStyledAttributes.getDrawable(7);
            StateListDrawable stateListDrawable2 = (StateListDrawable) typedArrayObtainStyledAttributes.getDrawable(4);
            Drawable drawable2 = typedArrayObtainStyledAttributes.getDrawable(5);
            if (stateListDrawable == null || drawable == null || stateListDrawable2 == null || drawable2 == null) {
                throw new IllegalArgumentException(d.b.a.a.a.g(this, d.b.a.a.a.B("Trying to set fast scroller without both required drawables.")));
            }
            Resources resources = getContext().getResources();
            new c.n.c.l(this, stateListDrawable, drawable, stateListDrawable2, drawable2, resources.getDimensionPixelSize(com.ifpdos.debugmenu.R.dimen.fastscroll_default_thickness), resources.getDimensionPixelSize(com.ifpdos.debugmenu.R.dimen.fastscroll_minimum_range), resources.getDimensionPixelOffset(com.ifpdos.debugmenu.R.dimen.fastscroll_margin));
            i2 = 4;
            c2 = 2;
        }
        typedArrayObtainStyledAttributes.recycle();
        if (string != null) {
            String strTrim = string.trim();
            if (!strTrim.isEmpty()) {
                if (strTrim.charAt(0) == '.') {
                    strTrim = context.getPackageName() + strTrim;
                } else if (!strTrim.contains(".")) {
                    strTrim = RecyclerView.class.getPackage().getName() + '.' + strTrim;
                }
                String str = strTrim;
                try {
                    Class<? extends U> clsAsSubclass = Class.forName(str, false, isInEditMode() ? getClass().getClassLoader() : context.getClassLoader()).asSubclass(m.class);
                    try {
                        constructor = clsAsSubclass.getConstructor(f422i);
                        Object[] objArr2 = new Object[i2];
                        objArr2[0] = context;
                        objArr2[1] = attributeSet;
                        objArr2[c2] = Integer.valueOf(com.ifpdos.debugmenu.R.attr.recyclerViewStyle);
                        objArr2[3] = 0;
                        objArr = objArr2;
                    } catch (NoSuchMethodException e2) {
                        try {
                            constructor = clsAsSubclass.getConstructor(new Class[0]);
                            objArr = null;
                        } catch (NoSuchMethodException e3) {
                            e3.initCause(e2);
                            throw new IllegalStateException(attributeSet.getPositionDescription() + ": Error creating LayoutManager " + str, e3);
                        }
                    }
                    constructor.setAccessible(true);
                    setLayoutManager((m) constructor.newInstance(objArr));
                } catch (ClassCastException e4) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Class is not a LayoutManager " + str, e4);
                } catch (ClassNotFoundException e5) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Unable to find LayoutManager " + str, e5);
                } catch (IllegalAccessException e6) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Cannot access non-public constructor " + str, e6);
                } catch (InstantiationException e7) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Could not instantiate the LayoutManager: " + str, e7);
                } catch (InvocationTargetException e8) {
                    throw new IllegalStateException(attributeSet.getPositionDescription() + ": Could not instantiate the LayoutManager: " + str, e8);
                }
            }
        }
        int[] iArr2 = f417b;
        TypedArray typedArrayObtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, iArr2, com.ifpdos.debugmenu.R.attr.recyclerViewStyle, 0);
        a0.k(this, context, iArr2, attributeSet, typedArrayObtainStyledAttributes2, com.ifpdos.debugmenu.R.attr.recyclerViewStyle, 0);
        boolean z3 = typedArrayObtainStyledAttributes2.getBoolean(0, true);
        typedArrayObtainStyledAttributes2.recycle();
        setNestedScrollingEnabled(z3);
        g.h0.c.l.f(this, "<this>");
        setTag(com.ifpdos.debugmenu.R.id.is_pooling_container_tag, Boolean.TRUE);
    }

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

    public static z J(View view) {
        if (view == null) {
            return null;
        }
        return ((n) view.getLayoutParams()).a;
    }

    private c.f.j.o getScrollingChildHelper() {
        if (this.C0 == null) {
            this.C0 = new c.f.j.o(this);
        }
        return this.C0;
    }

    public static void h(z zVar) {
        WeakReference<RecyclerView> weakReference = zVar.f484c;
        if (weakReference != null) {
            RecyclerView recyclerView = weakReference.get();
            while (recyclerView != null) {
                if (recyclerView == zVar.f483b) {
                    return;
                }
                Object parent = recyclerView.getParent();
                recyclerView = parent instanceof View ? (View) parent : null;
            }
            zVar.f484c = null;
        }
    }

    public View A(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 final boolean B(MotionEvent motionEvent) {
        int action = motionEvent.getAction();
        int size = this.C.size();
        for (int i2 = 0; i2 < size; i2++) {
            p pVar = this.C.get(i2);
            if (pVar.b(this, motionEvent) && action != 3) {
                this.D = pVar;
                return true;
            }
        }
        return false;
    }

    public final void C(int[] iArr) {
        int iE = this.q.e();
        if (iE == 0) {
            iArr[0] = -1;
            iArr[1] = -1;
            return;
        }
        int i2 = Integer.MAX_VALUE;
        int i3 = Integer.MIN_VALUE;
        for (int i4 = 0; i4 < iE; i4++) {
            z zVarJ = J(this.q.d(i4));
            if (!zVarJ.u()) {
                int iF = zVarJ.f();
                if (iF < i2) {
                    i2 = iF;
                }
                if (iF > i3) {
                    i3 = iF;
                }
            }
        }
        iArr[0] = i2;
        iArr[1] = i3;
    }

    public z E(int i2) {
        z zVar = null;
        if (this.P) {
            return null;
        }
        int iH = this.q.h();
        for (int i3 = 0; i3 < iH; i3++) {
            z zVarJ = J(this.q.g(i3));
            if (zVarJ != null && !zVarJ.m() && F(zVarJ) == i2) {
                if (!this.q.k(zVarJ.f483b)) {
                    return zVarJ;
                }
                zVar = zVarJ;
            }
        }
        return zVar;
    }

    public int F(z zVar) {
        if (!zVar.h(524) && zVar.j()) {
            c.n.c.a aVar = this.p;
            int i2 = zVar.f485d;
            int size = aVar.f1814b.size();
            for (int i3 = 0; i3 < size; i3++) {
                a.b bVar = aVar.f1814b.get(i3);
                int i4 = bVar.a;
                if (i4 != 1) {
                    if (i4 == 2) {
                        int i5 = bVar.f1819b;
                        if (i5 <= i2) {
                            int i6 = bVar.f1821d;
                            if (i5 + i6 <= i2) {
                                i2 -= i6;
                            }
                        } else {
                            continue;
                        }
                    } else if (i4 == 8) {
                        int i7 = bVar.f1819b;
                        if (i7 == i2) {
                            i2 = bVar.f1821d;
                        } else {
                            if (i7 < i2) {
                                i2--;
                            }
                            if (bVar.f1821d <= i2) {
                                i2++;
                            }
                        }
                    }
                } else if (bVar.f1819b <= i2) {
                    i2 += bVar.f1821d;
                }
            }
            return i2;
        }
        return -1;
    }

    public long G(z zVar) {
        Objects.requireNonNull(this.x);
        return zVar.f485d;
    }

    public int H(View view) {
        z zVarJ = J(view);
        if (zVarJ != null) {
            return zVarJ.e();
        }
        return -1;
    }

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

    public Rect K(View view) {
        n nVar = (n) view.getLayoutParams();
        if (!nVar.f451c) {
            return nVar.f450b;
        }
        if (this.s0.f469f && (nVar.b() || nVar.a.k())) {
            return nVar.f450b;
        }
        Rect rect = nVar.f450b;
        rect.set(0, 0, 0, 0);
        int size = this.B.size();
        for (int i2 = 0; i2 < size; i2++) {
            this.u.set(0, 0, 0, 0);
            l lVar = this.B.get(i2);
            Rect rect2 = this.u;
            Objects.requireNonNull(lVar);
            ((n) view.getLayoutParams()).a();
            rect2.set(0, 0, 0, 0);
            int i3 = rect.left;
            Rect rect3 = this.u;
            rect.left = i3 + rect3.left;
            rect.top += rect3.top;
            rect.right += rect3.right;
            rect.bottom += rect3.bottom;
        }
        nVar.f451c = false;
        return rect;
    }

    public boolean L() {
        return !this.H || this.P || this.p.g();
    }

    public void M() {
        this.a0 = null;
        this.V = null;
        this.W = null;
        this.U = null;
    }

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

    public void O() {
        int iH = this.q.h();
        for (int i2 = 0; i2 < iH; i2++) {
            ((n) this.q.g(i2).getLayoutParams()).f451c = true;
        }
        s sVar = this.n;
        int size = sVar.f459c.size();
        for (int i3 = 0; i3 < size; i3++) {
            n nVar = (n) sVar.f459c.get(i3).f483b.getLayoutParams();
            if (nVar != null) {
                nVar.f451c = true;
            }
        }
    }

    public void P(int i2, int i3, boolean z2) {
        int i4 = i2 + i3;
        int iH = this.q.h();
        for (int i5 = 0; i5 < iH; i5++) {
            z zVarJ = J(this.q.g(i5));
            if (zVarJ != null && !zVarJ.u()) {
                int i6 = zVarJ.f485d;
                if (i6 >= i4) {
                    zVarJ.q(-i3, z2);
                    this.s0.f468e = true;
                } else if (i6 >= i2) {
                    zVarJ.b(8);
                    zVarJ.q(-i3, z2);
                    zVarJ.f485d = i2 - 1;
                    this.s0.f468e = true;
                }
            }
        }
        s sVar = this.n;
        int size = sVar.f459c.size();
        while (true) {
            size--;
            if (size < 0) {
                requestLayout();
                return;
            }
            z zVar = sVar.f459c.get(size);
            if (zVar != null) {
                int i7 = zVar.f485d;
                if (i7 >= i4) {
                    zVar.q(-i3, z2);
                } else if (i7 >= i2) {
                    zVar.b(8);
                    sVar.h(size);
                }
            }
        }
    }

    public void Q() {
    }

    public void R() {
    }

    public void S() {
        this.R++;
    }

    public void T(boolean z2) {
        int i2;
        int i3 = this.R - 1;
        this.R = i3;
        if (i3 < 1) {
            this.R = 0;
            if (z2) {
                int i4 = this.M;
                this.M = 0;
                if (i4 != 0) {
                    AccessibilityManager accessibilityManager = this.O;
                    if (accessibilityManager != null && accessibilityManager.isEnabled()) {
                        AccessibilityEvent accessibilityEventObtain = AccessibilityEvent.obtain();
                        accessibilityEventObtain.setEventType(2048);
                        c.f.j.n0.b.b(accessibilityEventObtain, i4);
                        sendAccessibilityEventUnchecked(accessibilityEventObtain);
                    }
                }
                for (int size = this.G0.size() - 1; size >= 0; size--) {
                    z zVar = this.G0.get(size);
                    if (zVar.f483b.getParent() == this && !zVar.u() && (i2 = zVar.r) != -1) {
                        View view = zVar.f483b;
                        WeakHashMap<View, i0> weakHashMap = a0.a;
                        a0.d.s(view, i2);
                        zVar.r = -1;
                    }
                }
                this.G0.clear();
            }
        }
    }

    public final void U(MotionEvent motionEvent) {
        int actionIndex = motionEvent.getActionIndex();
        if (motionEvent.getPointerId(actionIndex) == this.d0) {
            int i2 = actionIndex == 0 ? 1 : 0;
            this.d0 = motionEvent.getPointerId(i2);
            int x2 = (int) (motionEvent.getX(i2) + 0.5f);
            this.h0 = x2;
            this.f0 = x2;
            int y2 = (int) (motionEvent.getY(i2) + 0.5f);
            this.i0 = y2;
            this.g0 = y2;
        }
    }

    public void V() {
    }

    public void W() {
    }

    public void X() {
        if (this.y0 || !this.E) {
            return;
        }
        Runnable runnable = this.H0;
        WeakHashMap<View, i0> weakHashMap = a0.a;
        a0.d.m(this, runnable);
        this.y0 = true;
    }

    public final void Y() {
        boolean z2;
        boolean z3;
        boolean z4 = false;
        if (this.P) {
            c.n.c.a aVar = this.p;
            aVar.l(aVar.f1814b);
            aVar.l(aVar.f1815c);
            aVar.f1818f = 0;
            if (this.Q) {
                this.y.k0(this);
            }
        }
        if (this.b0 != null && this.y.Q0()) {
            this.p.j();
        } else {
            this.p.c();
        }
        boolean z5 = this.v0 || this.w0;
        v vVar = this.s0;
        if (!this.H || this.b0 == null || (!(z3 = this.P) && !z5 && !this.y.f441g)) {
            z2 = false;
        } else if (z3) {
            Objects.requireNonNull(this.x);
            z2 = false;
        } else {
            z2 = true;
        }
        vVar.f472i = z2;
        v vVar2 = this.s0;
        if (vVar2.f472i && z5 && !this.P) {
            if (this.b0 != null && this.y.Q0()) {
                z4 = true;
            }
        }
        vVar2.f473j = z4;
    }

    public void Z(boolean z2) {
        this.Q = z2 | this.Q;
        this.P = true;
        int iH = this.q.h();
        for (int i2 = 0; i2 < iH; i2++) {
            z zVarJ = J(this.q.g(i2));
            if (zVarJ != null && !zVarJ.u()) {
                zVarJ.b(6);
            }
        }
        O();
        s sVar = this.n;
        int size = sVar.f459c.size();
        for (int i3 = 0; i3 < size; i3++) {
            z zVar = sVar.f459c.get(i3);
            if (zVar != null) {
                zVar.b(6);
                zVar.a(null);
            }
        }
        e eVar = RecyclerView.this.x;
        sVar.g();
    }

    public void a0(z zVar, j.c cVar) {
        zVar.s(0, InvokeCmd.CMD_TOUCH_CTRL_START);
        if (this.s0.f470g && zVar.p() && !zVar.m() && !zVar.u()) {
            Objects.requireNonNull(this.x);
            this.r.f1908b.e(zVar.f485d, zVar);
        }
        this.r.c(zVar, cVar);
    }

    @Override // android.view.ViewGroup, android.view.View
    public void addFocusables(ArrayList<View> arrayList, int i2, int i3) {
        m mVar = this.y;
        if (mVar == null || !mVar.Y()) {
            super.addFocusables(arrayList, i2, i3);
        }
    }

    public final int b0(int i2, float f2) {
        float height = f2 / getHeight();
        float width = i2 / getWidth();
        EdgeEffect edgeEffect = this.U;
        float f3 = 0.0f;
        if (edgeEffect == null || c.f.b.h.m(edgeEffect) == 0.0f) {
            EdgeEffect edgeEffect2 = this.W;
            if (edgeEffect2 != null && c.f.b.h.m(edgeEffect2) != 0.0f) {
                if (canScrollHorizontally(1)) {
                    this.W.onRelease();
                } else {
                    float fX = c.f.b.h.x(this.W, width, height);
                    if (c.f.b.h.m(this.W) == 0.0f) {
                        this.W.onRelease();
                    }
                    f3 = fX;
                }
                invalidate();
            }
        } else {
            if (canScrollHorizontally(-1)) {
                this.U.onRelease();
            } else {
                float f4 = -c.f.b.h.x(this.U, -width, 1.0f - height);
                if (c.f.b.h.m(this.U) == 0.0f) {
                    this.U.onRelease();
                }
                f3 = f4;
            }
            invalidate();
        }
        return Math.round(f3 * getWidth());
    }

    public final int c0(int i2, float f2) {
        float width = f2 / getWidth();
        float height = i2 / getHeight();
        EdgeEffect edgeEffect = this.V;
        float f3 = 0.0f;
        if (edgeEffect == null || c.f.b.h.m(edgeEffect) == 0.0f) {
            EdgeEffect edgeEffect2 = this.a0;
            if (edgeEffect2 != null && c.f.b.h.m(edgeEffect2) != 0.0f) {
                if (canScrollVertically(1)) {
                    this.a0.onRelease();
                } else {
                    float fX = c.f.b.h.x(this.a0, height, 1.0f - width);
                    if (c.f.b.h.m(this.a0) == 0.0f) {
                        this.a0.onRelease();
                    }
                    f3 = fX;
                }
                invalidate();
            }
        } else {
            if (canScrollVertically(-1)) {
                this.V.onRelease();
            } else {
                float f4 = -c.f.b.h.x(this.V, -height, width);
                if (c.f.b.h.m(this.V) == 0.0f) {
                    this.V.onRelease();
                }
                f3 = f4;
            }
            invalidate();
        }
        return Math.round(f3 * getHeight());
    }

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

    @Override // android.view.View
    public int computeHorizontalScrollExtent() {
        m mVar = this.y;
        if (mVar != null && mVar.d()) {
            return this.y.j(this.s0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeHorizontalScrollOffset() {
        m mVar = this.y;
        if (mVar != null && mVar.d()) {
            return this.y.k(this.s0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeHorizontalScrollRange() {
        m mVar = this.y;
        if (mVar != null && mVar.d()) {
            return this.y.l(this.s0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollExtent() {
        m mVar = this.y;
        if (mVar != null && mVar.e()) {
            return this.y.m(this.s0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollOffset() {
        m mVar = this.y;
        if (mVar != null && mVar.e()) {
            return this.y.n(this.s0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollRange() {
        m mVar = this.y;
        if (mVar != null && mVar.e()) {
            return this.y.o(this.s0);
        }
        return 0;
    }

    public void d0() {
        j jVar = this.b0;
        if (jVar != null) {
            jVar.f();
        }
        m mVar = this.y;
        if (mVar != null) {
            mVar.z0(this.n);
            this.y.A0(this.n);
        }
        this.n.b();
    }

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

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

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

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

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

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

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

    @Override // android.view.View
    public void draw(Canvas canvas) {
        boolean z2;
        super.draw(canvas);
        int size = this.B.size();
        boolean z3 = false;
        for (int i2 = 0; i2 < size; i2++) {
            this.B.get(i2).d(canvas, this, this.s0);
        }
        EdgeEffect edgeEffect = this.U;
        if (edgeEffect == null || edgeEffect.isFinished()) {
            z2 = false;
        } else {
            int iSave = canvas.save();
            int paddingBottom = this.s ? getPaddingBottom() : 0;
            canvas.rotate(270.0f);
            canvas.translate((-getHeight()) + paddingBottom, 0.0f);
            EdgeEffect edgeEffect2 = this.U;
            z2 = edgeEffect2 != null && edgeEffect2.draw(canvas);
            canvas.restoreToCount(iSave);
        }
        EdgeEffect edgeEffect3 = this.V;
        if (edgeEffect3 != null && !edgeEffect3.isFinished()) {
            int iSave2 = canvas.save();
            if (this.s) {
                canvas.translate(getPaddingLeft(), getPaddingTop());
            }
            EdgeEffect edgeEffect4 = this.V;
            z2 |= edgeEffect4 != null && edgeEffect4.draw(canvas);
            canvas.restoreToCount(iSave2);
        }
        EdgeEffect edgeEffect5 = this.W;
        if (edgeEffect5 != null && !edgeEffect5.isFinished()) {
            int iSave3 = canvas.save();
            int width = getWidth();
            int paddingTop = this.s ? getPaddingTop() : 0;
            canvas.rotate(90.0f);
            canvas.translate(paddingTop, -width);
            EdgeEffect edgeEffect6 = this.W;
            z2 |= edgeEffect6 != null && edgeEffect6.draw(canvas);
            canvas.restoreToCount(iSave3);
        }
        EdgeEffect edgeEffect7 = this.a0;
        if (edgeEffect7 != null && !edgeEffect7.isFinished()) {
            int iSave4 = canvas.save();
            canvas.rotate(180.0f);
            if (this.s) {
                canvas.translate(getPaddingRight() + (-getWidth()), getPaddingBottom() + (-getHeight()));
            } else {
                canvas.translate(-getWidth(), -getHeight());
            }
            EdgeEffect edgeEffect8 = this.a0;
            if (edgeEffect8 != null && edgeEffect8.draw(canvas)) {
                z3 = true;
            }
            z2 |= z3;
            canvas.restoreToCount(iSave4);
        }
        if ((z2 || this.b0 == null || this.B.size() <= 0 || !this.b0.g()) ? z2 : true) {
            WeakHashMap<View, i0> weakHashMap = a0.a;
            a0.d.k(this);
        }
    }

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

    public final void e(z zVar) {
        View view = zVar.f483b;
        boolean z2 = view.getParent() == this;
        this.n.m(I(view));
        if (zVar.o()) {
            this.q.b(view, -1, view.getLayoutParams(), true);
            return;
        }
        if (!z2) {
            this.q.a(view, -1, true);
            return;
        }
        c.n.c.b bVar = this.q;
        int iIndexOfChild = ((c.n.c.s) bVar.a).a.indexOfChild(view);
        if (iIndexOfChild >= 0) {
            bVar.f1822b.h(iIndexOfChild);
            bVar.i(view);
        } else {
            throw new IllegalArgumentException("view is not a child, cannot hide " + view);
        }
    }

    public final void e0(View view, View view2) {
        View view3 = view2 != null ? view2 : view;
        this.u.set(0, 0, view3.getWidth(), view3.getHeight());
        ViewGroup.LayoutParams layoutParams = view3.getLayoutParams();
        if (layoutParams instanceof n) {
            n nVar = (n) layoutParams;
            if (!nVar.f451c) {
                Rect rect = nVar.f450b;
                Rect rect2 = this.u;
                rect2.left -= rect.left;
                rect2.right += rect.right;
                rect2.top -= rect.top;
                rect2.bottom += rect.bottom;
            }
        }
        if (view2 != null) {
            offsetDescendantRectToMyCoords(view2, this.u);
            offsetRectIntoDescendantCoords(view, this.u);
        }
        this.y.E0(this, view, this.u, !this.H, view2 == null);
    }

    public void f(String str) {
        if (N()) {
            if (str != null) {
                throw new IllegalStateException(str);
            }
            throw new IllegalStateException(d.b.a.a.a.g(this, d.b.a.a.a.B("Cannot call this method while RecyclerView is computing a layout or scrolling")));
        }
        if (this.S > 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(d.b.a.a.a.g(this, d.b.a.a.a.B(""))));
        }
    }

    public final void f0() {
        VelocityTracker velocityTracker = this.e0;
        if (velocityTracker != null) {
            velocityTracker.clear();
        }
        boolean zIsFinished = false;
        p0(0);
        EdgeEffect edgeEffect = this.U;
        if (edgeEffect != null) {
            edgeEffect.onRelease();
            zIsFinished = this.U.isFinished();
        }
        EdgeEffect edgeEffect2 = this.V;
        if (edgeEffect2 != null) {
            edgeEffect2.onRelease();
            zIsFinished |= this.V.isFinished();
        }
        EdgeEffect edgeEffect3 = this.W;
        if (edgeEffect3 != null) {
            edgeEffect3.onRelease();
            zIsFinished |= this.W.isFinished();
        }
        EdgeEffect edgeEffect4 = this.a0;
        if (edgeEffect4 != null) {
            edgeEffect4.onRelease();
            zIsFinished |= this.a0.isFinished();
        }
        if (zIsFinished) {
            WeakHashMap<View, i0> weakHashMap = a0.a;
            a0.d.k(this);
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:139:0x019d  */
    /* JADX WARN: Removed duplicated region for block: B:27:0x0046  */
    /* JADX WARN: Removed duplicated region for block: B:33:0x0059  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x005b  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x005e  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x0060  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x0064  */
    /* JADX WARN: Removed duplicated region for block: B:41:0x0067  */
    /* JADX WARN: Removed duplicated region for block: B:44:0x006e  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x0070  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x0073  */
    @Override // android.view.ViewGroup, android.view.ViewParent
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public android.view.View focusSearch(android.view.View r14, int r15) {
        /*
            Method dump skipped, instruction units count: 422
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.focusSearch(android.view.View, int):android.view.View");
    }

    public final void g() {
        f0();
        setScrollState(0);
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x00e1  */
    /* JADX WARN: Removed duplicated region for block: B:32:0x00f7  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x0114  */
    /* JADX WARN: Removed duplicated region for block: B:41:0x011c  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean g0(int r19, int r20, android.view.MotionEvent r21, int r22) {
        /*
            Method dump skipped, instruction units count: 319
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.g0(int, int, android.view.MotionEvent, int):boolean");
    }

    @Override // android.view.ViewGroup
    public ViewGroup.LayoutParams generateDefaultLayoutParams() {
        m mVar = this.y;
        if (mVar != null) {
            return mVar.t();
        }
        throw new IllegalStateException(d.b.a.a.a.g(this, d.b.a.a.a.B("RecyclerView has no LayoutManager")));
    }

    @Override // android.view.ViewGroup
    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        m mVar = this.y;
        if (mVar != null) {
            return mVar.u(getContext(), attributeSet);
        }
        throw new IllegalStateException(d.b.a.a.a.g(this, d.b.a.a.a.B("RecyclerView has no LayoutManager")));
    }

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

    public e getAdapter() {
        return this.x;
    }

    @Override // android.view.View
    public int getBaseline() {
        m mVar = this.y;
        if (mVar == null) {
            return super.getBaseline();
        }
        Objects.requireNonNull(mVar);
        return -1;
    }

    @Override // android.view.ViewGroup
    public int getChildDrawingOrder(int i2, int i3) {
        h hVar = this.A0;
        return hVar == null ? super.getChildDrawingOrder(i2, i3) : hVar.a(i2, i3);
    }

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

    public c.n.c.u getCompatAccessibilityDelegate() {
        return this.z0;
    }

    public i getEdgeEffectFactory() {
        return this.T;
    }

    public j getItemAnimator() {
        return this.b0;
    }

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

    public m getLayoutManager() {
        return this.y;
    }

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

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

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

    public o getOnFlingListener() {
        return null;
    }

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

    public r getRecycledViewPool() {
        return this.n.d();
    }

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

    public void h0(int i2, int i3, int[] iArr) {
        z zVar;
        m0();
        S();
        int i4 = c.f.f.g.a;
        g.a.a("RV Scroll");
        z(this.s0);
        int iG0 = i2 != 0 ? this.y.G0(i2, this.n, this.s0) : 0;
        int iH0 = i3 != 0 ? this.y.H0(i3, this.n, this.s0) : 0;
        g.a.b();
        int iE = this.q.e();
        for (int i5 = 0; i5 < iE; i5++) {
            View viewD = this.q.d(i5);
            z zVarI = I(viewD);
            if (zVarI != null && (zVar = zVarI.f491j) != null) {
                View view = zVar.f483b;
                int left = viewD.getLeft();
                int top = viewD.getTop();
                if (left != view.getLeft() || top != view.getTop()) {
                    view.layout(left, top, view.getWidth() + left, view.getHeight() + top);
                }
            }
        }
        T(true);
        o0(false);
        if (iArr != null) {
            iArr[0] = iG0;
            iArr[1] = iH0;
        }
    }

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

    public void i() {
        int iH = this.q.h();
        for (int i2 = 0; i2 < iH; i2++) {
            z zVarJ = J(this.q.g(i2));
            if (!zVarJ.u()) {
                zVarJ.c();
            }
        }
        s sVar = this.n;
        int size = sVar.f459c.size();
        for (int i3 = 0; i3 < size; i3++) {
            sVar.f459c.get(i3).c();
        }
        int size2 = sVar.a.size();
        for (int i4 = 0; i4 < size2; i4++) {
            sVar.a.get(i4).c();
        }
        ArrayList<z> arrayList = sVar.f458b;
        if (arrayList != null) {
            int size3 = arrayList.size();
            for (int i5 = 0; i5 < size3; i5++) {
                sVar.f458b.get(i5).c();
            }
        }
    }

    public boolean i0(z zVar, int i2) {
        if (N()) {
            zVar.r = i2;
            this.G0.add(zVar);
            return false;
        }
        View view = zVar.f483b;
        WeakHashMap<View, i0> weakHashMap = a0.a;
        a0.d.s(view, i2);
        return true;
    }

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

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

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

    public void j(int i2, int i3) {
        boolean zIsFinished;
        EdgeEffect edgeEffect = this.U;
        if (edgeEffect == null || edgeEffect.isFinished() || i2 <= 0) {
            zIsFinished = false;
        } else {
            this.U.onRelease();
            zIsFinished = this.U.isFinished();
        }
        EdgeEffect edgeEffect2 = this.W;
        if (edgeEffect2 != null && !edgeEffect2.isFinished() && i2 < 0) {
            this.W.onRelease();
            zIsFinished |= this.W.isFinished();
        }
        EdgeEffect edgeEffect3 = this.V;
        if (edgeEffect3 != null && !edgeEffect3.isFinished() && i3 > 0) {
            this.V.onRelease();
            zIsFinished |= this.V.isFinished();
        }
        EdgeEffect edgeEffect4 = this.a0;
        if (edgeEffect4 != null && !edgeEffect4.isFinished() && i3 < 0) {
            this.a0.onRelease();
            zIsFinished |= this.a0.isFinished();
        }
        if (zIsFinished) {
            WeakHashMap<View, i0> weakHashMap = a0.a;
            a0.d.k(this);
        }
    }

    public final boolean j0(EdgeEffect edgeEffect, int i2, int i3) {
        if (i2 > 0) {
            return true;
        }
        float fM = c.f.b.h.m(edgeEffect) * i3;
        double dLog = Math.log((Math.abs(-i2) * 0.35f) / (this.f425l * 0.015f));
        double d2 = f418e;
        return ((float) (Math.exp((d2 / (d2 - 1.0d)) * dLog) * ((double) (this.f425l * 0.015f)))) < fM;
    }

    public final int k(int i2, EdgeEffect edgeEffect, EdgeEffect edgeEffect2, int i3) {
        if (i2 > 0 && edgeEffect != null && c.f.b.h.m(edgeEffect) != 0.0f) {
            int iRound = Math.round(c.f.b.h.x(edgeEffect, ((-i2) * 4.0f) / i3, 0.5f) * ((-i3) / 4.0f));
            if (iRound != i2) {
                edgeEffect.finish();
            }
            return i2 - iRound;
        }
        if (i2 >= 0 || edgeEffect2 == null || c.f.b.h.m(edgeEffect2) == 0.0f) {
            return i2;
        }
        float f2 = i3;
        int iRound2 = Math.round(c.f.b.h.x(edgeEffect2, (i2 * 4.0f) / f2, 0.5f) * (f2 / 4.0f));
        if (iRound2 != i2) {
            edgeEffect2.finish();
        }
        return i2 - iRound2;
    }

    public void k0(int i2, int i3) {
        l0(i2, i3, null, Integer.MIN_VALUE, false);
    }

    public void l() {
        if (!this.H || this.P) {
            int i2 = c.f.f.g.a;
            g.a.a("RV FullInvalidate");
            o();
            g.a.b();
            return;
        }
        if (this.p.g()) {
            c.n.c.a aVar = this.p;
            int i3 = aVar.f1818f;
            boolean z2 = false;
            if ((i3 & 4) != 0) {
                if (!((i3 & 11) != 0)) {
                    int i4 = c.f.f.g.a;
                    g.a.a("RV PartialInvalidate");
                    m0();
                    S();
                    this.p.j();
                    if (!this.J) {
                        int iE = this.q.e();
                        int i5 = 0;
                        while (true) {
                            if (i5 < iE) {
                                z zVarJ = J(this.q.d(i5));
                                if (zVarJ != null && !zVarJ.u() && zVarJ.p()) {
                                    z2 = true;
                                    break;
                                }
                                i5++;
                            } else {
                                break;
                            }
                        }
                        if (z2) {
                            o();
                        } else {
                            this.p.b();
                        }
                    }
                    o0(true);
                    T(true);
                    g.a.b();
                    return;
                }
            }
            if (aVar.g()) {
                int i6 = c.f.f.g.a;
                g.a.a("RV FullInvalidate");
                o();
                g.a.b();
            }
        }
    }

    public void l0(int i2, int i3, Interpolator interpolator, int i4, boolean z2) {
        m mVar = this.y;
        if (mVar == null) {
            Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.K) {
            return;
        }
        int i5 = !mVar.d() ? 0 : i2;
        int i6 = !this.y.e() ? 0 : i3;
        if (i5 == 0 && i6 == 0) {
            return;
        }
        if (!(i4 == Integer.MIN_VALUE || i4 > 0)) {
            scrollBy(i5, i6);
            return;
        }
        if (z2) {
            int i7 = i5 != 0 ? 1 : 0;
            if (i6 != 0) {
                i7 |= 2;
            }
            n0(i7, 1);
        }
        y yVar = this.p0;
        Objects.requireNonNull(yVar);
        if (i4 == Integer.MIN_VALUE) {
            int iAbs = Math.abs(i5);
            int iAbs2 = Math.abs(i6);
            boolean z3 = iAbs > iAbs2;
            RecyclerView recyclerView = RecyclerView.this;
            int width = z3 ? recyclerView.getWidth() : recyclerView.getHeight();
            if (!z3) {
                iAbs = iAbs2;
            }
            i4 = Math.min((int) (((iAbs / width) + 1.0f) * 300.0f), 2000);
        }
        int i8 = i4;
        if (interpolator == null) {
            interpolator = f423j;
        }
        if (yVar.f479g != interpolator) {
            yVar.f479g = interpolator;
            yVar.f478f = new OverScroller(RecyclerView.this.getContext(), interpolator);
        }
        yVar.f477e = 0;
        yVar.f476b = 0;
        RecyclerView.this.setScrollState(2);
        yVar.f478f.startScroll(0, 0, i5, i6, i8);
        yVar.b();
    }

    public void m(int i2, int i3) {
        int paddingRight = getPaddingRight() + getPaddingLeft();
        WeakHashMap<View, i0> weakHashMap = a0.a;
        setMeasuredDimension(m.g(i2, paddingRight, a0.d.e(this)), m.g(i3, getPaddingBottom() + getPaddingTop(), a0.d.d(this)));
    }

    public void m0() {
        int i2 = this.I + 1;
        this.I = i2;
        if (i2 != 1 || this.K) {
            return;
        }
        this.J = false;
    }

    public void n(View view) {
        z zVarJ = J(view);
        R();
        e eVar = this.x;
        if (eVar == null || zVarJ == null) {
            return;
        }
        Objects.requireNonNull(eVar);
    }

    public boolean n0(int i2, int i3) {
        return getScrollingChildHelper().i(i2, i3);
    }

    /* JADX WARN: Removed duplicated region for block: B:146:0x0331  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void o() {
        /*
            Method dump skipped, instruction units count: 938
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.o():void");
    }

    public void o0(boolean z2) {
        if (this.I < 1) {
            this.I = 1;
        }
        if (!z2 && !this.K) {
            this.J = false;
        }
        if (this.I == 1) {
            if (z2 && this.J && !this.K && this.y != null && this.x != null) {
                o();
            }
            if (!this.K) {
                this.J = false;
            }
        }
        this.I--;
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.R = 0;
        this.E = true;
        this.H = this.H && !isLayoutRequested();
        this.n.e();
        m mVar = this.y;
        if (mVar != null) {
            mVar.f442h = true;
            mVar.Z();
        }
        this.y0 = false;
        if (f421h) {
            ThreadLocal<c.n.c.m> threadLocal = c.n.c.m.f1875b;
            c.n.c.m mVar2 = threadLocal.get();
            this.q0 = mVar2;
            if (mVar2 == null) {
                this.q0 = new c.n.c.m();
                WeakHashMap<View, i0> weakHashMap = a0.a;
                Display displayB = a0.e.b(this);
                float f2 = 60.0f;
                if (!isInEditMode() && displayB != null) {
                    float refreshRate = displayB.getRefreshRate();
                    if (refreshRate >= 30.0f) {
                        f2 = refreshRate;
                    }
                }
                c.n.c.m mVar3 = this.q0;
                mVar3.f1879h = (long) (1.0E9f / f2);
                threadLocal.set(mVar3);
            }
            this.q0.f1877f.add(this);
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onDetachedFromWindow() {
        c.n.c.m mVar;
        super.onDetachedFromWindow();
        j jVar = this.b0;
        if (jVar != null) {
            jVar.f();
        }
        q0();
        this.E = false;
        m mVar2 = this.y;
        if (mVar2 != null) {
            s sVar = this.n;
            mVar2.f442h = false;
            mVar2.b0(this, sVar);
        }
        this.G0.clear();
        removeCallbacks(this.H0);
        Objects.requireNonNull(this.r);
        while (x.a.a.a() != null) {
        }
        s sVar2 = this.n;
        for (int i2 = 0; i2 < sVar2.f459c.size(); i2++) {
            c.h.a.a.a(sVar2.f459c.get(i2).f483b);
        }
        sVar2.f(RecyclerView.this.x, false);
        g.h0.c.l.f(this, "<this>");
        g.h0.c.l.f(this, "<this>");
        g.h0.c.l.f(this, "<this>");
        f0 f0Var = new f0(this);
        while (f0Var.hasNext()) {
            View view = (View) f0Var.next();
            c.h.a.c cVar = (c.h.a.c) view.getTag(com.ifpdos.debugmenu.R.id.pooling_container_listener_holder_tag);
            if (cVar == null) {
                cVar = new c.h.a.c();
                view.setTag(com.ifpdos.debugmenu.R.id.pooling_container_listener_holder_tag, cVar);
            }
            cVar.a();
        }
        if (!f421h || (mVar = this.q0) == null) {
            return;
        }
        mVar.f1877f.remove(this);
        this.q0 = null;
    }

    @Override // android.view.View
    public void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int size = this.B.size();
        for (int i2 = 0; i2 < size; i2++) {
            Objects.requireNonNull(this.B.get(i2));
        }
    }

    /* 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  */
    /* JADX WARN: Removed duplicated region for block: B:35:0x0078  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0081  */
    @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 r14) {
        /*
            Method dump skipped, instruction units count: 241
            To view this dump add '--comments-level debug' option
        */
        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;
        boolean z3;
        if (this.K) {
            return false;
        }
        this.D = null;
        if (B(motionEvent)) {
            g();
            return true;
        }
        m mVar = this.y;
        if (mVar == null) {
            return false;
        }
        boolean zD = mVar.d();
        boolean zE = this.y.e();
        if (this.e0 == null) {
            this.e0 = VelocityTracker.obtain();
        }
        this.e0.addMovement(motionEvent);
        int actionMasked = motionEvent.getActionMasked();
        int actionIndex = motionEvent.getActionIndex();
        if (actionMasked == 0) {
            if (this.L) {
                this.L = false;
            }
            this.d0 = motionEvent.getPointerId(0);
            int x2 = (int) (motionEvent.getX() + 0.5f);
            this.h0 = x2;
            this.f0 = x2;
            int y2 = (int) (motionEvent.getY() + 0.5f);
            this.i0 = y2;
            this.g0 = y2;
            EdgeEffect edgeEffect = this.U;
            if (edgeEffect == null || c.f.b.h.m(edgeEffect) == 0.0f || canScrollHorizontally(-1)) {
                z2 = false;
            } else {
                c.f.b.h.x(this.U, 0.0f, 1.0f - (motionEvent.getY() / getHeight()));
                z2 = true;
            }
            EdgeEffect edgeEffect2 = this.W;
            boolean z4 = z2;
            if (edgeEffect2 != null) {
                z4 = z2;
                if (c.f.b.h.m(edgeEffect2) != 0.0f) {
                    z4 = z2;
                    if (!canScrollHorizontally(1)) {
                        c.f.b.h.x(this.W, 0.0f, motionEvent.getY() / getHeight());
                        z4 = true;
                    }
                }
            }
            EdgeEffect edgeEffect3 = this.V;
            boolean z5 = z4;
            if (edgeEffect3 != null) {
                z5 = z4;
                if (c.f.b.h.m(edgeEffect3) != 0.0f) {
                    z5 = z4;
                    if (!canScrollVertically(-1)) {
                        c.f.b.h.x(this.V, 0.0f, motionEvent.getX() / getWidth());
                        z5 = true;
                    }
                }
            }
            EdgeEffect edgeEffect4 = this.a0;
            boolean z6 = z5;
            if (edgeEffect4 != null) {
                z6 = z5;
                if (c.f.b.h.m(edgeEffect4) != 0.0f) {
                    z6 = z5;
                    if (!canScrollVertically(1)) {
                        c.f.b.h.x(this.a0, 0.0f, 1.0f - (motionEvent.getX() / getWidth()));
                        z6 = true;
                    }
                }
            }
            if (z6 || this.c0 == 2) {
                getParent().requestDisallowInterceptTouchEvent(true);
                setScrollState(1);
                p0(1);
            }
            int[] iArr = this.E0;
            iArr[1] = 0;
            iArr[0] = 0;
            int i2 = zD;
            if (zE) {
                i2 = (zD ? 1 : 0) | 2;
            }
            n0(i2, 0);
        } else if (actionMasked == 1) {
            this.e0.clear();
            p0(0);
        } else if (actionMasked == 2) {
            int iFindPointerIndex = motionEvent.findPointerIndex(this.d0);
            if (iFindPointerIndex < 0) {
                StringBuilder sbB = d.b.a.a.a.B("Error processing scroll; pointer index for id ");
                sbB.append(this.d0);
                sbB.append(" not found. Did any MotionEvents get skipped?");
                Log.e("RecyclerView", sbB.toString());
                return false;
            }
            int x3 = (int) (motionEvent.getX(iFindPointerIndex) + 0.5f);
            int y3 = (int) (motionEvent.getY(iFindPointerIndex) + 0.5f);
            if (this.c0 != 1) {
                int i3 = x3 - this.f0;
                int i4 = y3 - this.g0;
                if (!zD || Math.abs(i3) <= this.j0) {
                    z3 = false;
                } else {
                    this.h0 = x3;
                    z3 = true;
                }
                if (zE && Math.abs(i4) > this.j0) {
                    this.i0 = y3;
                    z3 = true;
                }
                if (z3) {
                    setScrollState(1);
                }
            }
        } else if (actionMasked == 3) {
            g();
        } else if (actionMasked == 5) {
            this.d0 = motionEvent.getPointerId(actionIndex);
            int x4 = (int) (motionEvent.getX(actionIndex) + 0.5f);
            this.h0 = x4;
            this.f0 = x4;
            int y4 = (int) (motionEvent.getY(actionIndex) + 0.5f);
            this.i0 = y4;
            this.g0 = y4;
        } else if (actionMasked == 6) {
            U(motionEvent);
        }
        return this.c0 == 1;
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onLayout(boolean z2, int i2, int i3, int i4, int i5) {
        int i6 = c.f.f.g.a;
        g.a.a("RV OnLayout");
        o();
        g.a.b();
        this.H = true;
    }

    @Override // android.view.View
    public void onMeasure(int i2, int i3) {
        m mVar = this.y;
        if (mVar == null) {
            m(i2, i3);
            return;
        }
        boolean z2 = false;
        if (mVar.Q()) {
            int mode = View.MeasureSpec.getMode(i2);
            int mode2 = View.MeasureSpec.getMode(i3);
            this.y.r0(i2, i3);
            if (mode == 1073741824 && mode2 == 1073741824) {
                z2 = true;
            }
            this.I0 = z2;
            if (z2 || this.x == null) {
                return;
            }
            if (this.s0.f466c == 1) {
                p();
            }
            this.y.J0(i2, i3);
            this.s0.f471h = true;
            q();
            this.y.L0(i2, i3);
            if (this.y.O0()) {
                this.y.J0(View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), 1073741824), View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), 1073741824));
                this.s0.f471h = true;
                q();
                this.y.L0(i2, i3);
            }
            this.J0 = getMeasuredWidth();
            this.K0 = getMeasuredHeight();
            return;
        }
        if (this.F) {
            this.y.r0(i2, i3);
            return;
        }
        if (this.N) {
            m0();
            S();
            Y();
            T(true);
            v vVar = this.s0;
            if (vVar.f473j) {
                vVar.f469f = true;
            } else {
                this.p.c();
                this.s0.f469f = false;
            }
            this.N = false;
            o0(false);
        } else if (this.s0.f473j) {
            setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight());
            return;
        }
        e eVar = this.x;
        if (eVar != null) {
            this.s0.f467d = eVar.a();
        } else {
            this.s0.f467d = 0;
        }
        m0();
        this.y.r0(i2, i3);
        o0(false);
        this.s0.f469f = false;
    }

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

    @Override // android.view.View
    public void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof SavedState)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        SavedState savedState = (SavedState) parcelable;
        this.o = savedState;
        super.onRestoreInstanceState(savedState.f278e);
        requestLayout();
    }

    @Override // android.view.View
    public Parcelable onSaveInstanceState() {
        SavedState savedState = new SavedState(super.onSaveInstanceState());
        SavedState savedState2 = this.o;
        if (savedState2 != null) {
            savedState.f426f = savedState2.f426f;
        } else {
            m mVar = this.y;
            if (mVar != null) {
                savedState.f426f = mVar.v0();
            } else {
                savedState.f426f = null;
            }
        }
        return savedState;
    }

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

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:141:0x024d  */
    /* JADX WARN: Removed duplicated region for block: B:157:0x028c  */
    /* JADX WARN: Removed duplicated region for block: B:159:0x0290 A[ADDED_TO_REGION] */
    /* JADX WARN: Removed duplicated region for block: B:160:0x0292  */
    /* JADX WARN: Removed duplicated region for block: B:166:0x02b6  */
    /* JADX WARN: Removed duplicated region for block: B:168:0x02be  */
    /* JADX WARN: Removed duplicated region for block: B:181:0x02f2  */
    /* JADX WARN: Removed duplicated region for block: B:57:0x00f7 A[PHI: r0
      0x00f7: PHI (r0v54 int) = (r0v43 int), (r0v58 int) binds: [B:51:0x00e0, B:55:0x00f3] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:59:0x00fa  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x0110  */
    @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: 807
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.onTouchEvent(android.view.MotionEvent):boolean");
    }

    public final void p() {
        View viewA;
        this.s0.a(1);
        z(this.s0);
        this.s0.f471h = false;
        m0();
        c.n.c.x xVar = this.r;
        xVar.a.clear();
        xVar.f1908b.a();
        S();
        Y();
        View focusedChild = (this.o0 && hasFocus() && this.x != null) ? getFocusedChild() : null;
        z zVarI = (focusedChild == null || (viewA = A(focusedChild)) == null) ? null : I(viewA);
        if (zVarI == null) {
            v vVar = this.s0;
            vVar.f475l = -1L;
            vVar.f474k = -1;
            vVar.m = -1;
        } else {
            v vVar2 = this.s0;
            Objects.requireNonNull(this.x);
            vVar2.f475l = -1L;
            this.s0.f474k = this.P ? -1 : zVarI.m() ? zVarI.f486e : zVarI.e();
            v vVar3 = this.s0;
            View focusedChild2 = zVarI.f483b;
            int id = focusedChild2.getId();
            while (!focusedChild2.isFocused() && (focusedChild2 instanceof ViewGroup) && focusedChild2.hasFocus()) {
                focusedChild2 = ((ViewGroup) focusedChild2).getFocusedChild();
                if (focusedChild2.getId() != -1) {
                    id = focusedChild2.getId();
                }
            }
            vVar3.m = id;
        }
        v vVar4 = this.s0;
        vVar4.f470g = vVar4.f472i && this.w0;
        this.w0 = false;
        this.v0 = false;
        vVar4.f469f = vVar4.f473j;
        vVar4.f467d = this.x.a();
        C(this.B0);
        if (this.s0.f472i) {
            int iE = this.q.e();
            for (int i2 = 0; i2 < iE; i2++) {
                z zVarJ = J(this.q.d(i2));
                if (!zVarJ.u()) {
                    if (zVarJ.k()) {
                        Objects.requireNonNull(this.x);
                    } else {
                        j jVar = this.b0;
                        j.b(zVarJ);
                        zVarJ.g();
                        this.r.c(zVarJ, jVar.h(zVarJ));
                        if (this.s0.f470g && zVarJ.p() && !zVarJ.m() && !zVarJ.u() && !zVarJ.k()) {
                            Objects.requireNonNull(this.x);
                            this.r.f1908b.e(zVarJ.f485d, zVarJ);
                        }
                    }
                }
            }
        }
        if (this.s0.f473j) {
            int iH = this.q.h();
            for (int i3 = 0; i3 < iH; i3++) {
                z zVarJ2 = J(this.q.g(i3));
                if (!zVarJ2.u() && zVarJ2.f486e == -1) {
                    zVarJ2.f486e = zVarJ2.f485d;
                }
            }
            v vVar5 = this.s0;
            boolean z2 = vVar5.f468e;
            vVar5.f468e = false;
            this.y.p0(this.n, vVar5);
            this.s0.f468e = z2;
            for (int i4 = 0; i4 < this.q.e(); i4++) {
                z zVarJ3 = J(this.q.d(i4));
                if (!zVarJ3.u()) {
                    x.a orDefault = this.r.a.getOrDefault(zVarJ3, null);
                    if (!((orDefault == null || (orDefault.f1909b & 4) == 0) ? false : true)) {
                        j.b(zVarJ3);
                        boolean zH = zVarJ3.h(InvokeCmd.CMD_TOUCH_CTRL_START);
                        j jVar2 = this.b0;
                        zVarJ3.g();
                        j.c cVarH = jVar2.h(zVarJ3);
                        if (zH) {
                            a0(zVarJ3, cVarH);
                        } else {
                            c.n.c.x xVar2 = this.r;
                            x.a orDefault2 = xVar2.a.getOrDefault(zVarJ3, null);
                            if (orDefault2 == null) {
                                orDefault2 = x.a.a();
                                xVar2.a.put(zVarJ3, orDefault2);
                            }
                            orDefault2.f1909b |= 2;
                            orDefault2.f1910c = cVarH;
                        }
                    }
                }
            }
            i();
        } else {
            i();
        }
        T(true);
        o0(false);
        this.s0.f466c = 2;
    }

    public void p0(int i2) {
        getScrollingChildHelper().j(i2);
    }

    public final void q() {
        m0();
        S();
        this.s0.a(6);
        this.p.c();
        this.s0.f467d = this.x.a();
        this.s0.f465b = 0;
        if (this.o != null) {
            e eVar = this.x;
            int iOrdinal = eVar.f429b.ordinal();
            if (iOrdinal == 1 ? eVar.a() > 0 : iOrdinal != 2) {
                Parcelable parcelable = this.o.f426f;
                if (parcelable != null) {
                    this.y.u0(parcelable);
                }
                this.o = null;
            }
        }
        v vVar = this.s0;
        vVar.f469f = false;
        this.y.p0(this.n, vVar);
        v vVar2 = this.s0;
        vVar2.f468e = false;
        vVar2.f472i = vVar2.f472i && this.b0 != null;
        vVar2.f466c = 4;
        T(true);
        o0(false);
    }

    public void q0() {
        setScrollState(0);
        y yVar = this.p0;
        RecyclerView.this.removeCallbacks(yVar);
        yVar.f478f.abortAnimation();
    }

    public boolean r(int i2, int i3, int[] iArr, int[] iArr2, int i4) {
        return getScrollingChildHelper().c(i2, i3, iArr, iArr2, i4);
    }

    @Override // android.view.ViewGroup
    public void removeDetachedView(View view, boolean z2) {
        z zVarJ = J(view);
        if (zVarJ != null) {
            if (zVarJ.o()) {
                zVarJ.f492k &= -257;
            } else if (!zVarJ.u()) {
                StringBuilder sb = new StringBuilder();
                sb.append("Called removeDetachedView with a view which is not flagged as tmp detached.");
                sb.append(zVarJ);
                throw new IllegalArgumentException(d.b.a.a.a.g(this, sb));
            }
        }
        view.clearAnimation();
        n(view);
        super.removeDetachedView(view, z2);
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public void requestChildFocus(View view, View view2) {
        if (!this.y.t0(this, view, view2) && view2 != null) {
            e0(view, view2);
        }
        super.requestChildFocus(view, view2);
    }

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

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

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

    public final void s(int i2, int i3, int i4, int i5, int[] iArr, int i6, int[] iArr2) {
        getScrollingChildHelper().f(i2, i3, i4, i5, iArr, i6, iArr2);
    }

    @Override // android.view.View
    public void scrollBy(int i2, int i3) {
        m mVar = this.y;
        if (mVar == null) {
            Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.K) {
            return;
        }
        boolean zD = mVar.d();
        boolean zE = this.y.e();
        if (zD || zE) {
            if (!zD) {
                i2 = 0;
            }
            if (!zE) {
                i3 = 0;
            }
            g0(i2, i3, null, 0);
        }
    }

    @Override // android.view.View
    public void scrollTo(int i2, int i3) {
        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 (N()) {
            int iA = accessibilityEvent != null ? c.f.j.n0.b.a(accessibilityEvent) : 0;
            this.M |= iA != 0 ? iA : 0;
            i = 1;
        }
        if (i != 0) {
            return;
        }
        super.sendAccessibilityEventUnchecked(accessibilityEvent);
    }

    public void setAccessibilityDelegateCompat(c.n.c.u uVar) {
        this.z0 = uVar;
        a0.l(this, uVar);
    }

    public void setAdapter(e eVar) {
        setLayoutFrozen(false);
        e eVar2 = this.x;
        if (eVar2 != null) {
            eVar2.a.unregisterObserver(this.m);
            Objects.requireNonNull(this.x);
        }
        d0();
        c.n.c.a aVar = this.p;
        aVar.l(aVar.f1814b);
        aVar.l(aVar.f1815c);
        aVar.f1818f = 0;
        e<?> eVar3 = this.x;
        this.x = eVar;
        if (eVar != null) {
            eVar.a.registerObserver(this.m);
        }
        m mVar = this.y;
        if (mVar != null) {
            mVar.X(eVar3, this.x);
        }
        s sVar = this.n;
        e eVar4 = this.x;
        sVar.b();
        sVar.f(eVar3, true);
        r rVarD = sVar.d();
        Objects.requireNonNull(rVarD);
        if (eVar3 != null) {
            rVarD.f453b--;
        }
        if (rVarD.f453b == 0) {
            rVarD.a();
        }
        if (eVar4 != null) {
            rVarD.f453b++;
        }
        sVar.e();
        this.s0.f468e = true;
        Z(false);
        requestLayout();
    }

    public void setChildDrawingOrderCallback(h hVar) {
        if (hVar == this.A0) {
            return;
        }
        this.A0 = hVar;
        setChildrenDrawingOrderEnabled(hVar != null);
    }

    @Override // android.view.ViewGroup
    public void setClipToPadding(boolean z2) {
        if (z2 != this.s) {
            M();
        }
        this.s = z2;
        super.setClipToPadding(z2);
        if (this.H) {
            requestLayout();
        }
    }

    public void setEdgeEffectFactory(i iVar) {
        Objects.requireNonNull(iVar);
        this.T = iVar;
        M();
    }

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

    public void setItemAnimator(j jVar) {
        j jVar2 = this.b0;
        if (jVar2 != null) {
            jVar2.f();
            this.b0.a = null;
        }
        this.b0 = jVar;
        if (jVar != null) {
            jVar.a = this.x0;
        }
    }

    public void setItemViewCacheSize(int i2) {
        s sVar = this.n;
        sVar.f461e = i2;
        sVar.n();
    }

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

    public void setLayoutManager(m mVar) {
        if (mVar == this.y) {
            return;
        }
        q0();
        if (this.y != null) {
            j jVar = this.b0;
            if (jVar != null) {
                jVar.f();
            }
            this.y.z0(this.n);
            this.y.A0(this.n);
            this.n.b();
            if (this.E) {
                m mVar2 = this.y;
                s sVar = this.n;
                mVar2.f442h = false;
                mVar2.b0(this, sVar);
            }
            this.y.M0(null);
            this.y = null;
        } else {
            this.n.b();
        }
        c.n.c.b bVar = this.q;
        b.a aVar = bVar.f1822b;
        aVar.a = 0L;
        b.a aVar2 = aVar.f1824b;
        if (aVar2 != null) {
            aVar2.g();
        }
        int size = bVar.f1823c.size();
        while (true) {
            size--;
            if (size < 0) {
                break;
            }
            b.InterfaceC0023b interfaceC0023b = bVar.a;
            View view = bVar.f1823c.get(size);
            c.n.c.s sVar2 = (c.n.c.s) interfaceC0023b;
            Objects.requireNonNull(sVar2);
            z zVarJ = J(view);
            if (zVarJ != null) {
                sVar2.a.i0(zVarJ, zVarJ.q);
                zVarJ.q = 0;
            }
            bVar.f1823c.remove(size);
        }
        c.n.c.s sVar3 = (c.n.c.s) bVar.a;
        int iB = sVar3.b();
        for (int i2 = 0; i2 < iB; i2++) {
            View viewA = sVar3.a(i2);
            sVar3.a.n(viewA);
            viewA.clearAnimation();
        }
        sVar3.a.removeAllViews();
        this.y = mVar;
        if (mVar != null) {
            if (mVar.f436b != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("LayoutManager ");
                sb.append(mVar);
                sb.append(" is already attached to a RecyclerView:");
                throw new IllegalArgumentException(d.b.a.a.a.g(mVar.f436b, sb));
            }
            mVar.M0(this);
            if (this.E) {
                m mVar3 = this.y;
                mVar3.f442h = true;
                mVar3.Z();
            }
        }
        this.n.n();
        requestLayout();
    }

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

    @Override // android.view.View
    public void setNestedScrollingEnabled(boolean z2) {
        c.f.j.o scrollingChildHelper = getScrollingChildHelper();
        if (scrollingChildHelper.f1471d) {
            View view = scrollingChildHelper.f1470c;
            WeakHashMap<View, i0> weakHashMap = a0.a;
            a0.h.z(view);
        }
        scrollingChildHelper.f1471d = z2;
    }

    public void setOnFlingListener(o oVar) {
    }

    @Deprecated
    public void setOnScrollListener(q qVar) {
        this.t0 = qVar;
    }

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

    public void setRecycledViewPool(r rVar) {
        s sVar = this.n;
        sVar.f(RecyclerView.this.x, false);
        if (sVar.f463g != null) {
            r1.f453b--;
        }
        sVar.f463g = rVar;
        if (rVar != null && RecyclerView.this.getAdapter() != null) {
            sVar.f463g.f453b++;
        }
        sVar.e();
    }

    @Deprecated
    public void setRecyclerListener(t tVar) {
        this.z = tVar;
    }

    public void setScrollState(int i2) {
        if (i2 == this.c0) {
            return;
        }
        this.c0 = i2;
        if (i2 != 2) {
            y yVar = this.p0;
            RecyclerView.this.removeCallbacks(yVar);
            yVar.f478f.abortAnimation();
        }
        m mVar = this.y;
        if (mVar != null) {
            mVar.w0(i2);
        }
        V();
        List<q> list = this.u0;
        if (list == null) {
            return;
        }
        int size = list.size();
        while (true) {
            size--;
            if (size < 0) {
                return;
            } else {
                Objects.requireNonNull(this.u0.get(size));
            }
        }
    }

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

    public void setViewCacheExtension(x xVar) {
        Objects.requireNonNull(this.n);
    }

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

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

    @Override // android.view.ViewGroup
    public final void suppressLayout(boolean z2) {
        if (z2 != this.K) {
            f("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.K = true;
                this.L = true;
                q0();
                return;
            }
            this.K = false;
            if (this.J && this.y != null && this.x != null) {
                requestLayout();
            }
            this.J = false;
        }
    }

    public void t(int i2, int i3) {
        this.S++;
        int scrollX = getScrollX();
        int scrollY = getScrollY();
        onScrollChanged(scrollX, scrollY, scrollX - i2, scrollY - i3);
        W();
        q qVar = this.t0;
        if (qVar != null) {
            qVar.a(this, i2, i3);
        }
        List<q> list = this.u0;
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                this.u0.get(size).a(this, i2, i3);
            }
        }
        this.S--;
    }

    public void u() {
        if (this.a0 != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.T.a(this, 3);
        this.a0 = edgeEffectA;
        if (this.s) {
            edgeEffectA.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffectA.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    public void v() {
        if (this.U != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.T.a(this, 0);
        this.U = edgeEffectA;
        if (this.s) {
            edgeEffectA.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
        } else {
            edgeEffectA.setSize(getMeasuredHeight(), getMeasuredWidth());
        }
    }

    public void w() {
        if (this.W != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.T.a(this, 2);
        this.W = edgeEffectA;
        if (this.s) {
            edgeEffectA.setSize((getMeasuredHeight() - getPaddingTop()) - getPaddingBottom(), (getMeasuredWidth() - getPaddingLeft()) - getPaddingRight());
        } else {
            edgeEffectA.setSize(getMeasuredHeight(), getMeasuredWidth());
        }
    }

    public void x() {
        if (this.V != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.T.a(this, 1);
        this.V = edgeEffectA;
        if (this.s) {
            edgeEffectA.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffectA.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

    public String y() {
        StringBuilder sbB = d.b.a.a.a.B(" ");
        sbB.append(super.toString());
        sbB.append(", adapter:");
        sbB.append(this.x);
        sbB.append(", layout:");
        sbB.append(this.y);
        sbB.append(", context:");
        sbB.append(getContext());
        return sbB.toString();
    }

    public final void z(v vVar) {
        if (getScrollState() != 2) {
            Objects.requireNonNull(vVar);
            return;
        }
        OverScroller overScroller = this.p0.f478f;
        overScroller.getFinalX();
        overScroller.getCurrX();
        Objects.requireNonNull(vVar);
        overScroller.getFinalY();
        overScroller.getCurrY();
    }

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

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        public Parcelable f426f;

        public class a implements Parcelable.ClassLoaderCreator<SavedState> {
            @Override // android.os.Parcelable.ClassLoaderCreator
            public SavedState createFromParcel(Parcel parcel, ClassLoader classLoader) {
                return new SavedState(parcel, classLoader);
            }

            @Override // android.os.Parcelable.Creator
            public Object[] newArray(int i2) {
                return new SavedState[i2];
            }

            @Override // android.os.Parcelable.Creator
            public Object createFromParcel(Parcel parcel) {
                return new SavedState(parcel, null);
            }
        }

        public SavedState(Parcel parcel, ClassLoader classLoader) {
            super(parcel, classLoader);
            this.f426f = parcel.readParcelable(classLoader == null ? m.class.getClassLoader() : classLoader);
        }

        @Override // androidx.customview.view.AbsSavedState, android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i2) {
            parcel.writeParcelable(this.f278e, i2);
            parcel.writeParcelable(this.f426f, 0);
        }

        public SavedState(Parcelable parcelable) {
            super(parcelable);
        }
    }

    public static class n extends ViewGroup.MarginLayoutParams {
        public z a;

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

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

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

        public n(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
            this.f450b = new Rect();
            this.f451c = true;
            this.f452d = false;
        }

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

        public boolean b() {
            return this.a.p();
        }

        public boolean c() {
            return this.a.m();
        }

        public n(int i2, int i3) {
            super(i2, i3);
            this.f450b = new Rect();
            this.f451c = true;
            this.f452d = false;
        }

        public n(ViewGroup.MarginLayoutParams marginLayoutParams) {
            super(marginLayoutParams);
            this.f450b = new Rect();
            this.f451c = true;
            this.f452d = false;
        }

        public n(ViewGroup.LayoutParams layoutParams) {
            super(layoutParams);
            this.f450b = new Rect();
            this.f451c = true;
            this.f452d = false;
        }

        public n(n nVar) {
            super((ViewGroup.LayoutParams) nVar);
            this.f450b = new Rect();
            this.f451c = true;
            this.f452d = false;
        }
    }

    @Override // android.view.ViewGroup
    public ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        m mVar = this.y;
        if (mVar != null) {
            return mVar.v(layoutParams);
        }
        throw new IllegalStateException(d.b.a.a.a.g(this, d.b.a.a.a.B("RecyclerView has no LayoutManager")));
    }
}
