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.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.Display;
import android.view.FocusFinder;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.Interpolator;
import android.widget.EdgeEffect;
import android.widget.OverScroller;
import androidx.recyclerview.widget.a;
import androidx.recyclerview.widget.b;
import androidx.recyclerview.widget.e;
import androidx.recyclerview.widget.i;
import androidx.recyclerview.widget.l;
import androidx.recyclerview.widget.m;
import c.f.l.c0.d;
import com.cvte.vman.instance.InvokeCmd;
import com.seewo.adbcommons.model.base.ICmdMsg;
import io.netty.util.internal.shaded.org.jctools.util.Pow2;
import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final x f993b;
    private int b0;
    private int c0;
    private r d0;
    private final int e0;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    final v f994f;
    private final int f0;

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

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

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    final androidx.recyclerview.widget.m f998j;
    final c0 j0;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    boolean f999k;
    androidx.recyclerview.widget.e k0;
    final Runnable l;
    e.b l0;
    final Rect m;
    final a0 m0;
    private final Rect n;
    private t n0;
    final RectF o;
    private List<t> o0;
    h p;
    boolean p0;
    LayoutManager q;
    boolean q0;
    w r;
    private m.b r0;
    final List<w> s;
    boolean s0;
    final ArrayList<o> t;
    androidx.recyclerview.widget.i t0;
    private final ArrayList<s> u;
    private k u0;
    private s v;
    private final int[] v0;
    boolean w;
    private c.f.l.l w0;
    boolean x;
    private final int[] x0;
    boolean y;
    private final int[] y0;
    boolean z;
    final int[] z0;

    public static abstract class LayoutManager {
        androidx.recyclerview.widget.b a;

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

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        z f1005g;
        int m;
        boolean n;
        private int o;
        private int p;
        private int q;
        private int r;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private final l.b f1001c = new a();

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private final l.b f1002d = new b();

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        androidx.recyclerview.widget.l f1003e = new androidx.recyclerview.widget.l(this.f1001c);

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        androidx.recyclerview.widget.l f1004f = new androidx.recyclerview.widget.l(this.f1002d);

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

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

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

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        private boolean f1009k = true;
        private boolean l = true;

        public static class Properties {
            public int a;

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

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

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

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

            @Override // androidx.recyclerview.widget.l.b
            public View a(int i2) {
                return LayoutManager.this.H(i2);
            }

            @Override // androidx.recyclerview.widget.l.b
            public int b() {
                return LayoutManager.this.m0() - LayoutManager.this.d0();
            }

            @Override // androidx.recyclerview.widget.l.b
            public int c(View view) {
                return LayoutManager.this.P(view) - ((ViewGroup.MarginLayoutParams) ((p) view.getLayoutParams())).leftMargin;
            }

            @Override // androidx.recyclerview.widget.l.b
            public int d() {
                return LayoutManager.this.c0();
            }

            @Override // androidx.recyclerview.widget.l.b
            public int e(View view) {
                return LayoutManager.this.S(view) + ((ViewGroup.MarginLayoutParams) ((p) view.getLayoutParams())).rightMargin;
            }
        }

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

            @Override // androidx.recyclerview.widget.l.b
            public View a(int i2) {
                return LayoutManager.this.H(i2);
            }

            @Override // androidx.recyclerview.widget.l.b
            public int b() {
                return LayoutManager.this.V() - LayoutManager.this.b0();
            }

            @Override // androidx.recyclerview.widget.l.b
            public int c(View view) {
                return LayoutManager.this.T(view) - ((ViewGroup.MarginLayoutParams) ((p) view.getLayoutParams())).topMargin;
            }

            @Override // androidx.recyclerview.widget.l.b
            public int d() {
                return LayoutManager.this.e0();
            }

            @Override // androidx.recyclerview.widget.l.b
            public int e(View view) {
                return LayoutManager.this.N(view) + ((ViewGroup.MarginLayoutParams) ((p) view.getLayoutParams())).bottomMargin;
            }
        }

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

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

        private int[] K(View view, Rect rect) {
            int[] iArr = new int[2];
            int iC0 = c0();
            int iE0 = e0();
            int iM0 = m0() - d0();
            int iV = V() - b0();
            int left = (view.getLeft() + rect.left) - view.getScrollX();
            int top = (view.getTop() + rect.top) - view.getScrollY();
            int iWidth = rect.width() + left;
            int iHeight = rect.height() + top;
            int i2 = left - iC0;
            int iMin = Math.min(0, i2);
            int i3 = top - iE0;
            int iMin2 = Math.min(0, i3);
            int i4 = iWidth - iM0;
            int iMax = Math.max(0, i4);
            int iMax2 = Math.max(0, iHeight - iV);
            if (X() != 1) {
                if (iMin == 0) {
                    iMin = Math.min(i2, iMax);
                }
                iMax = iMin;
            } else if (iMax == 0) {
                iMax = Math.max(iMin, i4);
            }
            if (iMin2 == 0) {
                iMin2 = Math.min(i3, iMax2);
            }
            iArr[0] = iMax;
            iArr[1] = iMin2;
            return iArr;
        }

        private void e(View view, int i2, boolean z) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (z || d0VarF0.isRemoved()) {
                this.f1000b.f998j.b(d0VarF0);
            } else {
                this.f1000b.f998j.p(d0VarF0);
            }
            p pVar = (p) view.getLayoutParams();
            if (d0VarF0.wasReturnedFromScrap() || d0VarF0.isScrap()) {
                if (d0VarF0.isScrap()) {
                    d0VarF0.unScrap();
                } else {
                    d0VarF0.clearReturnedFromScrapFlag();
                }
                this.a.c(view, i2, view.getLayoutParams(), false);
            } else if (view.getParent() == this.f1000b) {
                int iM = this.a.m(view);
                if (i2 == -1) {
                    i2 = this.a.g();
                }
                if (iM == -1) {
                    throw new IllegalStateException("Added View has RecyclerView as parent but view is not a real child. Unfiltered index:" + this.f1000b.indexOfChild(view) + this.f1000b.Q());
                }
                if (iM != i2) {
                    this.f1000b.q.z0(iM, i2);
                }
            } else {
                this.a.a(view, i2, false);
                pVar.f1039c = true;
                z zVar = this.f1005g;
                if (zVar != null && zVar.c()) {
                    this.f1005g.e(view);
                }
            }
            if (pVar.f1040d) {
                d0VarF0.itemView.invalidate();
                pVar.f1040d = false;
            }
        }

        public static Properties g0(Context context, AttributeSet attributeSet, int i2, int i3) {
            Properties properties = new Properties();
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, c.l.c.RecyclerView, i2, i3);
            properties.a = typedArrayObtainStyledAttributes.getInt(c.l.c.RecyclerView_android_orientation, 1);
            properties.f1010b = typedArrayObtainStyledAttributes.getInt(c.l.c.RecyclerView_spanCount, 1);
            properties.f1011c = typedArrayObtainStyledAttributes.getBoolean(c.l.c.RecyclerView_reverseLayout, false);
            properties.f1012d = typedArrayObtainStyledAttributes.getBoolean(c.l.c.RecyclerView_stackFromEnd, false);
            typedArrayObtainStyledAttributes.recycle();
            return properties;
        }

        public static int m(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));
        }

        private boolean r0(RecyclerView recyclerView, int i2, int i3) {
            View focusedChild = recyclerView.getFocusedChild();
            if (focusedChild == null) {
                return false;
            }
            int iC0 = c0();
            int iE0 = e0();
            int iM0 = m0() - d0();
            int iV = V() - b0();
            Rect rect = this.f1000b.m;
            O(focusedChild, rect);
            return rect.left - i2 < iM0 && rect.right - i2 > iC0 && rect.top - i3 < iV && rect.bottom - i3 > iE0;
        }

        private void s1(v vVar, int i2, View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0.shouldIgnore()) {
                return;
            }
            if (d0VarF0.isInvalid() && !d0VarF0.isRemoved() && !this.f1000b.p.hasStableIds()) {
                n1(i2);
                vVar.C(d0VarF0);
            } else {
                w(i2);
                vVar.D(view);
                this.f1000b.f998j.k(d0VarF0);
            }
        }

        private static boolean u0(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;
        }

        private void x(int i2, View view) {
            this.a.d(i2);
        }

        public View A(View view) {
            View viewS;
            RecyclerView recyclerView = this.f1000b;
            if (recyclerView == null || (viewS = recyclerView.S(view)) == null || this.a.n(viewS)) {
                return null;
            }
            return viewS;
        }

        public void A0(int i2) {
            RecyclerView recyclerView = this.f1000b;
            if (recyclerView != null) {
                recyclerView.y0(i2);
            }
        }

        void A1(RecyclerView recyclerView) {
            if (recyclerView == null) {
                this.f1000b = null;
                this.a = null;
                this.q = 0;
                this.r = 0;
            } else {
                this.f1000b = recyclerView;
                this.a = recyclerView.f997i;
                this.q = recyclerView.getWidth();
                this.r = recyclerView.getHeight();
            }
            this.o = Pow2.MAX_POW2;
            this.p = Pow2.MAX_POW2;
        }

        public View B(int i2) {
            int I = I();
            for (int i3 = 0; i3 < I; i3++) {
                View viewH = H(i3);
                d0 d0VarF0 = RecyclerView.f0(viewH);
                if (d0VarF0 != null && d0VarF0.getLayoutPosition() == i2 && !d0VarF0.shouldIgnore() && (this.f1000b.m0.e() || !d0VarF0.isRemoved())) {
                    return viewH;
                }
            }
            return null;
        }

        public void B0(int i2) {
            RecyclerView recyclerView = this.f1000b;
            if (recyclerView != null) {
                recyclerView.z0(i2);
            }
        }

        boolean B1(View view, int i2, int i3, p pVar) {
            return (!view.isLayoutRequested() && this.f1009k && u0(view.getWidth(), i2, ((ViewGroup.MarginLayoutParams) pVar).width) && u0(view.getHeight(), i3, ((ViewGroup.MarginLayoutParams) pVar).height)) ? false : true;
        }

        public abstract p C();

        public void C0(h hVar, h hVar2) {
        }

        boolean C1() {
            return false;
        }

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

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

        boolean D1(View view, int i2, int i3, p pVar) {
            return (this.f1009k && u0(view.getMeasuredWidth(), i2, ((ViewGroup.MarginLayoutParams) pVar).width) && u0(view.getMeasuredHeight(), i3, ((ViewGroup.MarginLayoutParams) pVar).height)) ? false : true;
        }

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

        public void E0(RecyclerView recyclerView) {
        }

        void E1() {
            z zVar = this.f1005g;
            if (zVar == null) {
                return;
            }
            zVar.g();
            throw null;
        }

        public int F() {
            return -1;
        }

        @Deprecated
        public void F0(RecyclerView recyclerView) {
        }

        public boolean F1() {
            return false;
        }

        public int G(View view) {
            return ((p) view.getLayoutParams()).f1038b.bottom;
        }

        public void G0(RecyclerView recyclerView, v vVar) {
            F0(recyclerView);
        }

        public View H(int i2) {
            androidx.recyclerview.widget.b bVar = this.a;
            if (bVar != null) {
                return bVar.f(i2);
            }
            return null;
        }

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

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

        public void I0(AccessibilityEvent accessibilityEvent) {
            RecyclerView recyclerView = this.f1000b;
            J0(recyclerView.f994f, recyclerView.m0, accessibilityEvent);
        }

        public void J0(v vVar, a0 a0Var, AccessibilityEvent accessibilityEvent) {
            RecyclerView recyclerView = this.f1000b;
            if (recyclerView == null || accessibilityEvent == null) {
                return;
            }
            boolean z = true;
            if (!recyclerView.canScrollVertically(1) && !this.f1000b.canScrollVertically(-1) && !this.f1000b.canScrollHorizontally(-1) && !this.f1000b.canScrollHorizontally(1)) {
                z = false;
            }
            accessibilityEvent.setScrollable(z);
            h hVar = this.f1000b.p;
            if (hVar != null) {
                accessibilityEvent.setItemCount(hVar.getItemCount());
            }
        }

        void K0(c.f.l.c0.d dVar) {
            RecyclerView recyclerView = this.f1000b;
            L0(recyclerView.f994f, recyclerView.m0, dVar);
        }

        public boolean L() {
            RecyclerView recyclerView = this.f1000b;
            return recyclerView != null && recyclerView.f999k;
        }

        public void L0(v vVar, a0 a0Var, c.f.l.c0.d dVar) {
            if (this.f1000b.canScrollVertically(-1) || this.f1000b.canScrollHorizontally(-1)) {
                dVar.a(InvokeCmd.CMD_TOUCH_CTRL_START);
                dVar.R(true);
            }
            if (this.f1000b.canScrollVertically(1) || this.f1000b.canScrollHorizontally(1)) {
                dVar.a(4096);
                dVar.R(true);
            }
            dVar.M(d.b.a(i0(vVar, a0Var), M(vVar, a0Var), t0(vVar, a0Var), j0(vVar, a0Var)));
        }

        public int M(v vVar, a0 a0Var) {
            return -1;
        }

        void M0(View view, c.f.l.c0.d dVar) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0 == null || d0VarF0.isRemoved() || this.a.n(d0VarF0.itemView)) {
                return;
            }
            RecyclerView recyclerView = this.f1000b;
            N0(recyclerView.f994f, recyclerView.m0, view, dVar);
        }

        public int N(View view) {
            return view.getBottom() + G(view);
        }

        public void N0(v vVar, a0 a0Var, View view, c.f.l.c0.d dVar) {
        }

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

        public View O0(View view, int i2) {
            return null;
        }

        public int P(View view) {
            return view.getLeft() - Y(view);
        }

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

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

        public void Q0(RecyclerView recyclerView) {
        }

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

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

        public int S(View view) {
            return view.getRight() + h0(view);
        }

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

        public int T(View view) {
            return view.getTop() - k0(view);
        }

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

        public View U() {
            View focusedChild;
            RecyclerView recyclerView = this.f1000b;
            if (recyclerView == null || (focusedChild = recyclerView.getFocusedChild()) == null || this.a.n(focusedChild)) {
                return null;
            }
            return focusedChild;
        }

        public void U0(RecyclerView recyclerView, int i2, int i3, Object obj) {
            T0(recyclerView, i2, i3);
        }

        public int V() {
            return this.r;
        }

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

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

        public void W0(a0 a0Var) {
        }

        public int X() {
            return c.f.l.t.u(this.f1000b);
        }

        public void X0(v vVar, a0 a0Var, int i2, int i3) {
            this.f1000b.x(i2, i3);
        }

        public int Y(View view) {
            return ((p) view.getLayoutParams()).f1038b.left;
        }

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

        public int Z() {
            return c.f.l.t.v(this.f1000b);
        }

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

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

        public int a0() {
            return c.f.l.t.w(this.f1000b);
        }

        public void a1(Parcelable parcelable) {
        }

        public void b(View view, int i2) {
            e(view, i2, true);
        }

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

        public Parcelable b1() {
            return null;
        }

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

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

        public void c1(int i2) {
        }

        public void d(View view, int i2) {
            e(view, i2, false);
        }

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

        boolean d1(int i2, Bundle bundle) {
            RecyclerView recyclerView = this.f1000b;
            return e1(recyclerView.f994f, recyclerView.m0, i2, bundle);
        }

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

        public boolean e1(v vVar, a0 a0Var, int i2, Bundle bundle) {
            int iV;
            int iM0;
            int i3;
            int i4;
            RecyclerView recyclerView = this.f1000b;
            if (recyclerView == null) {
                return false;
            }
            if (i2 == 4096) {
                iV = recyclerView.canScrollVertically(1) ? (V() - e0()) - b0() : 0;
                if (this.f1000b.canScrollHorizontally(1)) {
                    iM0 = (m0() - c0()) - d0();
                    i3 = iV;
                    i4 = iM0;
                }
                i3 = iV;
                i4 = 0;
            } else if (i2 != 8192) {
                i4 = 0;
                i3 = 0;
            } else {
                iV = recyclerView.canScrollVertically(-1) ? -((V() - e0()) - b0()) : 0;
                if (this.f1000b.canScrollHorizontally(-1)) {
                    iM0 = -((m0() - c0()) - d0());
                    i3 = iV;
                    i4 = iM0;
                }
                i3 = iV;
                i4 = 0;
            }
            if (i3 == 0 && i4 == 0) {
                return false;
            }
            this.f1000b.m1(i4, i3, null, Integer.MIN_VALUE, true);
            return true;
        }

        public void f(String str) {
            RecyclerView recyclerView = this.f1000b;
            if (recyclerView != null) {
                recyclerView.p(str);
            }
        }

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

        boolean f1(View view, int i2, Bundle bundle) {
            RecyclerView recyclerView = this.f1000b;
            return g1(recyclerView.f994f, recyclerView.m0, view, i2, bundle);
        }

        public void g(View view, int i2) {
            h(view, i2, (p) view.getLayoutParams());
        }

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

        public void h(View view, int i2, p pVar) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0.isRemoved()) {
                this.f1000b.f998j.b(d0VarF0);
            } else {
                this.f1000b.f998j.p(d0VarF0);
            }
            this.a.c(view, i2, pVar, d0VarF0.isRemoved());
        }

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

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

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

        public int i0(v vVar, a0 a0Var) {
            return -1;
        }

        void i1(v vVar) {
            int iJ = vVar.j();
            for (int i2 = iJ - 1; i2 >= 0; i2--) {
                View viewN = vVar.n(i2);
                d0 d0VarF0 = RecyclerView.f0(viewN);
                if (!d0VarF0.shouldIgnore()) {
                    d0VarF0.setIsRecyclable(false);
                    if (d0VarF0.isTmpDetached()) {
                        this.f1000b.removeDetachedView(viewN, false);
                    }
                    m mVar = this.f1000b.R;
                    if (mVar != null) {
                        mVar.j(d0VarF0);
                    }
                    d0VarF0.setIsRecyclable(true);
                    vVar.y(viewN);
                }
            }
            vVar.e();
            if (iJ > 0) {
                this.f1000b.invalidate();
            }
        }

        public boolean j() {
            return false;
        }

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

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

        public boolean k() {
            return false;
        }

        public int k0(View view) {
            return ((p) view.getLayoutParams()).f1038b.top;
        }

        public void k1(int i2, v vVar) {
            View viewH = H(i2);
            n1(i2);
            vVar.B(viewH);
        }

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

        public void l0(View view, boolean z, Rect rect) {
            Matrix matrix;
            if (z) {
                Rect rect2 = ((p) view.getLayoutParams()).f1038b;
                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.f1000b != null && (matrix = view.getMatrix()) != null && !matrix.isIdentity()) {
                RectF rectF = this.f1000b.o;
                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 l1(Runnable runnable) {
            RecyclerView recyclerView = this.f1000b;
            if (recyclerView != null) {
                return recyclerView.removeCallbacks(runnable);
            }
            return false;
        }

        public int m0() {
            return this.q;
        }

        public void m1(View view) {
            this.a.p(view);
        }

        public void n(int i2, int i3, a0 a0Var, c cVar) {
        }

        public int n0() {
            return this.o;
        }

        public void n1(int i2) {
            if (H(i2) != null) {
                this.a.q(i2);
            }
        }

        public void o(int i2, c cVar) {
        }

        boolean o0() {
            int I = I();
            for (int i2 = 0; i2 < I; i2++) {
                ViewGroup.LayoutParams layoutParams = H(i2).getLayoutParams();
                if (layoutParams.width < 0 && layoutParams.height < 0) {
                    return true;
                }
            }
            return false;
        }

        public boolean o1(RecyclerView recyclerView, View view, Rect rect, boolean z) {
            return p1(recyclerView, view, rect, z, false);
        }

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

        public boolean p0() {
            return this.f1007i;
        }

        public boolean p1(RecyclerView recyclerView, View view, Rect rect, boolean z, boolean z2) {
            int[] iArrK = K(view, rect);
            int i2 = iArrK[0];
            int i3 = iArrK[1];
            if ((z2 && !r0(recyclerView, i2, i3)) || (i2 == 0 && i3 == 0)) {
                return false;
            }
            if (z) {
                recyclerView.scrollBy(i2, i3);
            } else {
                recyclerView.j1(i2, i3);
            }
            return true;
        }

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

        public boolean q0() {
            return this.f1008j;
        }

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

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

        public void r1() {
            this.f1006h = true;
        }

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

        public final boolean s0() {
            return this.l;
        }

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

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

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

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

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

        public void v(v vVar) {
            for (int I = I() - 1; I >= 0; I--) {
                s1(vVar, I, H(I));
            }
        }

        public boolean v0() {
            z zVar = this.f1005g;
            return zVar != null && zVar.c();
        }

        void v1(RecyclerView recyclerView) {
            w1(View.MeasureSpec.makeMeasureSpec(recyclerView.getWidth(), Pow2.MAX_POW2), View.MeasureSpec.makeMeasureSpec(recyclerView.getHeight(), Pow2.MAX_POW2));
        }

        public void w(int i2) {
            x(i2, H(i2));
        }

        public boolean w0(View view, boolean z, boolean z2) {
            boolean z3 = this.f1003e.b(view, 24579) && this.f1004f.b(view, 24579);
            return z ? z3 : !z3;
        }

        void w1(int i2, int i3) {
            this.q = View.MeasureSpec.getSize(i2);
            int mode = View.MeasureSpec.getMode(i2);
            this.o = mode;
            if (mode == 0 && !RecyclerView.I0) {
                this.q = 0;
            }
            this.r = View.MeasureSpec.getSize(i3);
            int mode2 = View.MeasureSpec.getMode(i3);
            this.p = mode2;
            if (mode2 != 0 || RecyclerView.I0) {
                return;
            }
            this.r = 0;
        }

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

        public void x1(int i2, int i3) {
            this.f1000b.setMeasuredDimension(i2, i3);
        }

        void y(RecyclerView recyclerView) {
            this.f1007i = true;
            E0(recyclerView);
        }

        public void y0(View view, int i2, int i3) {
            p pVar = (p) view.getLayoutParams();
            Rect rectJ0 = this.f1000b.j0(view);
            int i4 = i2 + rectJ0.left + rectJ0.right;
            int i5 = i3 + rectJ0.top + rectJ0.bottom;
            int iJ = J(m0(), n0(), c0() + d0() + ((ViewGroup.MarginLayoutParams) pVar).leftMargin + ((ViewGroup.MarginLayoutParams) pVar).rightMargin + i4, ((ViewGroup.MarginLayoutParams) pVar).width, j());
            int iJ2 = J(V(), W(), e0() + b0() + ((ViewGroup.MarginLayoutParams) pVar).topMargin + ((ViewGroup.MarginLayoutParams) pVar).bottomMargin + i5, ((ViewGroup.MarginLayoutParams) pVar).height, k());
            if (B1(view, iJ, iJ2, pVar)) {
                view.measure(iJ, iJ2);
            }
        }

        public void y1(Rect rect, int i2, int i3) {
            x1(m(i2, rect.width() + c0() + d0(), a0()), m(i3, rect.height() + e0() + b0(), Z()));
        }

        void z(RecyclerView recyclerView, v vVar) {
            this.f1007i = false;
            G0(recyclerView, vVar);
        }

        public void z0(int i2, int i3) {
            View viewH = H(i2);
            if (viewH != null) {
                w(i2);
                g(viewH, i3);
            } else {
                throw new IllegalArgumentException("Cannot move a child from non-existing index:" + i2 + this.f1000b.toString());
            }
        }

        void z1(int i2, int i3) {
            int I = I();
            if (I == 0) {
                this.f1000b.x(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 < I; i8++) {
                View viewH = H(i8);
                Rect rect = this.f1000b.m;
                O(viewH, 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.f1000b.m.set(i5, i6, i4, i7);
            y1(this.f1000b.m, i2, i3);
        }
    }

    class a implements Runnable {
        a() {
        }

        @Override // java.lang.Runnable
        public void run() {
            RecyclerView recyclerView = RecyclerView.this;
            if (!recyclerView.z || recyclerView.isLayoutRequested()) {
                return;
            }
            RecyclerView recyclerView2 = RecyclerView.this;
            if (!recyclerView2.w) {
                recyclerView2.requestLayout();
            } else if (recyclerView2.C) {
                recyclerView2.B = true;
            } else {
                recyclerView2.v();
            }
        }
    }

    public static class a0 {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private SparseArray<Object> f1014b;
        int m;
        long n;
        int o;
        int p;
        int q;
        int a = -1;

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

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

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

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

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

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

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

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

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

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

        public int b() {
            return this.f1020h ? this.f1015c - this.f1016d : this.f1018f;
        }

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

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

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

        void f(h hVar) {
            this.f1017e = 1;
            this.f1018f = hVar.getItemCount();
            this.f1020h = false;
            this.f1021i = false;
            this.f1022j = false;
        }

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

        public String toString() {
            return "State{mTargetPosition=" + this.a + ", mData=" + this.f1014b + ", mItemCount=" + this.f1018f + ", mIsMeasuring=" + this.f1022j + ", mPreviousLayoutItemCount=" + this.f1015c + ", mDeletedInvisibleItemCountSincePreviousLayout=" + this.f1016d + ", mStructureChanged=" + this.f1019g + ", mInPreLayout=" + this.f1020h + ", mRunSimpleAnimations=" + this.f1023k + ", mRunPredictiveAnimations=" + this.l + '}';
        }
    }

    class b implements Runnable {
        b() {
        }

        @Override // java.lang.Runnable
        public void run() {
            m mVar = RecyclerView.this.R;
            if (mVar != null) {
                mVar.u();
            }
            RecyclerView.this.s0 = false;
        }
    }

    public static abstract class b0 {
        public abstract View a(v vVar, int i2, int i3);
    }

    class c implements Interpolator {
        c() {
        }

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

    class c0 implements Runnable {

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

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

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

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        Interpolator f1028h = RecyclerView.O0;

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

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

        c0() {
            this.f1027g = new OverScroller(RecyclerView.this.getContext(), RecyclerView.O0);
        }

        private int a(int i2, int i3) {
            int iAbs = Math.abs(i2);
            int iAbs2 = Math.abs(i3);
            boolean z = iAbs > iAbs2;
            RecyclerView recyclerView = RecyclerView.this;
            int width = z ? recyclerView.getWidth() : recyclerView.getHeight();
            if (!z) {
                iAbs = iAbs2;
            }
            return Math.min((int) (((iAbs / width) + 1.0f) * 300.0f), 2000);
        }

        private void c() {
            RecyclerView.this.removeCallbacks(this);
            c.f.l.t.R(RecyclerView.this, this);
        }

        public void b(int i2, int i3) {
            RecyclerView.this.setScrollState(2);
            this.f1026f = 0;
            this.f1025b = 0;
            Interpolator interpolator = this.f1028h;
            Interpolator interpolator2 = RecyclerView.O0;
            if (interpolator != interpolator2) {
                this.f1028h = interpolator2;
                this.f1027g = new OverScroller(RecyclerView.this.getContext(), RecyclerView.O0);
            }
            this.f1027g.fling(0, 0, i2, i3, Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE);
            d();
        }

        void d() {
            if (this.f1029i) {
                this.f1030j = true;
            } else {
                c();
            }
        }

        public void e(int i2, int i3, int i4, Interpolator interpolator) {
            if (i4 == Integer.MIN_VALUE) {
                i4 = a(i2, i3);
            }
            int i5 = i4;
            if (interpolator == null) {
                interpolator = RecyclerView.O0;
            }
            if (this.f1028h != interpolator) {
                this.f1028h = interpolator;
                this.f1027g = new OverScroller(RecyclerView.this.getContext(), interpolator);
            }
            this.f1026f = 0;
            this.f1025b = 0;
            RecyclerView.this.setScrollState(2);
            this.f1027g.startScroll(0, 0, i2, i3, i5);
            if (Build.VERSION.SDK_INT < 23) {
                this.f1027g.computeScrollOffset();
            }
            d();
        }

        public void f() {
            RecyclerView.this.removeCallbacks(this);
            this.f1027g.abortAnimation();
        }

        @Override // java.lang.Runnable
        public void run() {
            int i2;
            int i3;
            int i4;
            RecyclerView recyclerView = RecyclerView.this;
            if (recyclerView.q == null) {
                f();
                return;
            }
            this.f1030j = false;
            this.f1029i = true;
            recyclerView.v();
            OverScroller overScroller = this.f1027g;
            if (overScroller.computeScrollOffset()) {
                int currX = overScroller.getCurrX();
                int currY = overScroller.getCurrY();
                int i5 = currX - this.f1025b;
                int i6 = currY - this.f1026f;
                this.f1025b = currX;
                this.f1026f = currY;
                RecyclerView recyclerView2 = RecyclerView.this;
                int[] iArr = recyclerView2.z0;
                iArr[0] = 0;
                iArr[1] = 0;
                if (recyclerView2.G(i5, i6, iArr, null, 1)) {
                    int[] iArr2 = RecyclerView.this.z0;
                    i5 -= iArr2[0];
                    i6 -= iArr2[1];
                }
                if (RecyclerView.this.getOverScrollMode() != 2) {
                    RecyclerView.this.u(i5, i6);
                }
                RecyclerView recyclerView3 = RecyclerView.this;
                if (recyclerView3.p != null) {
                    int[] iArr3 = recyclerView3.z0;
                    iArr3[0] = 0;
                    iArr3[1] = 0;
                    recyclerView3.f1(i5, i6, iArr3);
                    RecyclerView recyclerView4 = RecyclerView.this;
                    int[] iArr4 = recyclerView4.z0;
                    int i7 = iArr4[0];
                    int i8 = iArr4[1];
                    int i9 = i5 - i7;
                    i6 -= i8;
                    z zVar = recyclerView4.q.f1005g;
                    if (zVar != null && !zVar.b() && zVar.c()) {
                        int iB = RecyclerView.this.m0.b();
                        if (iB == 0) {
                            zVar.g();
                            throw null;
                        }
                        if (zVar.a() >= iB) {
                            zVar.f(iB - 1);
                            zVar.d(i7, i8);
                        } else {
                            zVar.d(i7, i8);
                        }
                    }
                    i4 = i9;
                    i2 = i8;
                    i3 = i7;
                } else {
                    i2 = 0;
                    i3 = 0;
                    i4 = i5;
                }
                int i10 = i6;
                if (!RecyclerView.this.t.isEmpty()) {
                    RecyclerView.this.invalidate();
                }
                RecyclerView recyclerView5 = RecyclerView.this;
                int[] iArr5 = recyclerView5.z0;
                iArr5[0] = 0;
                iArr5[1] = 0;
                recyclerView5.H(i3, i2, i4, i10, null, 1, iArr5);
                int[] iArr6 = RecyclerView.this.z0;
                int i11 = i4 - iArr6[0];
                int i12 = i10 - iArr6[1];
                if (i3 != 0 || i2 != 0) {
                    RecyclerView.this.J(i3, i2);
                }
                if (!RecyclerView.this.awakenScrollBars()) {
                    RecyclerView.this.invalidate();
                }
                boolean z = overScroller.isFinished() || (((overScroller.getCurrX() == overScroller.getFinalX()) || i11 != 0) && ((overScroller.getCurrY() == overScroller.getFinalY()) || i12 != 0));
                z zVar2 = RecyclerView.this.q.f1005g;
                if ((zVar2 != null && zVar2.b()) || !z) {
                    d();
                    RecyclerView recyclerView6 = RecyclerView.this;
                    androidx.recyclerview.widget.e eVar = recyclerView6.k0;
                    if (eVar != null) {
                        eVar.f(recyclerView6, i3, i2);
                    }
                } else {
                    if (RecyclerView.this.getOverScrollMode() != 2) {
                        int currVelocity = (int) overScroller.getCurrVelocity();
                        int i13 = i11 < 0 ? -currVelocity : i11 > 0 ? currVelocity : 0;
                        if (i12 < 0) {
                            currVelocity = -currVelocity;
                        } else if (i12 <= 0) {
                            currVelocity = 0;
                        }
                        RecyclerView.this.c(i13, currVelocity);
                    }
                    if (RecyclerView.K0) {
                        RecyclerView.this.l0.b();
                    }
                }
            }
            z zVar3 = RecyclerView.this.q.f1005g;
            if (zVar3 != null && zVar3.b()) {
                zVar3.d(0, 0);
            }
            this.f1029i = false;
            if (this.f1030j) {
                c();
            } else {
                RecyclerView.this.setScrollState(0);
                RecyclerView.this.a(1);
            }
        }
    }

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

        @Override // androidx.recyclerview.widget.m.b
        public void a(d0 d0Var) {
            RecyclerView recyclerView = RecyclerView.this;
            recyclerView.q.j1(d0Var.itemView, recyclerView.f994f);
        }

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

        @Override // androidx.recyclerview.widget.m.b
        public void c(d0 d0Var, m.c cVar, m.c cVar2) {
            RecyclerView.this.f994f.J(d0Var);
            RecyclerView.this.o(d0Var, cVar, cVar2);
        }

        @Override // androidx.recyclerview.widget.m.b
        public void d(d0 d0Var, m.c cVar, m.c cVar2) {
            d0Var.setIsRecyclable(false);
            RecyclerView recyclerView = RecyclerView.this;
            if (recyclerView.I) {
                if (recyclerView.R.b(d0Var, d0Var, cVar, cVar2)) {
                    RecyclerView.this.L0();
                }
            } else if (recyclerView.R.d(d0Var, cVar, cVar2)) {
                RecyclerView.this.L0();
            }
        }
    }

    public static abstract class d0 {
        static final int FLAG_ADAPTER_FULLUPDATE = 1024;
        static final int FLAG_ADAPTER_POSITION_UNKNOWN = 512;
        static final int FLAG_APPEARED_IN_PRE_LAYOUT = 4096;
        static final int FLAG_BOUNCED_FROM_HIDDEN_LIST = 8192;
        static final int FLAG_BOUND = 1;
        static final int FLAG_IGNORE = 128;
        static final int FLAG_INVALID = 4;
        static final int FLAG_MOVED = 2048;
        static final int FLAG_NOT_RECYCLABLE = 16;
        static final int FLAG_REMOVED = 8;
        static final int FLAG_RETURNED_FROM_SCRAP = 32;
        static final int FLAG_TMP_DETACHED = 256;
        static final int FLAG_UPDATE = 2;
        private static final List<Object> FULLUPDATE_PAYLOADS = Collections.emptyList();
        static final int PENDING_ACCESSIBILITY_STATE_NOT_SET = -1;
        public final View itemView;
        h<? extends d0> mBindingAdapter;
        int mFlags;
        WeakReference<RecyclerView> mNestedRecyclerView;
        RecyclerView mOwnerRecyclerView;
        int mPosition = -1;
        int mOldPosition = -1;
        long mItemId = -1;
        int mItemViewType = -1;
        int mPreLayoutPosition = -1;
        d0 mShadowedHolder = null;
        d0 mShadowingHolder = null;
        List<Object> mPayloads = null;
        List<Object> mUnmodifiedPayloads = null;
        private int mIsRecyclableCount = 0;
        v mScrapContainer = null;
        boolean mInChangeScrap = false;
        private int mWasImportantForAccessibilityBeforeHidden = 0;
        int mPendingAccessibilityState = -1;

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

        private void createPayloadsIfNeeded() {
            if (this.mPayloads == null) {
                ArrayList arrayList = new ArrayList();
                this.mPayloads = arrayList;
                this.mUnmodifiedPayloads = Collections.unmodifiableList(arrayList);
            }
        }

        void addChangePayload(Object obj) {
            if (obj == null) {
                addFlags(1024);
            } else if ((1024 & this.mFlags) == 0) {
                createPayloadsIfNeeded();
                this.mPayloads.add(obj);
            }
        }

        void addFlags(int i2) {
            this.mFlags = i2 | this.mFlags;
        }

        void clearOldPosition() {
            this.mOldPosition = -1;
            this.mPreLayoutPosition = -1;
        }

        void clearPayload() {
            List<Object> list = this.mPayloads;
            if (list != null) {
                list.clear();
            }
            this.mFlags &= -1025;
        }

        void clearReturnedFromScrapFlag() {
            this.mFlags &= -33;
        }

        void clearTmpDetachFlag() {
            this.mFlags &= -257;
        }

        boolean doesTransientStatePreventRecycling() {
            return (this.mFlags & 16) == 0 && c.f.l.t.E(this.itemView);
        }

        void flagRemovedAndOffsetPosition(int i2, int i3, boolean z) {
            addFlags(8);
            offsetPosition(i3, z);
            this.mPosition = i2;
        }

        public final int getAbsoluteAdapterPosition() {
            RecyclerView recyclerView = this.mOwnerRecyclerView;
            if (recyclerView == null) {
                return -1;
            }
            return recyclerView.c0(this);
        }

        @Deprecated
        public final int getAdapterPosition() {
            return getBindingAdapterPosition();
        }

        public final h<? extends d0> getBindingAdapter() {
            return this.mBindingAdapter;
        }

        public final int getBindingAdapterPosition() {
            RecyclerView recyclerView;
            h adapter;
            int iC0;
            if (this.mBindingAdapter == null || (recyclerView = this.mOwnerRecyclerView) == null || (adapter = recyclerView.getAdapter()) == null || (iC0 = this.mOwnerRecyclerView.c0(this)) == -1) {
                return -1;
            }
            return adapter.findRelativeAdapterPositionIn(this.mBindingAdapter, this, iC0);
        }

        public final long getItemId() {
            return this.mItemId;
        }

        public final int getItemViewType() {
            return this.mItemViewType;
        }

        public final int getLayoutPosition() {
            int i2 = this.mPreLayoutPosition;
            return i2 == -1 ? this.mPosition : i2;
        }

        public final int getOldPosition() {
            return this.mOldPosition;
        }

        @Deprecated
        public final int getPosition() {
            int i2 = this.mPreLayoutPosition;
            return i2 == -1 ? this.mPosition : i2;
        }

        List<Object> getUnmodifiedPayloads() {
            if ((this.mFlags & 1024) != 0) {
                return FULLUPDATE_PAYLOADS;
            }
            List<Object> list = this.mPayloads;
            return (list == null || list.size() == 0) ? FULLUPDATE_PAYLOADS : this.mUnmodifiedPayloads;
        }

        boolean hasAnyOfTheFlags(int i2) {
            return (i2 & this.mFlags) != 0;
        }

        boolean isAdapterPositionUnknown() {
            return (this.mFlags & 512) != 0 || isInvalid();
        }

        boolean isAttachedToTransitionOverlay() {
            return (this.itemView.getParent() == null || this.itemView.getParent() == this.mOwnerRecyclerView) ? false : true;
        }

        boolean isBound() {
            return (this.mFlags & 1) != 0;
        }

        boolean isInvalid() {
            return (this.mFlags & 4) != 0;
        }

        public final boolean isRecyclable() {
            return (this.mFlags & 16) == 0 && !c.f.l.t.E(this.itemView);
        }

        boolean isRemoved() {
            return (this.mFlags & 8) != 0;
        }

        boolean isScrap() {
            return this.mScrapContainer != null;
        }

        boolean isTmpDetached() {
            return (this.mFlags & FLAG_TMP_DETACHED) != 0;
        }

        boolean isUpdated() {
            return (this.mFlags & 2) != 0;
        }

        boolean needsUpdate() {
            return (this.mFlags & 2) != 0;
        }

        void offsetPosition(int i2, boolean z) {
            if (this.mOldPosition == -1) {
                this.mOldPosition = this.mPosition;
            }
            if (this.mPreLayoutPosition == -1) {
                this.mPreLayoutPosition = this.mPosition;
            }
            if (z) {
                this.mPreLayoutPosition += i2;
            }
            this.mPosition += i2;
            if (this.itemView.getLayoutParams() != null) {
                ((p) this.itemView.getLayoutParams()).f1039c = true;
            }
        }

        void onEnteredHiddenState(RecyclerView recyclerView) {
            int i2 = this.mPendingAccessibilityState;
            if (i2 != -1) {
                this.mWasImportantForAccessibilityBeforeHidden = i2;
            } else {
                this.mWasImportantForAccessibilityBeforeHidden = c.f.l.t.s(this.itemView);
            }
            recyclerView.h1(this, 4);
        }

        void onLeftHiddenState(RecyclerView recyclerView) {
            recyclerView.h1(this, this.mWasImportantForAccessibilityBeforeHidden);
            this.mWasImportantForAccessibilityBeforeHidden = 0;
        }

        void resetInternal() {
            this.mFlags = 0;
            this.mPosition = -1;
            this.mOldPosition = -1;
            this.mItemId = -1L;
            this.mPreLayoutPosition = -1;
            this.mIsRecyclableCount = 0;
            this.mShadowedHolder = null;
            this.mShadowingHolder = null;
            clearPayload();
            this.mWasImportantForAccessibilityBeforeHidden = 0;
            this.mPendingAccessibilityState = -1;
            RecyclerView.s(this);
        }

        void saveOldPosition() {
            if (this.mOldPosition == -1) {
                this.mOldPosition = this.mPosition;
            }
        }

        void setFlags(int i2, int i3) {
            this.mFlags = (i2 & i3) | (this.mFlags & (~i3));
        }

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

        void setScrapContainer(v vVar, boolean z) {
            this.mScrapContainer = vVar;
            this.mInChangeScrap = z;
        }

        boolean shouldBeKeptAsChild() {
            return (this.mFlags & 16) != 0;
        }

        boolean shouldIgnore() {
            return (this.mFlags & 128) != 0;
        }

        void stopIgnoring() {
            this.mFlags &= -129;
        }

        public String toString() {
            StringBuilder sb = new StringBuilder((getClass().isAnonymousClass() ? "ViewHolder" : getClass().getSimpleName()) + "{" + Integer.toHexString(hashCode()) + " position=" + this.mPosition + " id=" + this.mItemId + ", oldPos=" + this.mOldPosition + ", pLpos:" + this.mPreLayoutPosition);
            if (isScrap()) {
                sb.append(" scrap ");
                sb.append(this.mInChangeScrap ? "[changeScrap]" : "[attachedScrap]");
            }
            if (isInvalid()) {
                sb.append(" invalid");
            }
            if (!isBound()) {
                sb.append(" unbound");
            }
            if (needsUpdate()) {
                sb.append(" update");
            }
            if (isRemoved()) {
                sb.append(" removed");
            }
            if (shouldIgnore()) {
                sb.append(" ignored");
            }
            if (isTmpDetached()) {
                sb.append(" tmpDetached");
            }
            if (!isRecyclable()) {
                sb.append(" not recyclable(" + this.mIsRecyclableCount + ")");
            }
            if (isAdapterPositionUnknown()) {
                sb.append(" undefined adapter position");
            }
            if (this.itemView.getParent() == null) {
                sb.append(" no parent");
            }
            sb.append("}");
            return sb.toString();
        }

        void unScrap() {
            this.mScrapContainer.J(this);
        }

        boolean wasReturnedFromScrap() {
            return (this.mFlags & 32) != 0;
        }
    }

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

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

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

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

        @Override // androidx.recyclerview.widget.b.InterfaceC0016b
        public void d(int i2) {
            d0 d0VarF0;
            View viewA = a(i2);
            if (viewA != null && (d0VarF0 = RecyclerView.f0(viewA)) != null) {
                if (d0VarF0.isTmpDetached() && !d0VarF0.shouldIgnore()) {
                    throw new IllegalArgumentException("called detach on an already detached child " + d0VarF0 + RecyclerView.this.Q());
                }
                d0VarF0.addFlags(256);
            }
            RecyclerView.this.detachViewFromParent(i2);
        }

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

        @Override // androidx.recyclerview.widget.b.InterfaceC0016b
        public void f(View view, int i2) {
            RecyclerView.this.addView(view, i2);
            RecyclerView.this.z(view);
        }

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

        @Override // androidx.recyclerview.widget.b.InterfaceC0016b
        public void h(int i2) {
            View childAt = RecyclerView.this.getChildAt(i2);
            if (childAt != null) {
                RecyclerView.this.A(childAt);
                childAt.clearAnimation();
            }
            RecyclerView.this.removeViewAt(i2);
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0016b
        public void i() {
            int iG = g();
            for (int i2 = 0; i2 < iG; i2++) {
                View viewA = a(i2);
                RecyclerView.this.A(viewA);
                viewA.clearAnimation();
            }
            RecyclerView.this.removeAllViews();
        }

        @Override // androidx.recyclerview.widget.b.InterfaceC0016b
        public void j(View view, int i2, ViewGroup.LayoutParams layoutParams) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0 != null) {
                if (!d0VarF0.isTmpDetached() && !d0VarF0.shouldIgnore()) {
                    throw new IllegalArgumentException("Called attach on a child which is not detached: " + d0VarF0 + RecyclerView.this.Q());
                }
                d0VarF0.clearTmpDetachFlag();
            }
            RecyclerView.this.attachViewToParent(view, i2, layoutParams);
        }

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

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

        @Override // androidx.recyclerview.widget.a.InterfaceC0015a
        public void a(int i2, int i3) {
            RecyclerView.this.B0(i2, i3);
            RecyclerView.this.p0 = true;
        }

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

        @Override // androidx.recyclerview.widget.a.InterfaceC0015a
        public d0 c(int i2) {
            d0 d0VarA0 = RecyclerView.this.a0(i2, true);
            if (d0VarA0 == null || RecyclerView.this.f997i.n(d0VarA0.itemView)) {
                return null;
            }
            return d0VarA0;
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0015a
        public void d(int i2, int i3) {
            RecyclerView.this.C0(i2, i3, false);
            RecyclerView.this.p0 = true;
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0015a
        public void e(int i2, int i3) {
            RecyclerView.this.A0(i2, i3);
            RecyclerView.this.p0 = true;
        }

        @Override // androidx.recyclerview.widget.a.InterfaceC0015a
        public void f(int i2, int i3) {
            RecyclerView.this.C0(i2, i3, true);
            RecyclerView recyclerView = RecyclerView.this;
            recyclerView.p0 = true;
            recyclerView.m0.f1016d += i3;
        }

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

        @Override // androidx.recyclerview.widget.a.InterfaceC0015a
        public void h(int i2, int i3, Object obj) {
            RecyclerView.this.s1(i2, i3, obj);
            RecyclerView.this.q0 = true;
        }

        void i(a.b bVar) {
            int i2 = bVar.a;
            if (i2 == 1) {
                RecyclerView recyclerView = RecyclerView.this;
                recyclerView.q.P0(recyclerView, bVar.f1087b, bVar.f1089d);
                return;
            }
            if (i2 == 2) {
                RecyclerView recyclerView2 = RecyclerView.this;
                recyclerView2.q.S0(recyclerView2, bVar.f1087b, bVar.f1089d);
            } else if (i2 == 4) {
                RecyclerView recyclerView3 = RecyclerView.this;
                recyclerView3.q.U0(recyclerView3, bVar.f1087b, bVar.f1089d, bVar.f1088c);
            } else {
                if (i2 != 8) {
                    return;
                }
                RecyclerView recyclerView4 = RecyclerView.this;
                recyclerView4.q.R0(recyclerView4, bVar.f1087b, bVar.f1089d, 1);
            }
        }
    }

    static /* synthetic */ class g {
        static final /* synthetic */ int[] a;

        static {
            int[] iArr = new int[h.a.values().length];
            a = iArr;
            try {
                iArr[h.a.PREVENT.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[h.a.PREVENT_WHEN_EMPTY.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
        }
    }

    public static abstract class h<VH extends d0> {
        private final i mObservable = new i();
        private boolean mHasStableIds = false;
        private a mStateRestorationPolicy = a.ALLOW;

        public enum a {
            ALLOW,
            PREVENT_WHEN_EMPTY,
            PREVENT
        }

        /* JADX WARN: Multi-variable type inference failed */
        public final void bindViewHolder(VH vh, int i2) {
            boolean z = vh.mBindingAdapter == null;
            if (z) {
                vh.mPosition = i2;
                if (hasStableIds()) {
                    vh.mItemId = getItemId(i2);
                }
                vh.setFlags(1, InvokeCmd.CMD_XBUG_GET_LOG_NODE_INFO);
                c.f.h.b.a("RV OnBindView");
            }
            vh.mBindingAdapter = this;
            onBindViewHolder(vh, i2, vh.getUnmodifiedPayloads());
            if (z) {
                vh.clearPayload();
                ViewGroup.LayoutParams layoutParams = vh.itemView.getLayoutParams();
                if (layoutParams instanceof p) {
                    ((p) layoutParams).f1039c = true;
                }
                c.f.h.b.b();
            }
        }

        boolean canRestoreState() {
            int i2 = g.a[this.mStateRestorationPolicy.ordinal()];
            if (i2 != 1) {
                return i2 != 2 || getItemCount() > 0;
            }
            return false;
        }

        public final VH createViewHolder(ViewGroup viewGroup, int i2) {
            try {
                c.f.h.b.a("RV CreateView");
                VH vh = (VH) onCreateViewHolder(viewGroup, i2);
                if (vh.itemView.getParent() != null) {
                    throw new IllegalStateException("ViewHolder views must not be attached when created. Ensure that you are not passing 'true' to the attachToRoot parameter of LayoutInflater.inflate(..., boolean attachToRoot)");
                }
                vh.mItemViewType = i2;
                return vh;
            } finally {
                c.f.h.b.b();
            }
        }

        public int findRelativeAdapterPositionIn(h<? extends d0> hVar, d0 d0Var, int i2) {
            if (hVar == this) {
                return i2;
            }
            return -1;
        }

        public abstract int getItemCount();

        public long getItemId(int i2) {
            return -1L;
        }

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

        public final a getStateRestorationPolicy() {
            return this.mStateRestorationPolicy;
        }

        public final boolean hasObservers() {
            return this.mObservable.a();
        }

        public final boolean hasStableIds() {
            return this.mHasStableIds;
        }

        public final void notifyDataSetChanged() {
            this.mObservable.b();
        }

        public final void notifyItemChanged(int i2) {
            this.mObservable.d(i2, 1);
        }

        public final void notifyItemInserted(int i2) {
            this.mObservable.f(i2, 1);
        }

        public final void notifyItemMoved(int i2, int i3) {
            this.mObservable.c(i2, i3);
        }

        public final void notifyItemRangeChanged(int i2, int i3) {
            this.mObservable.d(i2, i3);
        }

        public final void notifyItemRangeInserted(int i2, int i3) {
            this.mObservable.f(i2, i3);
        }

        public final void notifyItemRangeRemoved(int i2, int i3) {
            this.mObservable.g(i2, i3);
        }

        public final void notifyItemRemoved(int i2) {
            this.mObservable.g(i2, 1);
        }

        public void onAttachedToRecyclerView(RecyclerView recyclerView) {
        }

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

        public void onBindViewHolder(VH vh, int i2, List<Object> list) {
            onBindViewHolder(vh, i2);
        }

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

        public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
        }

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

        public void onViewAttachedToWindow(VH vh) {
        }

        public void onViewDetachedFromWindow(VH vh) {
        }

        public void onViewRecycled(VH vh) {
        }

        public void registerAdapterDataObserver(j jVar) {
            this.mObservable.registerObserver(jVar);
        }

        public void setHasStableIds(boolean z) {
            if (hasObservers()) {
                throw new IllegalStateException("Cannot change whether this adapter has stable IDs while the adapter has registered observers.");
            }
            this.mHasStableIds = z;
        }

        public void setStateRestorationPolicy(a aVar) {
            this.mStateRestorationPolicy = aVar;
            this.mObservable.h();
        }

        public void unregisterAdapterDataObserver(j jVar) {
            this.mObservable.unregisterObserver(jVar);
        }

        public final void notifyItemChanged(int i2, Object obj) {
            this.mObservable.e(i2, 1, obj);
        }

        public final void notifyItemRangeChanged(int i2, int i3, Object obj) {
            this.mObservable.e(i2, i3, obj);
        }
    }

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

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

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

        public void c(int i2, int i3) {
            for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
                ((j) ((Observable) this).mObservers.get(size)).e(i2, i3, 1);
            }
        }

        public void d(int i2, int i3) {
            e(i2, i3, null);
        }

        public void e(int i2, int i3, Object obj) {
            for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
                ((j) ((Observable) this).mObservers.get(size)).c(i2, i3, obj);
            }
        }

        public void f(int i2, int i3) {
            for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
                ((j) ((Observable) this).mObservers.get(size)).d(i2, i3);
            }
        }

        public void g(int i2, int i3) {
            for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
                ((j) ((Observable) this).mObservers.get(size)).f(i2, i3);
            }
        }

        public void h() {
            for (int size = ((Observable) this).mObservers.size() - 1; size >= 0; size--) {
                ((j) ((Observable) this).mObservers.get(size)).g();
            }
        }
    }

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

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

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

        public void d(int i2, int i3) {
        }

        public void e(int i2, int i3, int i4) {
        }

        public void f(int i2, int i3) {
        }

        public void g() {
        }
    }

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

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

    public static abstract class m {
        private b a = null;

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

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

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

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

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

        public interface a {
            void a();
        }

        interface b {
            void a(d0 d0Var);
        }

        public static class c {
            public int a;

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

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

            public c b(d0 d0Var, int i2) {
                View view = d0Var.itemView;
                this.a = view.getLeft();
                this.f1037b = view.getTop();
                view.getRight();
                view.getBottom();
                return this;
            }
        }

        static int e(d0 d0Var) {
            int i2 = d0Var.mFlags & 14;
            if (d0Var.isInvalid()) {
                return 4;
            }
            if ((i2 & 4) != 0) {
                return i2;
            }
            int oldPosition = d0Var.getOldPosition();
            int absoluteAdapterPosition = d0Var.getAbsoluteAdapterPosition();
            return (oldPosition == -1 || absoluteAdapterPosition == -1 || oldPosition == absoluteAdapterPosition) ? i2 : i2 | 2048;
        }

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

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

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

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

        public abstract boolean f(d0 d0Var);

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

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

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

        public abstract void j(d0 d0Var);

        public abstract void k();

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

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

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

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

        public abstract boolean p();

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

        public void r(d0 d0Var) {
        }

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

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

        public abstract void u();

        public void v(long j2) {
            this.f1036f = j2;
        }

        void w(b bVar) {
            this.a = bVar;
        }
    }

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

        @Override // androidx.recyclerview.widget.RecyclerView.m.b
        public void a(d0 d0Var) {
            d0Var.setIsRecyclable(true);
            if (d0Var.mShadowedHolder != null && d0Var.mShadowingHolder == null) {
                d0Var.mShadowedHolder = null;
            }
            d0Var.mShadowingHolder = null;
            if (d0Var.shouldBeKeptAsChild() || RecyclerView.this.U0(d0Var.itemView) || !d0Var.isTmpDetached()) {
                return;
            }
            RecyclerView.this.removeDetachedView(d0Var.itemView, false);
        }
    }

    public static abstract class o {
        @Deprecated
        public void getItemOffsets(Rect rect, int i2, RecyclerView recyclerView) {
            rect.set(0, 0, 0, 0);
        }

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

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

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

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

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

    public interface q {
        void a(View view);

        void b(View view);
    }

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

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

        void b(RecyclerView recyclerView, MotionEvent motionEvent);

        void c(boolean z);
    }

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

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

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

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

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

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

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

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

            a() {
            }
        }

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

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

        public void b() {
            for (int i2 = 0; i2 < this.a.size(); i2++) {
                this.a.valueAt(i2).a.clear();
            }
        }

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

        void d(int i2, long j2) {
            a aVarG = g(i2);
            aVarG.f1044d = j(aVarG.f1044d, j2);
        }

        void e(int i2, long j2) {
            a aVarG = g(i2);
            aVarG.f1043c = j(aVarG.f1043c, j2);
        }

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

        void h(h hVar, h hVar2, boolean z) {
            if (hVar != null) {
                c();
            }
            if (!z && this.f1041b == 0) {
                b();
            }
            if (hVar2 != null) {
                a();
            }
        }

        public void i(d0 d0Var) {
            int itemViewType = d0Var.getItemViewType();
            ArrayList<d0> arrayList = g(itemViewType).a;
            if (this.a.get(itemViewType).f1042b <= arrayList.size()) {
                return;
            }
            d0Var.resetInternal();
            arrayList.add(d0Var);
        }

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

        boolean k(int i2, long j2, long j3) {
            long j4 = g(i2).f1044d;
            return j4 == 0 || j2 + j4 < j3;
        }

        boolean l(int i2, long j2, long j3) {
            long j4 = g(i2).f1043c;
            return j4 == 0 || j2 + j4 < j3;
        }
    }

    public final class v {
        final ArrayList<d0> a = new ArrayList<>();

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

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

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private final List<d0> f1047d = Collections.unmodifiableList(this.a);

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

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

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

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

        public v() {
        }

        private boolean H(d0 d0Var, int i2, int i3, long j2) {
            d0Var.mBindingAdapter = null;
            d0Var.mOwnerRecyclerView = RecyclerView.this;
            int itemViewType = d0Var.getItemViewType();
            long nanoTime = RecyclerView.this.getNanoTime();
            if (j2 != Long.MAX_VALUE && !this.f1050g.k(itemViewType, nanoTime, j2)) {
                return false;
            }
            RecyclerView.this.p.bindViewHolder(d0Var, i2);
            this.f1050g.d(d0Var.getItemViewType(), RecyclerView.this.getNanoTime() - nanoTime);
            b(d0Var);
            if (!RecyclerView.this.m0.e()) {
                return true;
            }
            d0Var.mPreLayoutPosition = i3;
            return true;
        }

        private void b(d0 d0Var) {
            if (RecyclerView.this.s0()) {
                View view = d0Var.itemView;
                if (c.f.l.t.s(view) == 0) {
                    c.f.l.t.e0(view, 1);
                }
                androidx.recyclerview.widget.i iVar = RecyclerView.this.t0;
                if (iVar == null) {
                    return;
                }
                c.f.l.a aVarN = iVar.n();
                if (aVarN instanceof i.a) {
                    ((i.a) aVarN).o(view);
                }
                c.f.l.t.W(view, aVarN);
            }
        }

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

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

        void A(int i2) {
            a(this.f1046c.get(i2), true);
            this.f1046c.remove(i2);
        }

        public void B(View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (d0VarF0.isTmpDetached()) {
                RecyclerView.this.removeDetachedView(view, false);
            }
            if (d0VarF0.isScrap()) {
                d0VarF0.unScrap();
            } else if (d0VarF0.wasReturnedFromScrap()) {
                d0VarF0.clearReturnedFromScrapFlag();
            }
            C(d0VarF0);
            if (RecyclerView.this.R == null || d0VarF0.isRecyclable()) {
                return;
            }
            RecyclerView.this.R.j(d0VarF0);
        }

        void C(d0 d0Var) {
            boolean z;
            boolean z2 = true;
            if (d0Var.isScrap() || d0Var.itemView.getParent() != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("Scrapped or attached views may not be recycled. isScrap:");
                sb.append(d0Var.isScrap());
                sb.append(" isAttached:");
                sb.append(d0Var.itemView.getParent() != null);
                sb.append(RecyclerView.this.Q());
                throw new IllegalArgumentException(sb.toString());
            }
            if (d0Var.isTmpDetached()) {
                throw new IllegalArgumentException("Tmp detached view should be removed from RecyclerView before it can be recycled: " + d0Var + RecyclerView.this.Q());
            }
            if (d0Var.shouldIgnore()) {
                throw new IllegalArgumentException("Trying to recycle an ignored view holder. You should first call stopIgnoringView(view) before calling recycle." + RecyclerView.this.Q());
            }
            boolean zDoesTransientStatePreventRecycling = d0Var.doesTransientStatePreventRecycling();
            h hVar = RecyclerView.this.p;
            if ((hVar != null && zDoesTransientStatePreventRecycling && hVar.onFailedToRecycleView(d0Var)) || d0Var.isRecyclable()) {
                if (this.f1049f <= 0 || d0Var.hasAnyOfTheFlags(526)) {
                    z = false;
                } else {
                    int size = this.f1046c.size();
                    if (size >= this.f1049f && size > 0) {
                        A(0);
                        size--;
                    }
                    if (RecyclerView.K0 && size > 0 && !RecyclerView.this.l0.d(d0Var.mPosition)) {
                        int i2 = size - 1;
                        while (i2 >= 0) {
                            if (!RecyclerView.this.l0.d(this.f1046c.get(i2).mPosition)) {
                                break;
                            } else {
                                i2--;
                            }
                        }
                        size = i2 + 1;
                    }
                    this.f1046c.add(size, d0Var);
                    z = true;
                }
                if (z) {
                    z2 = false;
                } else {
                    a(d0Var, true);
                }
                z = z;
            } else {
                z2 = false;
            }
            RecyclerView.this.f998j.q(d0Var);
            if (z || z2 || !zDoesTransientStatePreventRecycling) {
                return;
            }
            d0Var.mBindingAdapter = null;
            d0Var.mOwnerRecyclerView = null;
        }

        void D(View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            if (!d0VarF0.hasAnyOfTheFlags(12) && d0VarF0.isUpdated() && !RecyclerView.this.q(d0VarF0)) {
                if (this.f1045b == null) {
                    this.f1045b = new ArrayList<>();
                }
                d0VarF0.setScrapContainer(this, true);
                this.f1045b.add(d0VarF0);
                return;
            }
            if (!d0VarF0.isInvalid() || d0VarF0.isRemoved() || RecyclerView.this.p.hasStableIds()) {
                d0VarF0.setScrapContainer(this, false);
                this.a.add(d0VarF0);
            } else {
                throw new IllegalArgumentException("Called scrap view with an invalid view. Invalid views cannot be reused from scrap, they should rebound from recycler pool." + RecyclerView.this.Q());
            }
        }

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

        void F(b0 b0Var) {
            this.f1051h = b0Var;
        }

        public void G(int i2) {
            this.f1048e = i2;
            K();
        }

        /* JADX WARN: Removed duplicated region for block: B:100:0x020c  */
        /* JADX WARN: Removed duplicated region for block: B:106:0x0228 A[ADDED_TO_REGION] */
        /* JADX WARN: Removed duplicated region for block: B:108:0x022b  */
        /* JADX WARN: Removed duplicated region for block: B:18:0x0037  */
        /* JADX WARN: Removed duplicated region for block: B:27:0x005c  */
        /* JADX WARN: Removed duplicated region for block: B:29:0x005f  */
        /* JADX WARN: Removed duplicated region for block: B:73:0x0181 A[PHI: r1 r4
          0x0181: PHI (r1v12 androidx.recyclerview.widget.RecyclerView$d0) = (r1v11 androidx.recyclerview.widget.RecyclerView$d0), (r1v31 androidx.recyclerview.widget.RecyclerView$d0) binds: [B:28:0x005d, B:59:0x0102] A[DONT_GENERATE, DONT_INLINE]
          0x0181: PHI (r4v3 boolean) = (r4v2 boolean), (r4v7 boolean) binds: [B:28:0x005d, B:59:0x0102] A[DONT_GENERATE, DONT_INLINE]] */
        /* JADX WARN: Removed duplicated region for block: B:82:0x01a2  */
        /* JADX WARN: Removed duplicated region for block: B:88:0x01ce  */
        /* JADX WARN: Removed duplicated region for block: B:99:0x01fe  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        androidx.recyclerview.widget.RecyclerView.d0 I(int r17, boolean r18, long r19) {
            /*
                Method dump skipped, instruction units count: 615
                To view this dump add '--comments-level debug' option
            */
            throw new UnsupportedOperationException("Method not decompiled: androidx.recyclerview.widget.RecyclerView.v.I(int, boolean, long):androidx.recyclerview.widget.RecyclerView$d0");
        }

        void J(d0 d0Var) {
            if (d0Var.mInChangeScrap) {
                this.f1045b.remove(d0Var);
            } else {
                this.a.remove(d0Var);
            }
            d0Var.mScrapContainer = null;
            d0Var.mInChangeScrap = false;
            d0Var.clearReturnedFromScrapFlag();
        }

        void K() {
            LayoutManager layoutManager = RecyclerView.this.q;
            this.f1049f = this.f1048e + (layoutManager != null ? layoutManager.m : 0);
            for (int size = this.f1046c.size() - 1; size >= 0 && this.f1046c.size() > this.f1049f; size--) {
                A(size);
            }
        }

        boolean L(d0 d0Var) {
            if (d0Var.isRemoved()) {
                return RecyclerView.this.m0.e();
            }
            int i2 = d0Var.mPosition;
            if (i2 >= 0 && i2 < RecyclerView.this.p.getItemCount()) {
                if (RecyclerView.this.m0.e() || RecyclerView.this.p.getItemViewType(d0Var.mPosition) == d0Var.getItemViewType()) {
                    return !RecyclerView.this.p.hasStableIds() || d0Var.getItemId() == RecyclerView.this.p.getItemId(d0Var.mPosition);
                }
                return false;
            }
            throw new IndexOutOfBoundsException("Inconsistency detected. Invalid view holder adapter position" + d0Var + RecyclerView.this.Q());
        }

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

        void a(d0 d0Var, boolean z) {
            RecyclerView.s(d0Var);
            View view = d0Var.itemView;
            androidx.recyclerview.widget.i iVar = RecyclerView.this.t0;
            if (iVar != null) {
                c.f.l.a aVarN = iVar.n();
                c.f.l.t.W(view, aVarN instanceof i.a ? ((i.a) aVarN).n(view) : null);
            }
            if (z) {
                g(d0Var);
            }
            d0Var.mBindingAdapter = null;
            d0Var.mOwnerRecyclerView = null;
            i().i(d0Var);
        }

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

        void d() {
            int size = this.f1046c.size();
            for (int i2 = 0; i2 < size; i2++) {
                this.f1046c.get(i2).clearOldPosition();
            }
            int size2 = this.a.size();
            for (int i3 = 0; i3 < size2; i3++) {
                this.a.get(i3).clearOldPosition();
            }
            ArrayList<d0> arrayList = this.f1045b;
            if (arrayList != null) {
                int size3 = arrayList.size();
                for (int i4 = 0; i4 < size3; i4++) {
                    this.f1045b.get(i4).clearOldPosition();
                }
            }
        }

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

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

        void g(d0 d0Var) {
            w wVar = RecyclerView.this.r;
            if (wVar != null) {
                wVar.a(d0Var);
            }
            int size = RecyclerView.this.s.size();
            for (int i2 = 0; i2 < size; i2++) {
                RecyclerView.this.s.get(i2).a(d0Var);
            }
            h hVar = RecyclerView.this.p;
            if (hVar != null) {
                hVar.onViewRecycled(d0Var);
            }
            RecyclerView recyclerView = RecyclerView.this;
            if (recyclerView.m0 != null) {
                recyclerView.f998j.q(d0Var);
            }
        }

        d0 h(int i2) {
            int size;
            int iM;
            ArrayList<d0> arrayList = this.f1045b;
            if (arrayList != null && (size = arrayList.size()) != 0) {
                for (int i3 = 0; i3 < size; i3++) {
                    d0 d0Var = this.f1045b.get(i3);
                    if (!d0Var.wasReturnedFromScrap() && d0Var.getLayoutPosition() == i2) {
                        d0Var.addFlags(32);
                        return d0Var;
                    }
                }
                if (RecyclerView.this.p.hasStableIds() && (iM = RecyclerView.this.f996h.m(i2)) > 0 && iM < RecyclerView.this.p.getItemCount()) {
                    long itemId = RecyclerView.this.p.getItemId(iM);
                    for (int i4 = 0; i4 < size; i4++) {
                        d0 d0Var2 = this.f1045b.get(i4);
                        if (!d0Var2.wasReturnedFromScrap() && d0Var2.getItemId() == itemId) {
                            d0Var2.addFlags(32);
                            return d0Var2;
                        }
                    }
                }
            }
            return null;
        }

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

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

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

        d0 l(long j2, int i2, boolean z) {
            for (int size = this.a.size() - 1; size >= 0; size--) {
                d0 d0Var = this.a.get(size);
                if (d0Var.getItemId() == j2 && !d0Var.wasReturnedFromScrap()) {
                    if (i2 == d0Var.getItemViewType()) {
                        d0Var.addFlags(32);
                        if (d0Var.isRemoved() && !RecyclerView.this.m0.e()) {
                            d0Var.setFlags(2, 14);
                        }
                        return d0Var;
                    }
                    if (!z) {
                        this.a.remove(size);
                        RecyclerView.this.removeDetachedView(d0Var.itemView, false);
                        y(d0Var.itemView);
                    }
                }
            }
            int size2 = this.f1046c.size();
            while (true) {
                size2--;
                if (size2 < 0) {
                    return null;
                }
                d0 d0Var2 = this.f1046c.get(size2);
                if (d0Var2.getItemId() == j2 && !d0Var2.isAttachedToTransitionOverlay()) {
                    if (i2 == d0Var2.getItemViewType()) {
                        if (!z) {
                            this.f1046c.remove(size2);
                        }
                        return d0Var2;
                    }
                    if (!z) {
                        A(size2);
                        return null;
                    }
                }
            }
        }

        d0 m(int i2, boolean z) {
            View viewE;
            int size = this.a.size();
            for (int i3 = 0; i3 < size; i3++) {
                d0 d0Var = this.a.get(i3);
                if (!d0Var.wasReturnedFromScrap() && d0Var.getLayoutPosition() == i2 && !d0Var.isInvalid() && (RecyclerView.this.m0.f1020h || !d0Var.isRemoved())) {
                    d0Var.addFlags(32);
                    return d0Var;
                }
            }
            if (z || (viewE = RecyclerView.this.f997i.e(i2)) == null) {
                int size2 = this.f1046c.size();
                for (int i4 = 0; i4 < size2; i4++) {
                    d0 d0Var2 = this.f1046c.get(i4);
                    if (!d0Var2.isInvalid() && d0Var2.getLayoutPosition() == i2 && !d0Var2.isAttachedToTransitionOverlay()) {
                        if (!z) {
                            this.f1046c.remove(i4);
                        }
                        return d0Var2;
                    }
                }
                return null;
            }
            d0 d0VarF0 = RecyclerView.f0(viewE);
            RecyclerView.this.f997i.s(viewE);
            int iM = RecyclerView.this.f997i.m(viewE);
            if (iM != -1) {
                RecyclerView.this.f997i.d(iM);
                D(viewE);
                d0VarF0.addFlags(InvokeCmd.CMD_TOUCH_OPS_GET_IFP_TOUCH_PID);
                return d0VarF0;
            }
            throw new IllegalStateException("layout index should not be -1 after unhiding a view:" + d0VarF0 + RecyclerView.this.Q());
        }

        View n(int i2) {
            return this.a.get(i2).itemView;
        }

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

        View p(int i2, boolean z) {
            return I(i2, z, Long.MAX_VALUE).itemView;
        }

        void s() {
            int size = this.f1046c.size();
            for (int i2 = 0; i2 < size; i2++) {
                p pVar = (p) this.f1046c.get(i2).itemView.getLayoutParams();
                if (pVar != null) {
                    pVar.f1039c = true;
                }
            }
        }

        void t() {
            int size = this.f1046c.size();
            for (int i2 = 0; i2 < size; i2++) {
                d0 d0Var = this.f1046c.get(i2);
                if (d0Var != null) {
                    d0Var.addFlags(6);
                    d0Var.addChangePayload(null);
                }
            }
            h hVar = RecyclerView.this.p;
            if (hVar == null || !hVar.hasStableIds()) {
                z();
            }
        }

        void u(int i2, int i3) {
            int size = this.f1046c.size();
            for (int i4 = 0; i4 < size; i4++) {
                d0 d0Var = this.f1046c.get(i4);
                if (d0Var != null && d0Var.mPosition >= i2) {
                    d0Var.offsetPosition(i3, false);
                }
            }
        }

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

        void w(int i2, int i3, boolean z) {
            int i4 = i2 + i3;
            for (int size = this.f1046c.size() - 1; size >= 0; size--) {
                d0 d0Var = this.f1046c.get(size);
                if (d0Var != null) {
                    int i5 = d0Var.mPosition;
                    if (i5 >= i4) {
                        d0Var.offsetPosition(-i3, z);
                    } else if (i5 >= i2) {
                        d0Var.addFlags(8);
                        A(size);
                    }
                }
            }
        }

        void x(h hVar, h hVar2, boolean z) {
            c();
            i().h(hVar, hVar2, z);
        }

        void y(View view) {
            d0 d0VarF0 = RecyclerView.f0(view);
            d0VarF0.mScrapContainer = null;
            d0VarF0.mInChangeScrap = false;
            d0VarF0.clearReturnedFromScrapFlag();
            C(d0VarF0);
        }

        void z() {
            for (int size = this.f1046c.size() - 1; size >= 0; size--) {
                A(size);
            }
            this.f1046c.clear();
            if (RecyclerView.K0) {
                RecyclerView.this.l0.b();
            }
        }
    }

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

    private class x extends j {
        x() {
        }

        @Override // androidx.recyclerview.widget.RecyclerView.j
        public void a() {
            RecyclerView.this.p(null);
            RecyclerView recyclerView = RecyclerView.this;
            recyclerView.m0.f1019g = true;
            recyclerView.O0(true);
            if (RecyclerView.this.f996h.p()) {
                return;
            }
            RecyclerView.this.requestLayout();
        }

        @Override // androidx.recyclerview.widget.RecyclerView.j
        public void c(int i2, int i3, Object obj) {
            RecyclerView.this.p(null);
            if (RecyclerView.this.f996h.r(i2, i3, obj)) {
                h();
            }
        }

        @Override // androidx.recyclerview.widget.RecyclerView.j
        public void d(int i2, int i3) {
            RecyclerView.this.p(null);
            if (RecyclerView.this.f996h.s(i2, i3)) {
                h();
            }
        }

        @Override // androidx.recyclerview.widget.RecyclerView.j
        public void e(int i2, int i3, int i4) {
            RecyclerView.this.p(null);
            if (RecyclerView.this.f996h.t(i2, i3, i4)) {
                h();
            }
        }

        @Override // androidx.recyclerview.widget.RecyclerView.j
        public void f(int i2, int i3) {
            RecyclerView.this.p(null);
            if (RecyclerView.this.f996h.u(i2, i3)) {
                h();
            }
        }

        @Override // androidx.recyclerview.widget.RecyclerView.j
        public void g() {
            h hVar;
            RecyclerView recyclerView = RecyclerView.this;
            if (recyclerView.f995g == null || (hVar = recyclerView.p) == null || !hVar.canRestoreState()) {
                return;
            }
            RecyclerView.this.requestLayout();
        }

        void h() {
            if (RecyclerView.J0) {
                RecyclerView recyclerView = RecyclerView.this;
                if (recyclerView.x && recyclerView.w) {
                    c.f.l.t.R(recyclerView, recyclerView.l);
                    return;
                }
            }
            RecyclerView recyclerView2 = RecyclerView.this;
            recyclerView2.F = true;
            recyclerView2.requestLayout();
        }
    }

    public static abstract class z {
        public abstract int a();

        public abstract boolean b();

        public abstract boolean c();

        abstract void d(int i2, int i3);

        protected abstract void e(View view);

        public abstract void f(int i2);

        protected final void g() {
            throw null;
        }
    }

    static {
        int i2 = Build.VERSION.SDK_INT;
        H0 = i2 == 18 || i2 == 19 || i2 == 20;
        I0 = Build.VERSION.SDK_INT >= 23;
        J0 = Build.VERSION.SDK_INT >= 16;
        K0 = Build.VERSION.SDK_INT >= 21;
        L0 = Build.VERSION.SDK_INT <= 15;
        M0 = Build.VERSION.SDK_INT <= 15;
        Class<?> cls = Integer.TYPE;
        N0 = new Class[]{Context.class, AttributeSet.class, cls, cls};
        O0 = new c();
    }

    public RecyclerView(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, c.l.a.recyclerViewStyle);
    }

    private void B() {
        int i2 = this.E;
        this.E = 0;
        if (i2 == 0 || !s0()) {
            return;
        }
        AccessibilityEvent accessibilityEventObtain = AccessibilityEvent.obtain();
        accessibilityEventObtain.setEventType(2048);
        c.f.l.c0.b.b(accessibilityEventObtain, i2);
        sendAccessibilityEventUnchecked(accessibilityEventObtain);
    }

    private void D() {
        this.m0.a(1);
        R(this.m0);
        this.m0.f1022j = false;
        n1();
        this.f998j.f();
        F0();
        N0();
        c1();
        a0 a0Var = this.m0;
        a0Var.f1021i = a0Var.f1023k && this.q0;
        this.q0 = false;
        this.p0 = false;
        a0 a0Var2 = this.m0;
        a0Var2.f1020h = a0Var2.l;
        a0Var2.f1018f = this.p.getItemCount();
        V(this.v0);
        if (this.m0.f1023k) {
            int iG = this.f997i.g();
            for (int i2 = 0; i2 < iG; i2++) {
                d0 d0VarF0 = f0(this.f997i.f(i2));
                if (!d0VarF0.shouldIgnore() && (!d0VarF0.isInvalid() || this.p.hasStableIds())) {
                    this.f998j.e(d0VarF0, this.R.t(this.m0, d0VarF0, m.e(d0VarF0), d0VarF0.getUnmodifiedPayloads()));
                    if (this.m0.f1021i && d0VarF0.isUpdated() && !d0VarF0.isRemoved() && !d0VarF0.shouldIgnore() && !d0VarF0.isInvalid()) {
                        this.f998j.c(d0(d0VarF0), d0VarF0);
                    }
                }
            }
        }
        if (this.m0.l) {
            d1();
            a0 a0Var3 = this.m0;
            boolean z2 = a0Var3.f1019g;
            a0Var3.f1019g = false;
            this.q.V0(this.f994f, a0Var3);
            this.m0.f1019g = z2;
            for (int i3 = 0; i3 < this.f997i.g(); i3++) {
                d0 d0VarF02 = f0(this.f997i.f(i3));
                if (!d0VarF02.shouldIgnore() && !this.f998j.i(d0VarF02)) {
                    int iE = m.e(d0VarF02);
                    boolean zHasAnyOfTheFlags = d0VarF02.hasAnyOfTheFlags(InvokeCmd.CMD_TOUCH_CTRL_START);
                    if (!zHasAnyOfTheFlags) {
                        iE |= 4096;
                    }
                    m.c cVarT = this.R.t(this.m0, d0VarF02, iE, d0VarF02.getUnmodifiedPayloads());
                    if (zHasAnyOfTheFlags) {
                        Q0(d0VarF02, cVarT);
                    } else {
                        this.f998j.a(d0VarF02, cVarT);
                    }
                }
            }
            t();
        } else {
            t();
        }
        G0();
        p1(false);
        this.m0.f1017e = 2;
    }

    private void E() {
        n1();
        F0();
        this.m0.a(6);
        this.f996h.j();
        this.m0.f1018f = this.p.getItemCount();
        this.m0.f1016d = 0;
        if (this.f995g != null && this.p.canRestoreState()) {
            Parcelable parcelable = this.f995g.f1053g;
            if (parcelable != null) {
                this.q.a1(parcelable);
            }
            this.f995g = null;
        }
        a0 a0Var = this.m0;
        a0Var.f1020h = false;
        this.q.V0(this.f994f, a0Var);
        a0 a0Var2 = this.m0;
        a0Var2.f1019g = false;
        a0Var2.f1023k = a0Var2.f1023k && this.R != null;
        this.m0.f1017e = 4;
        G0();
        p1(false);
    }

    private void F() {
        this.m0.a(4);
        n1();
        F0();
        a0 a0Var = this.m0;
        a0Var.f1017e = 1;
        if (a0Var.f1023k) {
            for (int iG = this.f997i.g() - 1; iG >= 0; iG--) {
                d0 d0VarF0 = f0(this.f997i.f(iG));
                if (!d0VarF0.shouldIgnore()) {
                    long jD0 = d0(d0VarF0);
                    m.c cVarS = this.R.s(this.m0, d0VarF0);
                    d0 d0VarG = this.f998j.g(jD0);
                    if (d0VarG == null || d0VarG.shouldIgnore()) {
                        this.f998j.d(d0VarF0, cVarS);
                    } else {
                        boolean zH = this.f998j.h(d0VarG);
                        boolean zH2 = this.f998j.h(d0VarF0);
                        if (zH && d0VarG == d0VarF0) {
                            this.f998j.d(d0VarF0, cVarS);
                        } else {
                            m.c cVarN = this.f998j.n(d0VarG);
                            this.f998j.d(d0VarF0, cVarS);
                            m.c cVarM = this.f998j.m(d0VarF0);
                            if (cVarN == null) {
                                k0(jD0, d0VarF0, d0VarG);
                            } else {
                                n(d0VarG, d0VarF0, cVarN, cVarM, zH, zH2);
                            }
                        }
                    }
                }
            }
            this.f998j.o(this.F0);
        }
        this.q.i1(this.f994f);
        a0 a0Var2 = this.m0;
        a0Var2.f1015c = a0Var2.f1018f;
        this.I = false;
        this.J = false;
        a0Var2.f1023k = false;
        a0Var2.l = false;
        this.q.f1006h = false;
        ArrayList<d0> arrayList = this.f994f.f1045b;
        if (arrayList != null) {
            arrayList.clear();
        }
        LayoutManager layoutManager = this.q;
        if (layoutManager.n) {
            layoutManager.m = 0;
            layoutManager.n = false;
            this.f994f.K();
        }
        this.q.W0(this.m0);
        G0();
        p1(false);
        this.f998j.f();
        int[] iArr = this.v0;
        if (y(iArr[0], iArr[1])) {
            J(0, 0);
        }
        R0();
        a1();
    }

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

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

    private boolean M0() {
        return this.R != null && this.q.F1();
    }

    private void N0() {
        if (this.I) {
            this.f996h.y();
            if (this.J) {
                this.q.Q0(this);
            }
        }
        if (M0()) {
            this.f996h.w();
        } else {
            this.f996h.j();
        }
        boolean z2 = false;
        boolean z3 = this.p0 || this.q0;
        this.m0.f1023k = this.z && this.R != null && (this.I || z3 || this.q.f1006h) && (!this.I || this.p.hasStableIds());
        a0 a0Var = this.m0;
        if (a0Var.f1023k && z3 && !this.I && M0()) {
            z2 = true;
        }
        a0Var.l = z2;
    }

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

    private void R0() {
        View viewFindViewById;
        if (!this.i0 || this.p == null || !hasFocus() || getDescendantFocusability() == 393216) {
            return;
        }
        if (getDescendantFocusability() == 131072 && isFocused()) {
            return;
        }
        if (!isFocused()) {
            View focusedChild = getFocusedChild();
            if (!M0 || (focusedChild.getParent() != null && focusedChild.hasFocus())) {
                if (!this.f997i.n(focusedChild)) {
                    return;
                }
            } else if (this.f997i.g() == 0) {
                requestFocus();
                return;
            }
        }
        View viewX = null;
        d0 d0VarZ = (this.m0.n == -1 || !this.p.hasStableIds()) ? null : Z(this.m0.n);
        if (d0VarZ != null && !this.f997i.n(d0VarZ.itemView) && d0VarZ.itemView.hasFocusable()) {
            viewX = d0VarZ.itemView;
        } else if (this.f997i.g() > 0) {
            viewX = X();
        }
        if (viewX != null) {
            int i2 = this.m0.o;
            if (i2 != -1 && (viewFindViewById = viewX.findViewById(i2)) != null && viewFindViewById.isFocusable()) {
                viewX = viewFindViewById;
            }
            viewX.requestFocus();
        }
    }

    private void S0() {
        boolean zIsFinished;
        EdgeEffect edgeEffect = this.N;
        if (edgeEffect != null) {
            edgeEffect.onRelease();
            zIsFinished = this.N.isFinished();
        } else {
            zIsFinished = false;
        }
        EdgeEffect edgeEffect2 = this.O;
        if (edgeEffect2 != null) {
            edgeEffect2.onRelease();
            zIsFinished |= this.O.isFinished();
        }
        EdgeEffect edgeEffect3 = this.P;
        if (edgeEffect3 != null) {
            edgeEffect3.onRelease();
            zIsFinished |= this.P.isFinished();
        }
        EdgeEffect edgeEffect4 = this.Q;
        if (edgeEffect4 != null) {
            edgeEffect4.onRelease();
            zIsFinished |= this.Q.isFinished();
        }
        if (zIsFinished) {
            c.f.l.t.Q(this);
        }
    }

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

    private void V(int[] iArr) {
        int iG = this.f997i.g();
        if (iG == 0) {
            iArr[0] = -1;
            iArr[1] = -1;
            return;
        }
        int i2 = Integer.MAX_VALUE;
        int i3 = Integer.MIN_VALUE;
        for (int i4 = 0; i4 < iG; i4++) {
            d0 d0VarF0 = f0(this.f997i.f(i4));
            if (!d0VarF0.shouldIgnore()) {
                int layoutPosition = d0VarF0.getLayoutPosition();
                if (layoutPosition < i2) {
                    i2 = layoutPosition;
                }
                if (layoutPosition > i3) {
                    i3 = layoutPosition;
                }
            }
        }
        iArr[0] = i2;
        iArr[1] = i3;
    }

    static RecyclerView W(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 recyclerViewW = W(viewGroup.getChildAt(i2));
            if (recyclerViewW != null) {
                return recyclerViewW;
            }
        }
        return null;
    }

    private View X() {
        d0 d0VarY;
        int i2 = this.m0.m;
        if (i2 == -1) {
            i2 = 0;
        }
        int iB = this.m0.b();
        for (int i3 = i2; i3 < iB; i3++) {
            d0 d0VarY2 = Y(i3);
            if (d0VarY2 == null) {
                break;
            }
            if (d0VarY2.itemView.hasFocusable()) {
                return d0VarY2.itemView;
            }
        }
        int iMin = Math.min(iB, i2);
        do {
            iMin--;
            if (iMin < 0 || (d0VarY = Y(iMin)) == null) {
                return null;
            }
        } while (!d0VarY.itemView.hasFocusable());
        return d0VarY.itemView;
    }

    private void Z0(View view, View view2) {
        View view3 = view2 != null ? view2 : view;
        this.m.set(0, 0, view3.getWidth(), view3.getHeight());
        ViewGroup.LayoutParams layoutParams = view3.getLayoutParams();
        if (layoutParams instanceof p) {
            p pVar = (p) layoutParams;
            if (!pVar.f1039c) {
                Rect rect = pVar.f1038b;
                Rect rect2 = this.m;
                rect2.left -= rect.left;
                rect2.right += rect.right;
                rect2.top -= rect.top;
                rect2.bottom += rect.bottom;
            }
        }
        if (view2 != null) {
            offsetDescendantRectToMyCoords(view2, this.m);
            offsetRectIntoDescendantCoords(view, this.m);
        }
        this.q.p1(this, view, this.m, !this.z, view2 == null);
    }

    private void a1() {
        a0 a0Var = this.m0;
        a0Var.n = -1L;
        a0Var.m = -1;
        a0Var.o = -1;
    }

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

    private void c1() {
        View focusedChild = (this.i0 && hasFocus() && this.p != null) ? getFocusedChild() : null;
        d0 d0VarT = focusedChild != null ? T(focusedChild) : null;
        if (d0VarT == null) {
            a1();
            return;
        }
        this.m0.n = this.p.hasStableIds() ? d0VarT.getItemId() : -1L;
        this.m0.m = this.I ? -1 : d0VarT.isRemoved() ? d0VarT.mOldPosition : d0VarT.getAbsoluteAdapterPosition();
        this.m0.o = h0(d0VarT.itemView);
    }

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

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

    private void g1(h hVar, boolean z2, boolean z3) {
        h hVar2 = this.p;
        if (hVar2 != null) {
            hVar2.unregisterAdapterDataObserver(this.f993b);
            this.p.onDetachedFromRecyclerView(this);
        }
        if (!z2 || z3) {
            T0();
        }
        this.f996h.y();
        h hVar3 = this.p;
        this.p = hVar;
        if (hVar != null) {
            hVar.registerAdapterDataObserver(this.f993b);
            hVar.onAttachedToRecyclerView(this);
        }
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            layoutManager.C0(hVar3, this.p);
        }
        this.f994f.x(hVar3, this.p, z2);
        this.m0.f1019g = true;
    }

    private c.f.l.l getScrollingChildHelper() {
        if (this.w0 == null) {
            this.w0 = new c.f.l.l(this);
        }
        return this.w0;
    }

    private void h(d0 d0Var) {
        View view = d0Var.itemView;
        boolean z2 = view.getParent() == this;
        this.f994f.J(e0(view));
        if (d0Var.isTmpDetached()) {
            this.f997i.c(view, -1, view.getLayoutParams(), true);
        } else if (z2) {
            this.f997i.k(view);
        } else {
            this.f997i.b(view, true);
        }
    }

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

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

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

    private boolean m0() {
        int iG = this.f997i.g();
        for (int i2 = 0; i2 < iG; i2++) {
            d0 d0VarF0 = f0(this.f997i.f(i2));
            if (d0VarF0 != null && !d0VarF0.shouldIgnore() && d0VarF0.isUpdated()) {
                return true;
            }
        }
        return false;
    }

    private void n(d0 d0Var, d0 d0Var2, m.c cVar, m.c cVar2, boolean z2, boolean z3) {
        d0Var.setIsRecyclable(false);
        if (z2) {
            h(d0Var);
        }
        if (d0Var != d0Var2) {
            if (z3) {
                h(d0Var2);
            }
            d0Var.mShadowedHolder = d0Var2;
            h(d0Var);
            this.f994f.J(d0Var);
            d0Var2.setIsRecyclable(false);
            d0Var2.mShadowingHolder = d0Var;
        }
        if (this.R.b(d0Var, d0Var2, cVar, cVar2)) {
            L0();
        }
    }

    @SuppressLint({"InlinedApi"})
    private void o0() {
        if (c.f.l.t.t(this) == 0) {
            c.f.l.t.f0(this, 8);
        }
    }

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

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

    private void r1() {
        this.j0.f();
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            layoutManager.E1();
        }
    }

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

    private boolean u0(View view, View view2, int i2) {
        int i3;
        if (view2 == null || view2 == this || view2 == view || S(view2) == null) {
            return false;
        }
        if (view == null || S(view) == null) {
            return true;
        }
        this.m.set(0, 0, view.getWidth(), view.getHeight());
        this.n.set(0, 0, view2.getWidth(), view2.getHeight());
        offsetDescendantRectToMyCoords(view, this.m);
        offsetDescendantRectToMyCoords(view2, this.n);
        byte b2 = -1;
        int i4 = this.q.X() == 1 ? -1 : 1;
        Rect rect = this.m;
        int i5 = rect.left;
        int i6 = this.n.left;
        if ((i5 < i6 || rect.right <= i6) && this.m.right < this.n.right) {
            i3 = 1;
        } else {
            Rect rect2 = this.m;
            int i7 = rect2.right;
            int i8 = this.n.right;
            i3 = ((i7 > i8 || rect2.left >= i8) && this.m.left > this.n.left) ? -1 : 0;
        }
        Rect rect3 = this.m;
        int i9 = rect3.top;
        int i10 = this.n.top;
        if ((i9 < i10 || rect3.bottom <= i10) && this.m.bottom < this.n.bottom) {
            b2 = 1;
        } else {
            Rect rect4 = this.m;
            int i11 = rect4.bottom;
            int i12 = this.n.bottom;
            if ((i11 <= i12 && rect4.top < i12) || this.m.top <= this.n.top) {
                b2 = 0;
            }
        }
        if (i2 == 1) {
            return b2 < 0 || (b2 == 0 && i3 * i4 < 0);
        }
        if (i2 == 2) {
            return b2 > 0 || (b2 == 0 && i3 * i4 > 0);
        }
        if (i2 == 17) {
            return i3 < 0;
        }
        if (i2 == 33) {
            return b2 < 0;
        }
        if (i2 == 66) {
            return i3 > 0;
        }
        if (i2 == 130) {
            return b2 > 0;
        }
        throw new IllegalArgumentException("Invalid direction: " + i2 + Q());
    }

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

    private void x0(int i2, int i3, MotionEvent motionEvent, int i4) {
        LayoutManager layoutManager = this.q;
        if (layoutManager == null) {
            Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.C) {
            return;
        }
        int[] iArr = this.z0;
        iArr[0] = 0;
        iArr[1] = 0;
        boolean zJ = layoutManager.j();
        boolean zK = this.q.k();
        int i5 = zJ ? 1 : 0;
        if (zK) {
            i5 |= 2;
        }
        o1(i5, i4);
        if (G(zJ ? i2 : 0, zK ? i3 : 0, this.z0, this.x0, i4)) {
            int[] iArr2 = this.z0;
            i2 -= iArr2[0];
            i3 -= iArr2[1];
        }
        e1(zJ ? i2 : 0, zK ? i3 : 0, motionEvent, i4);
        if (this.k0 != null && (i2 != 0 || i3 != 0)) {
            this.k0.f(this, i2, i3);
        }
        a(i4);
    }

    private boolean y(int i2, int i3) {
        V(this.v0);
        int[] iArr = this.v0;
        return (iArr[0] == i2 && iArr[1] == i3) ? false : true;
    }

    void A(View view) {
        d0 d0VarF0 = f0(view);
        E0(view);
        h hVar = this.p;
        if (hVar != null && d0VarF0 != null) {
            hVar.onViewDetachedFromWindow(d0VarF0);
        }
        List<q> list = this.H;
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                this.H.get(size).b(view);
            }
        }
    }

    void A0(int i2, int i3) {
        int iJ = this.f997i.j();
        for (int i4 = 0; i4 < iJ; i4++) {
            d0 d0VarF0 = f0(this.f997i.i(i4));
            if (d0VarF0 != null && !d0VarF0.shouldIgnore() && d0VarF0.mPosition >= i2) {
                d0VarF0.offsetPosition(i3, false);
                this.m0.f1019g = true;
            }
        }
        this.f994f.u(i2, i3);
        requestLayout();
    }

    void B0(int i2, int i3) {
        int i4;
        int i5;
        int i6;
        int i7;
        int iJ = this.f997i.j();
        if (i2 < i3) {
            i6 = -1;
            i5 = i2;
            i4 = i3;
        } else {
            i4 = i2;
            i5 = i3;
            i6 = 1;
        }
        for (int i8 = 0; i8 < iJ; i8++) {
            d0 d0VarF0 = f0(this.f997i.i(i8));
            if (d0VarF0 != null && (i7 = d0VarF0.mPosition) >= i5 && i7 <= i4) {
                if (i7 == i2) {
                    d0VarF0.offsetPosition(i3 - i2, false);
                } else {
                    d0VarF0.offsetPosition(i6, false);
                }
                this.m0.f1019g = true;
            }
        }
        this.f994f.v(i2, i3);
        requestLayout();
    }

    void C() {
        if (this.p == null) {
            Log.w("RecyclerView", "No adapter attached; skipping layout");
            return;
        }
        if (this.q == null) {
            Log.e("RecyclerView", "No layout manager attached; skipping layout");
            return;
        }
        this.m0.f1022j = false;
        boolean z2 = this.C0 && !(this.D0 == getWidth() && this.E0 == getHeight());
        this.D0 = 0;
        this.E0 = 0;
        this.C0 = false;
        if (this.m0.f1017e == 1) {
            D();
            this.q.v1(this);
            E();
        } else if (this.f996h.q() || z2 || this.q.m0() != getWidth() || this.q.V() != getHeight()) {
            this.q.v1(this);
            E();
        } else {
            this.q.v1(this);
        }
        F();
    }

    void C0(int i2, int i3, boolean z2) {
        int i4 = i2 + i3;
        int iJ = this.f997i.j();
        for (int i5 = 0; i5 < iJ; i5++) {
            d0 d0VarF0 = f0(this.f997i.i(i5));
            if (d0VarF0 != null && !d0VarF0.shouldIgnore()) {
                int i6 = d0VarF0.mPosition;
                if (i6 >= i4) {
                    d0VarF0.offsetPosition(-i3, z2);
                    this.m0.f1019g = true;
                } else if (i6 >= i2) {
                    d0VarF0.flagRemovedAndOffsetPosition(i2 - 1, -i3, z2);
                    this.m0.f1019g = true;
                }
            }
        }
        this.f994f.w(i2, i3, z2);
        requestLayout();
    }

    public void D0(View view) {
    }

    public void E0(View view) {
    }

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

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

    void G0() {
        H0(true);
    }

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

    void H0(boolean z2) {
        int i2 = this.K - 1;
        this.K = i2;
        if (i2 < 1) {
            this.K = 0;
            if (z2) {
                B();
                K();
            }
        }
    }

    void I(int i2) {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            layoutManager.c1(i2);
        }
        J0(i2);
        t tVar = this.n0;
        if (tVar != null) {
            tVar.a(this, i2);
        }
        List<t> list = this.o0;
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                this.o0.get(size).a(this, i2);
            }
        }
    }

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

    public void J0(int i2) {
    }

    void K() {
        int i2;
        for (int size = this.A0.size() - 1; size >= 0; size--) {
            d0 d0Var = this.A0.get(size);
            if (d0Var.itemView.getParent() == this && !d0Var.shouldIgnore() && (i2 = d0Var.mPendingAccessibilityState) != -1) {
                c.f.l.t.e0(d0Var.itemView, i2);
                d0Var.mPendingAccessibilityState = -1;
            }
        }
        this.A0.clear();
    }

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

    void L0() {
        if (this.s0 || !this.w) {
            return;
        }
        c.f.l.t.R(this, this.B0);
        this.s0 = true;
    }

    void M() {
        if (this.Q != null) {
            return;
        }
        EdgeEffect edgeEffectA = this.M.a(this, 3);
        this.Q = edgeEffectA;
        if (this.f999k) {
            edgeEffectA.setSize((getMeasuredWidth() - getPaddingLeft()) - getPaddingRight(), (getMeasuredHeight() - getPaddingTop()) - getPaddingBottom());
        } else {
            edgeEffectA.setSize(getMeasuredWidth(), getMeasuredHeight());
        }
    }

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

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

    void O0(boolean z2) {
        this.J = z2 | this.J;
        this.I = true;
        w0();
    }

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

    String Q() {
        return " " + super.toString() + ", adapter:" + this.p + ", layout:" + this.q + ", context:" + getContext();
    }

    void Q0(d0 d0Var, m.c cVar) {
        d0Var.setFlags(0, InvokeCmd.CMD_TOUCH_CTRL_START);
        if (this.m0.f1021i && d0Var.isUpdated() && !d0Var.isRemoved() && !d0Var.shouldIgnore()) {
            this.f998j.c(d0(d0Var), d0Var);
        }
        this.f998j.e(d0Var, cVar);
    }

    final void R(a0 a0Var) {
        if (getScrollState() != 2) {
            a0Var.p = 0;
            a0Var.q = 0;
        } else {
            OverScroller overScroller = this.j0.f1027g;
            a0Var.p = overScroller.getFinalX() - overScroller.getCurrX();
            a0Var.q = overScroller.getFinalY() - overScroller.getCurrY();
        }
    }

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

    public d0 T(View view) {
        View viewS = S(view);
        if (viewS == null) {
            return null;
        }
        return e0(viewS);
    }

    void T0() {
        m mVar = this.R;
        if (mVar != null) {
            mVar.k();
        }
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            layoutManager.h1(this.f994f);
            this.q.i1(this.f994f);
        }
        this.f994f.c();
    }

    boolean U0(View view) {
        n1();
        boolean zR = this.f997i.r(view);
        if (zR) {
            d0 d0VarF0 = f0(view);
            this.f994f.J(d0VarF0);
            this.f994f.C(d0VarF0);
        }
        p1(!zR);
        return zR;
    }

    public void V0(o oVar) {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            layoutManager.f("Cannot remove item decoration during a scroll  or layout");
        }
        this.t.remove(oVar);
        if (this.t.isEmpty()) {
            setWillNotDraw(getOverScrollMode() == 2);
        }
        v0();
        requestLayout();
    }

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

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

    public d0 Y(int i2) {
        d0 d0Var = null;
        if (this.I) {
            return null;
        }
        int iJ = this.f997i.j();
        for (int i3 = 0; i3 < iJ; i3++) {
            d0 d0VarF0 = f0(this.f997i.i(i3));
            if (d0VarF0 != null && !d0VarF0.isRemoved() && c0(d0VarF0) == i2) {
                if (!this.f997i.n(d0VarF0.itemView)) {
                    return d0VarF0;
                }
                d0Var = d0VarF0;
            }
        }
        return d0Var;
    }

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

    public d0 Z(long j2) {
        h hVar = this.p;
        d0 d0Var = null;
        if (hVar != null && hVar.hasStableIds()) {
            int iJ = this.f997i.j();
            for (int i2 = 0; i2 < iJ; i2++) {
                d0 d0VarF0 = f0(this.f997i.i(i2));
                if (d0VarF0 != null && !d0VarF0.isRemoved() && d0VarF0.getItemId() == j2) {
                    if (!this.f997i.n(d0VarF0.itemView)) {
                        return d0VarF0;
                    }
                    d0Var = d0VarF0;
                }
            }
        }
        return d0Var;
    }

    @Override // c.f.l.j
    public void a(int i2) {
        getScrollingChildHelper().r(i2);
    }

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

    @Override // android.view.ViewGroup, android.view.View
    public void addFocusables(ArrayList<View> arrayList, int i2, int i3) {
        LayoutManager layoutManager = this.q;
        if (layoutManager == null || !layoutManager.D0(this, arrayList, i2, i3)) {
            super.addFocusables(arrayList, i2, i3);
        }
    }

    public boolean b0(int i2, int i3) {
        LayoutManager layoutManager = this.q;
        if (layoutManager == null) {
            Log.e("RecyclerView", "Cannot fling without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return false;
        }
        if (this.C) {
            return false;
        }
        boolean zJ = layoutManager.j();
        boolean zK = this.q.k();
        if (!zJ || Math.abs(i2) < this.e0) {
            i2 = 0;
        }
        if (!zK || Math.abs(i3) < this.e0) {
            i3 = 0;
        }
        if (i2 == 0 && i3 == 0) {
            return false;
        }
        float f2 = i2;
        float f3 = i3;
        if (!dispatchNestedPreFling(f2, f3)) {
            boolean z2 = zJ || zK;
            dispatchNestedFling(f2, f3, z2);
            r rVar = this.d0;
            if (rVar != null && rVar.a(i2, i3)) {
                return true;
            }
            if (z2) {
                int i4 = zJ ? 1 : 0;
                if (zK) {
                    i4 |= 2;
                }
                o1(i4, 1);
                int i5 = this.f0;
                int iMax = Math.max(-i5, Math.min(i2, i5));
                int i6 = this.f0;
                this.j0.b(iMax, Math.max(-i6, Math.min(i3, i6)));
                return true;
            }
        }
        return false;
    }

    void c(int i2, int i3) {
        if (i2 < 0) {
            N();
            if (this.N.isFinished()) {
                this.N.onAbsorb(-i2);
            }
        } else if (i2 > 0) {
            O();
            if (this.P.isFinished()) {
                this.P.onAbsorb(i2);
            }
        }
        if (i3 < 0) {
            P();
            if (this.O.isFinished()) {
                this.O.onAbsorb(-i3);
            }
        } else if (i3 > 0) {
            M();
            if (this.Q.isFinished()) {
                this.Q.onAbsorb(i3);
            }
        }
        if (i2 == 0 && i3 == 0) {
            return;
        }
        c.f.l.t.Q(this);
    }

    int c0(d0 d0Var) {
        if (d0Var.hasAnyOfTheFlags(524) || !d0Var.isBound()) {
            return -1;
        }
        return this.f996h.e(d0Var.mPosition);
    }

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

    @Override // android.view.View
    public int computeHorizontalScrollExtent() {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null && layoutManager.j()) {
            return this.q.p(this.m0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeHorizontalScrollOffset() {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null && layoutManager.j()) {
            return this.q.q(this.m0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeHorizontalScrollRange() {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null && layoutManager.j()) {
            return this.q.r(this.m0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollExtent() {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null && layoutManager.k()) {
            return this.q.s(this.m0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollOffset() {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null && layoutManager.k()) {
            return this.q.t(this.m0);
        }
        return 0;
    }

    @Override // android.view.View
    public int computeVerticalScrollRange() {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null && layoutManager.k()) {
            return this.q.u(this.m0);
        }
        return 0;
    }

    long d0(d0 d0Var) {
        return this.p.hasStableIds() ? d0Var.getItemId() : d0Var.mPosition;
    }

    void d1() {
        int iJ = this.f997i.j();
        for (int i2 = 0; i2 < iJ; i2++) {
            d0 d0VarF0 = f0(this.f997i.i(i2));
            if (!d0VarF0.shouldIgnore()) {
                d0VarF0.saveOldPosition();
            }
        }
    }

    @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);
    }

    @Override // android.view.View
    public boolean dispatchNestedScroll(int i2, int i3, int i4, int i5, int[] iArr) {
        return getScrollingChildHelper().f(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
    protected void dispatchRestoreInstanceState(SparseArray<Parcelable> sparseArray) {
        dispatchThawSelfOnly(sparseArray);
    }

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

    @Override // android.view.View
    public void draw(Canvas canvas) {
        boolean z2;
        super.draw(canvas);
        int size = this.t.size();
        boolean z3 = false;
        for (int i2 = 0; i2 < size; i2++) {
            this.t.get(i2).onDrawOver(canvas, this, this.m0);
        }
        EdgeEffect edgeEffect = this.N;
        if (edgeEffect == null || edgeEffect.isFinished()) {
            z2 = false;
        } else {
            int iSave = canvas.save();
            int paddingBottom = this.f999k ? getPaddingBottom() : 0;
            canvas.rotate(270.0f);
            canvas.translate((-getHeight()) + paddingBottom, 0.0f);
            EdgeEffect edgeEffect2 = this.N;
            z2 = edgeEffect2 != null && edgeEffect2.draw(canvas);
            canvas.restoreToCount(iSave);
        }
        EdgeEffect edgeEffect3 = this.O;
        if (edgeEffect3 != null && !edgeEffect3.isFinished()) {
            int iSave2 = canvas.save();
            if (this.f999k) {
                canvas.translate(getPaddingLeft(), getPaddingTop());
            }
            EdgeEffect edgeEffect4 = this.O;
            z2 |= edgeEffect4 != null && edgeEffect4.draw(canvas);
            canvas.restoreToCount(iSave2);
        }
        EdgeEffect edgeEffect5 = this.P;
        if (edgeEffect5 != null && !edgeEffect5.isFinished()) {
            int iSave3 = canvas.save();
            int width = getWidth();
            int paddingTop = this.f999k ? getPaddingTop() : 0;
            canvas.rotate(90.0f);
            canvas.translate(paddingTop, -width);
            EdgeEffect edgeEffect6 = this.P;
            z2 |= edgeEffect6 != null && edgeEffect6.draw(canvas);
            canvas.restoreToCount(iSave3);
        }
        EdgeEffect edgeEffect7 = this.Q;
        if (edgeEffect7 != null && !edgeEffect7.isFinished()) {
            int iSave4 = canvas.save();
            canvas.rotate(180.0f);
            if (this.f999k) {
                canvas.translate((-getWidth()) + getPaddingRight(), (-getHeight()) + getPaddingBottom());
            } else {
                canvas.translate(-getWidth(), -getHeight());
            }
            EdgeEffect edgeEffect8 = this.Q;
            if (edgeEffect8 != null && edgeEffect8.draw(canvas)) {
                z3 = true;
            }
            z2 |= z3;
            canvas.restoreToCount(iSave4);
        }
        if ((z2 || this.R == null || this.t.size() <= 0 || !this.R.p()) ? z2 : true) {
            c.f.l.t.Q(this);
        }
    }

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

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

    boolean e1(int i2, int i3, MotionEvent motionEvent, int i4) {
        int i5;
        int i6;
        int i7;
        int i8;
        v();
        if (this.p != null) {
            int[] iArr = this.z0;
            iArr[0] = 0;
            iArr[1] = 0;
            f1(i2, i3, iArr);
            int[] iArr2 = this.z0;
            int i9 = iArr2[0];
            int i10 = iArr2[1];
            i5 = i10;
            i6 = i9;
            i7 = i2 - i9;
            i8 = i3 - i10;
        } else {
            i5 = 0;
            i6 = 0;
            i7 = 0;
            i8 = 0;
        }
        if (!this.t.isEmpty()) {
            invalidate();
        }
        int[] iArr3 = this.z0;
        iArr3[0] = 0;
        iArr3[1] = 0;
        H(i6, i5, i7, i8, this.x0, i4, iArr3);
        int[] iArr4 = this.z0;
        int i11 = i7 - iArr4[0];
        int i12 = i8 - iArr4[1];
        boolean z2 = (iArr4[0] == 0 && iArr4[1] == 0) ? false : true;
        int i13 = this.a0;
        int[] iArr5 = this.x0;
        this.a0 = i13 - iArr5[0];
        this.b0 -= iArr5[1];
        int[] iArr6 = this.y0;
        iArr6[0] = iArr6[0] + iArr5[0];
        iArr6[1] = iArr6[1] + iArr5[1];
        if (getOverScrollMode() != 2) {
            if (motionEvent != null && !c.f.l.i.a(motionEvent, InvokeCmd.CMD_TOUCH_GET_MOUSE_FADE_STATE)) {
                P0(motionEvent.getX(), i11, motionEvent.getY(), i12);
            }
            u(i2, i3);
        }
        if (i6 != 0 || i5 != 0) {
            J(i6, i5);
        }
        if (!awakenScrollBars()) {
            invalidate();
        }
        return (!z2 && i6 == 0 && i5 == 0) ? false : true;
    }

    void f1(int i2, int i3, int[] iArr) {
        n1();
        F0();
        c.f.h.b.a("RV Scroll");
        R(this.m0);
        int iT1 = i2 != 0 ? this.q.t1(i2, this.f994f, this.m0) : 0;
        int iU1 = i3 != 0 ? this.q.u1(i3, this.f994f, this.m0) : 0;
        c.f.h.b.b();
        Y0();
        G0();
        p1(false);
        if (iArr != null) {
            iArr[0] = iT1;
            iArr[1] = iU1;
        }
    }

    @Override // android.view.ViewGroup, android.view.ViewParent
    public View focusSearch(View view, int i2) {
        View viewH0;
        boolean z2;
        View viewO0 = this.q.O0(view, i2);
        if (viewO0 != null) {
            return viewO0;
        }
        boolean z3 = (this.p == null || this.q == null || t0() || this.C) ? false : true;
        FocusFinder focusFinder = FocusFinder.getInstance();
        if (z3 && (i2 == 2 || i2 == 1)) {
            if (this.q.k()) {
                int i3 = i2 == 2 ? ICmdMsg.ACTION_WRITE_USER_NFC_CARD : 33;
                z2 = focusFinder.findNextFocus(this, view, i3) == null;
                if (L0) {
                    i2 = i3;
                }
            } else {
                z2 = false;
            }
            if (!z2 && this.q.j()) {
                int i4 = (this.q.X() == 1) ^ (i2 == 2) ? 66 : 17;
                boolean z4 = focusFinder.findNextFocus(this, view, i4) == null;
                if (L0) {
                    i2 = i4;
                }
                z2 = z4;
            }
            if (z2) {
                v();
                if (S(view) == null) {
                    return null;
                }
                n1();
                this.q.H0(view, i2, this.f994f, this.m0);
                p1(false);
            }
            viewH0 = focusFinder.findNextFocus(this, view, i2);
        } else {
            View viewFindNextFocus = focusFinder.findNextFocus(this, view, i2);
            if (viewFindNextFocus == null && z3) {
                v();
                if (S(view) == null) {
                    return null;
                }
                n1();
                viewH0 = this.q.H0(view, i2, this.f994f, this.m0);
                p1(false);
            } else {
                viewH0 = viewFindNextFocus;
            }
        }
        if (viewH0 == null || viewH0.hasFocusable()) {
            return u0(view, viewH0, i2) ? viewH0 : super.focusSearch(view, i2);
        }
        if (getFocusedChild() == null) {
            return super.focusSearch(view, i2);
        }
        Z0(viewH0, null);
        return view;
    }

    @Override // android.view.ViewGroup
    protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            return layoutManager.C();
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + Q());
    }

    @Override // android.view.ViewGroup
    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            return layoutManager.D(getContext(), attributeSet);
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + Q());
    }

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

    public h getAdapter() {
        return this.p;
    }

    @Override // android.view.View
    public int getBaseline() {
        LayoutManager layoutManager = this.q;
        return layoutManager != null ? layoutManager.F() : super.getBaseline();
    }

    @Override // android.view.ViewGroup
    protected int getChildDrawingOrder(int i2, int i3) {
        k kVar = this.u0;
        return kVar == null ? super.getChildDrawingOrder(i2, i3) : kVar.a(i2, i3);
    }

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

    public androidx.recyclerview.widget.i getCompatAccessibilityDelegate() {
        return this.t0;
    }

    public l getEdgeEffectFactory() {
        return this.M;
    }

    public m getItemAnimator() {
        return this.R;
    }

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

    public LayoutManager getLayoutManager() {
        return this.q;
    }

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

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

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

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

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

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

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

    boolean h1(d0 d0Var, int i2) {
        if (!t0()) {
            c.f.l.t.e0(d0Var.itemView, i2);
            return true;
        }
        d0Var.mPendingAccessibilityState = i2;
        this.A0.add(d0Var);
        return false;
    }

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

    public void i(o oVar) {
        j(oVar, -1);
    }

    boolean i1(AccessibilityEvent accessibilityEvent) {
        if (!t0()) {
            return false;
        }
        int iA = accessibilityEvent != null ? c.f.l.c0.b.a(accessibilityEvent) : 0;
        this.E |= iA != 0 ? iA : 0;
        return true;
    }

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

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

    @Override // android.view.View, c.f.l.k
    public boolean isNestedScrollingEnabled() {
        return getScrollingChildHelper().l();
    }

    public void j(o oVar, int i2) {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            layoutManager.f("Cannot add item decoration during a scroll  or layout");
        }
        if (this.t.isEmpty()) {
            setWillNotDraw(false);
        }
        if (i2 < 0) {
            this.t.add(oVar);
        } else {
            this.t.add(i2, oVar);
        }
        v0();
        requestLayout();
    }

    Rect j0(View view) {
        p pVar = (p) view.getLayoutParams();
        if (!pVar.f1039c) {
            return pVar.f1038b;
        }
        if (this.m0.e() && (pVar.b() || pVar.d())) {
            return pVar.f1038b;
        }
        Rect rect = pVar.f1038b;
        rect.set(0, 0, 0, 0);
        int size = this.t.size();
        for (int i2 = 0; i2 < size; i2++) {
            this.m.set(0, 0, 0, 0);
            this.t.get(i2).getItemOffsets(this.m, view, this, this.m0);
            int i3 = rect.left;
            Rect rect2 = this.m;
            rect.left = i3 + rect2.left;
            rect.top += rect2.top;
            rect.right += rect2.right;
            rect.bottom += rect2.bottom;
        }
        pVar.f1039c = false;
        return rect;
    }

    public void j1(int i2, int i3) {
        k1(i2, i3, null);
    }

    public void k(s sVar) {
        this.u.add(sVar);
    }

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

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

    public boolean l0() {
        return !this.z || this.I || this.f996h.p();
    }

    public void l1(int i2, int i3, Interpolator interpolator, int i4) {
        m1(i2, i3, interpolator, i4, false);
    }

    void m(d0 d0Var, m.c cVar, m.c cVar2) {
        d0Var.setIsRecyclable(false);
        if (this.R.a(d0Var, cVar, cVar2)) {
            L0();
        }
    }

    void m1(int i2, int i3, Interpolator interpolator, int i4, boolean z2) {
        LayoutManager layoutManager = this.q;
        if (layoutManager == null) {
            Log.e("RecyclerView", "Cannot smooth scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.C) {
            return;
        }
        if (!layoutManager.j()) {
            i2 = 0;
        }
        if (!this.q.k()) {
            i3 = 0;
        }
        if (i2 == 0 && i3 == 0) {
            return;
        }
        if (!(i4 == Integer.MIN_VALUE || i4 > 0)) {
            scrollBy(i2, i3);
            return;
        }
        if (z2) {
            int i5 = i2 != 0 ? 1 : 0;
            if (i3 != 0) {
                i5 |= 2;
            }
            o1(i5, 1);
        }
        this.j0.e(i2, i3, i4, interpolator);
    }

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

    void n1() {
        int i2 = this.A + 1;
        this.A = i2;
        if (i2 != 1 || this.C) {
            return;
        }
        this.B = false;
    }

    void o(d0 d0Var, m.c cVar, m.c cVar2) {
        h(d0Var);
        d0Var.setIsRecyclable(false);
        if (this.R.c(d0Var, cVar, cVar2)) {
            L0();
        }
    }

    public boolean o1(int i2, int i3) {
        return getScrollingChildHelper().p(i2, i3);
    }

    @Override // android.view.ViewGroup, android.view.View
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        this.K = 0;
        this.w = true;
        this.z = this.z && !isLayoutRequested();
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            layoutManager.y(this);
        }
        this.s0 = false;
        if (K0) {
            androidx.recyclerview.widget.e eVar = androidx.recyclerview.widget.e.f1141i.get();
            this.k0 = eVar;
            if (eVar == null) {
                this.k0 = new androidx.recyclerview.widget.e();
                Display displayO = c.f.l.t.o(this);
                float f2 = 60.0f;
                if (!isInEditMode() && displayO != null) {
                    float refreshRate = displayO.getRefreshRate();
                    if (refreshRate >= 30.0f) {
                        f2 = refreshRate;
                    }
                }
                androidx.recyclerview.widget.e eVar2 = this.k0;
                eVar2.f1145g = (long) (1.0E9f / f2);
                androidx.recyclerview.widget.e.f1141i.set(eVar2);
            }
            this.k0.a(this);
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    protected void onDetachedFromWindow() {
        androidx.recyclerview.widget.e eVar;
        super.onDetachedFromWindow();
        m mVar = this.R;
        if (mVar != null) {
            mVar.k();
        }
        q1();
        this.w = false;
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            layoutManager.z(this, this.f994f);
        }
        this.A0.clear();
        removeCallbacks(this.B0);
        this.f998j.j();
        if (!K0 || (eVar = this.k0) == null) {
            return;
        }
        eVar.j(this);
        this.k0 = null;
    }

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

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

    @Override // android.view.ViewGroup
    public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
        boolean z2;
        if (this.C) {
            return false;
        }
        this.v = null;
        if (U(motionEvent)) {
            r();
            return true;
        }
        LayoutManager layoutManager = this.q;
        if (layoutManager == null) {
            return false;
        }
        boolean zJ = layoutManager.j();
        boolean zK = this.q.k();
        if (this.U == null) {
            this.U = VelocityTracker.obtain();
        }
        this.U.addMovement(motionEvent);
        int actionMasked = motionEvent.getActionMasked();
        int actionIndex = motionEvent.getActionIndex();
        if (actionMasked == 0) {
            if (this.D) {
                this.D = false;
            }
            this.T = motionEvent.getPointerId(0);
            int x2 = (int) (motionEvent.getX() + 0.5f);
            this.a0 = x2;
            this.V = x2;
            int y2 = (int) (motionEvent.getY() + 0.5f);
            this.b0 = y2;
            this.W = y2;
            if (this.S == 2) {
                getParent().requestDisallowInterceptTouchEvent(true);
                setScrollState(1);
                a(1);
            }
            int[] iArr = this.y0;
            iArr[1] = 0;
            iArr[0] = 0;
            int i2 = zJ ? 1 : 0;
            if (zK) {
                i2 |= 2;
            }
            o1(i2, 0);
        } else if (actionMasked == 1) {
            this.U.clear();
            a(0);
        } else if (actionMasked == 2) {
            int iFindPointerIndex = motionEvent.findPointerIndex(this.T);
            if (iFindPointerIndex < 0) {
                Log.e("RecyclerView", "Error processing scroll; pointer index for id " + this.T + " not found. Did any MotionEvents get skipped?");
                return false;
            }
            int x3 = (int) (motionEvent.getX(iFindPointerIndex) + 0.5f);
            int y3 = (int) (motionEvent.getY(iFindPointerIndex) + 0.5f);
            if (this.S != 1) {
                int i3 = x3 - this.V;
                int i4 = y3 - this.W;
                if (!zJ || Math.abs(i3) <= this.c0) {
                    z2 = false;
                } else {
                    this.a0 = x3;
                    z2 = true;
                }
                if (zK && Math.abs(i4) > this.c0) {
                    this.b0 = y3;
                    z2 = true;
                }
                if (z2) {
                    setScrollState(1);
                }
            }
        } else if (actionMasked == 3) {
            r();
        } else if (actionMasked == 5) {
            this.T = motionEvent.getPointerId(actionIndex);
            int x4 = (int) (motionEvent.getX(actionIndex) + 0.5f);
            this.a0 = x4;
            this.V = x4;
            int y4 = (int) (motionEvent.getY(actionIndex) + 0.5f);
            this.b0 = y4;
            this.W = y4;
        } else if (actionMasked == 6) {
            I0(motionEvent);
        }
        return this.S == 1;
    }

    @Override // android.view.ViewGroup, android.view.View
    protected void onLayout(boolean z2, int i2, int i3, int i4, int i5) {
        c.f.h.b.a("RV OnLayout");
        C();
        c.f.h.b.b();
        this.z = true;
    }

    @Override // android.view.View
    protected void onMeasure(int i2, int i3) {
        LayoutManager layoutManager = this.q;
        if (layoutManager == null) {
            x(i2, i3);
            return;
        }
        boolean z2 = false;
        if (layoutManager.q0()) {
            int mode = View.MeasureSpec.getMode(i2);
            int mode2 = View.MeasureSpec.getMode(i3);
            this.q.X0(this.f994f, this.m0, i2, i3);
            if (mode == 1073741824 && mode2 == 1073741824) {
                z2 = true;
            }
            this.C0 = z2;
            if (z2 || this.p == null) {
                return;
            }
            if (this.m0.f1017e == 1) {
                D();
            }
            this.q.w1(i2, i3);
            this.m0.f1022j = true;
            E();
            this.q.z1(i2, i3);
            if (this.q.C1()) {
                this.q.w1(View.MeasureSpec.makeMeasureSpec(getMeasuredWidth(), Pow2.MAX_POW2), View.MeasureSpec.makeMeasureSpec(getMeasuredHeight(), Pow2.MAX_POW2));
                this.m0.f1022j = true;
                E();
                this.q.z1(i2, i3);
            }
            this.D0 = getMeasuredWidth();
            this.E0 = getMeasuredHeight();
            return;
        }
        if (this.x) {
            this.q.X0(this.f994f, this.m0, i2, i3);
            return;
        }
        if (this.F) {
            n1();
            F0();
            N0();
            G0();
            a0 a0Var = this.m0;
            if (a0Var.l) {
                a0Var.f1020h = true;
            } else {
                this.f996h.j();
                this.m0.f1020h = false;
            }
            this.F = false;
            p1(false);
        } else if (this.m0.l) {
            setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight());
            return;
        }
        h hVar = this.p;
        if (hVar != null) {
            this.m0.f1018f = hVar.getItemCount();
        } else {
            this.m0.f1018f = 0;
        }
        n1();
        this.q.X0(this.f994f, this.m0, i2, i3);
        p1(false);
        this.m0.f1020h = false;
    }

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

    @Override // android.view.View
    protected void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof y)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        y yVar = (y) parcelable;
        this.f995g = yVar;
        super.onRestoreInstanceState(yVar.a());
        requestLayout();
    }

    @Override // android.view.View
    protected Parcelable onSaveInstanceState() {
        y yVar = new y(super.onSaveInstanceState());
        y yVar2 = this.f995g;
        if (yVar2 != null) {
            yVar.b(yVar2);
        } else {
            LayoutManager layoutManager = this.q;
            if (layoutManager != null) {
                yVar.f1053g = layoutManager.b1();
            } else {
                yVar.f1053g = null;
            }
        }
        return yVar;
    }

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

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

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

    void p1(boolean z2) {
        if (this.A < 1) {
            this.A = 1;
        }
        if (!z2 && !this.C) {
            this.B = false;
        }
        if (this.A == 1) {
            if (z2 && this.B && !this.C && this.q != null && this.p != null) {
                C();
            }
            if (!this.C) {
                this.B = false;
            }
        }
        this.A--;
    }

    boolean q(d0 d0Var) {
        m mVar = this.R;
        return mVar == null || mVar.g(d0Var, d0Var.getUnmodifiedPayloads());
    }

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

    public void q1() {
        setScrollState(0);
        r1();
    }

    void r0() {
        this.Q = null;
        this.O = null;
        this.P = null;
        this.N = null;
    }

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

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

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

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

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

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

    void s1(int i2, int i3, Object obj) {
        int i4;
        int iJ = this.f997i.j();
        int i5 = i2 + i3;
        for (int i6 = 0; i6 < iJ; i6++) {
            View viewI = this.f997i.i(i6);
            d0 d0VarF0 = f0(viewI);
            if (d0VarF0 != null && !d0VarF0.shouldIgnore() && (i4 = d0VarF0.mPosition) >= i2 && i4 < i5) {
                d0VarF0.addFlags(2);
                d0VarF0.addChangePayload(obj);
                ((p) viewI.getLayoutParams()).f1039c = true;
            }
        }
        this.f994f.M(i2, i3);
    }

    @Override // android.view.View
    public void scrollBy(int i2, int i3) {
        LayoutManager layoutManager = this.q;
        if (layoutManager == null) {
            Log.e("RecyclerView", "Cannot scroll without a LayoutManager set. Call setLayoutManager with a non-null argument.");
            return;
        }
        if (this.C) {
            return;
        }
        boolean zJ = layoutManager.j();
        boolean zK = this.q.k();
        if (zJ || zK) {
            if (!zJ) {
                i2 = 0;
            }
            if (!zK) {
                i3 = 0;
            }
            e1(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 (i1(accessibilityEvent)) {
            return;
        }
        super.sendAccessibilityEventUnchecked(accessibilityEvent);
    }

    public void setAccessibilityDelegateCompat(androidx.recyclerview.widget.i iVar) {
        this.t0 = iVar;
        c.f.l.t.W(this, iVar);
    }

    public void setAdapter(h hVar) {
        setLayoutFrozen(false);
        g1(hVar, false, true);
        O0(false);
        requestLayout();
    }

    public void setChildDrawingOrderCallback(k kVar) {
        if (kVar == this.u0) {
            return;
        }
        this.u0 = kVar;
        setChildrenDrawingOrderEnabled(kVar != null);
    }

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

    public void setEdgeEffectFactory(l lVar) {
        c.f.k.f.b(lVar);
        this.M = lVar;
        r0();
    }

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

    public void setItemAnimator(m mVar) {
        m mVar2 = this.R;
        if (mVar2 != null) {
            mVar2.k();
            this.R.w(null);
        }
        this.R = mVar;
        if (mVar != null) {
            mVar.w(this.r0);
        }
    }

    public void setItemViewCacheSize(int i2) {
        this.f994f.G(i2);
    }

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

    public void setLayoutManager(LayoutManager layoutManager) {
        if (layoutManager == this.q) {
            return;
        }
        q1();
        if (this.q != null) {
            m mVar = this.R;
            if (mVar != null) {
                mVar.k();
            }
            this.q.h1(this.f994f);
            this.q.i1(this.f994f);
            this.f994f.c();
            if (this.w) {
                this.q.z(this, this.f994f);
            }
            this.q.A1(null);
            this.q = null;
        } else {
            this.f994f.c();
        }
        this.f997i.o();
        this.q = layoutManager;
        if (layoutManager != null) {
            if (layoutManager.f1000b != null) {
                throw new IllegalArgumentException("LayoutManager " + layoutManager + " is already attached to a RecyclerView:" + layoutManager.f1000b.Q());
            }
            layoutManager.A1(this);
            if (this.w) {
                this.q.y(this);
            }
        }
        this.f994f.K();
        requestLayout();
    }

    @Override // android.view.ViewGroup
    @Deprecated
    public void setLayoutTransition(LayoutTransition layoutTransition) {
        if (Build.VERSION.SDK_INT < 18) {
            if (layoutTransition == null) {
                suppressLayout(false);
                return;
            } else if (layoutTransition.getAnimator(0) == null && layoutTransition.getAnimator(1) == null && layoutTransition.getAnimator(2) == null && layoutTransition.getAnimator(3) == null && layoutTransition.getAnimator(4) == null) {
                suppressLayout(true);
                return;
            }
        }
        if (layoutTransition != null) {
            throw new IllegalArgumentException("Providing a LayoutTransition into RecyclerView is not supported. Please use setItemAnimator() instead for animating changes to the items in this RecyclerView");
        }
        super.setLayoutTransition(null);
    }

    @Override // android.view.View
    public void setNestedScrollingEnabled(boolean z2) {
        getScrollingChildHelper().m(z2);
    }

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

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

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

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

    @Deprecated
    public void setRecyclerListener(w wVar) {
        this.r = wVar;
    }

    void setScrollState(int i2) {
        if (i2 == this.S) {
            return;
        }
        this.S = i2;
        if (i2 != 2) {
            r1();
        }
        I(i2);
    }

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

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

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

    @Override // android.view.View, c.f.l.k
    public void stopNestedScroll() {
        getScrollingChildHelper().q();
    }

    @Override // android.view.ViewGroup
    public final void suppressLayout(boolean z2) {
        if (z2 != this.C) {
            p("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.C = true;
                this.D = true;
                q1();
                return;
            }
            this.C = false;
            if (this.B && this.q != null && this.p != null) {
                requestLayout();
            }
            this.B = false;
        }
    }

    void t() {
        int iJ = this.f997i.j();
        for (int i2 = 0; i2 < iJ; i2++) {
            d0 d0VarF0 = f0(this.f997i.i(i2));
            if (!d0VarF0.shouldIgnore()) {
                d0VarF0.clearOldPosition();
            }
        }
        this.f994f.d();
    }

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

    void u(int i2, int i3) {
        boolean zIsFinished;
        EdgeEffect edgeEffect = this.N;
        if (edgeEffect == null || edgeEffect.isFinished() || i2 <= 0) {
            zIsFinished = false;
        } else {
            this.N.onRelease();
            zIsFinished = this.N.isFinished();
        }
        EdgeEffect edgeEffect2 = this.P;
        if (edgeEffect2 != null && !edgeEffect2.isFinished() && i2 < 0) {
            this.P.onRelease();
            zIsFinished |= this.P.isFinished();
        }
        EdgeEffect edgeEffect3 = this.O;
        if (edgeEffect3 != null && !edgeEffect3.isFinished() && i3 > 0) {
            this.O.onRelease();
            zIsFinished |= this.O.isFinished();
        }
        EdgeEffect edgeEffect4 = this.Q;
        if (edgeEffect4 != null && !edgeEffect4.isFinished() && i3 < 0) {
            this.Q.onRelease();
            zIsFinished |= this.Q.isFinished();
        }
        if (zIsFinished) {
            c.f.l.t.Q(this);
        }
    }

    void v() {
        if (!this.z || this.I) {
            c.f.h.b.a("RV FullInvalidate");
            C();
            c.f.h.b.b();
            return;
        }
        if (this.f996h.p()) {
            if (!this.f996h.o(4) || this.f996h.o(11)) {
                if (this.f996h.p()) {
                    c.f.h.b.a("RV FullInvalidate");
                    C();
                    c.f.h.b.b();
                    return;
                }
                return;
            }
            c.f.h.b.a("RV PartialInvalidate");
            n1();
            F0();
            this.f996h.w();
            if (!this.B) {
                if (m0()) {
                    C();
                } else {
                    this.f996h.i();
                }
            }
            p1(true);
            G0();
            c.f.h.b.b();
        }
    }

    void v0() {
        int iJ = this.f997i.j();
        for (int i2 = 0; i2 < iJ; i2++) {
            ((p) this.f997i.i(i2).getLayoutParams()).f1039c = true;
        }
        this.f994f.s();
    }

    void w0() {
        int iJ = this.f997i.j();
        for (int i2 = 0; i2 < iJ; i2++) {
            d0 d0VarF0 = f0(this.f997i.i(i2));
            if (d0VarF0 != null && !d0VarF0.shouldIgnore()) {
                d0VarF0.addFlags(6);
            }
        }
        v0();
        this.f994f.t();
    }

    void x(int i2, int i3) {
        setMeasuredDimension(LayoutManager.m(i2, getPaddingLeft() + getPaddingRight(), c.f.l.t.w(this)), LayoutManager.m(i3, getPaddingTop() + getPaddingBottom(), c.f.l.t.v(this)));
    }

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

    void z(View view) {
        d0 d0VarF0 = f0(view);
        D0(view);
        h hVar = this.p;
        if (hVar != null && d0VarF0 != null) {
            hVar.onViewAttachedToWindow(d0VarF0);
        }
        List<q> list = this.H;
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                this.H.get(size).a(view);
            }
        }
    }

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

    public RecyclerView(Context context, AttributeSet attributeSet, int i2) {
        super(context, attributeSet, i2);
        this.f993b = new x();
        this.f994f = new v();
        this.f998j = new androidx.recyclerview.widget.m();
        this.l = new a();
        this.m = new Rect();
        this.n = new Rect();
        this.o = new RectF();
        this.s = new ArrayList();
        this.t = new ArrayList<>();
        this.u = new ArrayList<>();
        this.A = 0;
        this.I = false;
        this.J = false;
        this.K = 0;
        this.L = 0;
        this.M = new l();
        this.R = new androidx.recyclerview.widget.c();
        this.S = 0;
        this.T = -1;
        this.g0 = Float.MIN_VALUE;
        this.h0 = Float.MIN_VALUE;
        boolean z2 = true;
        this.i0 = true;
        this.j0 = new c0();
        this.l0 = K0 ? new e.b() : null;
        this.m0 = new a0();
        this.p0 = false;
        this.q0 = false;
        this.r0 = new n();
        this.s0 = false;
        this.v0 = new int[2];
        this.x0 = new int[2];
        this.y0 = new int[2];
        this.z0 = new int[2];
        this.A0 = new ArrayList();
        this.B0 = new b();
        this.D0 = 0;
        this.E0 = 0;
        this.F0 = new d();
        setScrollContainer(true);
        setFocusableInTouchMode(true);
        ViewConfiguration viewConfiguration = ViewConfiguration.get(context);
        this.c0 = viewConfiguration.getScaledTouchSlop();
        this.g0 = c.f.l.u.b(viewConfiguration, context);
        this.h0 = c.f.l.u.d(viewConfiguration, context);
        this.e0 = viewConfiguration.getScaledMinimumFlingVelocity();
        this.f0 = viewConfiguration.getScaledMaximumFlingVelocity();
        setWillNotDraw(getOverScrollMode() == 2);
        this.R.w(this.r0);
        n0();
        p0();
        o0();
        if (c.f.l.t.s(this) == 0) {
            c.f.l.t.e0(this, 1);
        }
        this.G = (AccessibilityManager) getContext().getSystemService("accessibility");
        setAccessibilityDelegateCompat(new androidx.recyclerview.widget.i(this));
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, c.l.c.RecyclerView, i2, 0);
        c.f.l.t.U(this, context, c.l.c.RecyclerView, attributeSet, typedArrayObtainStyledAttributes, i2, 0);
        String string = typedArrayObtainStyledAttributes.getString(c.l.c.RecyclerView_layoutManager);
        if (typedArrayObtainStyledAttributes.getInt(c.l.c.RecyclerView_android_descendantFocusability, -1) == -1) {
            setDescendantFocusability(262144);
        }
        this.f999k = typedArrayObtainStyledAttributes.getBoolean(c.l.c.RecyclerView_android_clipToPadding, true);
        boolean z3 = typedArrayObtainStyledAttributes.getBoolean(c.l.c.RecyclerView_fastScrollEnabled, false);
        this.y = z3;
        if (z3) {
            q0((StateListDrawable) typedArrayObtainStyledAttributes.getDrawable(c.l.c.RecyclerView_fastScrollVerticalThumbDrawable), typedArrayObtainStyledAttributes.getDrawable(c.l.c.RecyclerView_fastScrollVerticalTrackDrawable), (StateListDrawable) typedArrayObtainStyledAttributes.getDrawable(c.l.c.RecyclerView_fastScrollHorizontalThumbDrawable), typedArrayObtainStyledAttributes.getDrawable(c.l.c.RecyclerView_fastScrollHorizontalTrackDrawable));
        }
        typedArrayObtainStyledAttributes.recycle();
        w(context, string, attributeSet, i2, 0);
        if (Build.VERSION.SDK_INT >= 21) {
            TypedArray typedArrayObtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, G0, i2, 0);
            c.f.l.t.U(this, context, G0, attributeSet, typedArrayObtainStyledAttributes2, i2, 0);
            z2 = typedArrayObtainStyledAttributes2.getBoolean(0, true);
            typedArrayObtainStyledAttributes2.recycle();
        }
        setNestedScrollingEnabled(z2);
    }

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

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

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

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

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

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

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

        void b(y yVar) {
            this.f1053g = yVar.f1053g;
        }

        @Override // c.h.a.a, android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i2) {
            super.writeToParcel(parcel, i2);
            parcel.writeParcelable(this.f1053g, 0);
        }

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

    public static class p extends ViewGroup.MarginLayoutParams {
        d0 a;

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

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

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

        public p(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
            this.f1038b = new Rect();
            this.f1039c = true;
            this.f1040d = false;
        }

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

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

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

        public boolean d() {
            return this.a.isInvalid();
        }

        public p(int i2, int i3) {
            super(i2, i3);
            this.f1038b = new Rect();
            this.f1039c = true;
            this.f1040d = false;
        }

        public p(ViewGroup.MarginLayoutParams marginLayoutParams) {
            super(marginLayoutParams);
            this.f1038b = new Rect();
            this.f1039c = true;
            this.f1040d = false;
        }

        public p(ViewGroup.LayoutParams layoutParams) {
            super(layoutParams);
            this.f1038b = new Rect();
            this.f1039c = true;
            this.f1040d = false;
        }

        public p(p pVar) {
            super((ViewGroup.LayoutParams) pVar);
            this.f1038b = new Rect();
            this.f1039c = true;
            this.f1040d = false;
        }
    }

    @Override // android.view.ViewGroup
    protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        LayoutManager layoutManager = this.q;
        if (layoutManager != null) {
            return layoutManager.E(layoutParams);
        }
        throw new IllegalStateException("RecyclerView has no LayoutManager" + Q());
    }
}
