Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e57091c6 authored by George Mount's avatar George Mount Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in RecyclerView" into sc-dev

parents d402d0fe 49bd07d6
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -2049,9 +2049,10 @@ public class RecyclerView extends ViewGroup implements ScrollingView, NestedScro
        }
        if (!dispatchNestedPreFling(velocityX, velocityY)) {
            boolean consumed = false;
            if (mLayout.getChildCount() > 0) {
                final View firstChild = mLayout.getChildAt(0);
                final View lastChild = mLayout.getChildAt(mLayout.getChildCount() - 1);
            boolean consumed = false;
                if (velocityY < 0) {
                    consumed = getChildAdapterPosition(firstChild) > 0
                            || firstChild.getTop() < getPaddingTop();
@@ -2061,6 +2062,7 @@ public class RecyclerView extends ViewGroup implements ScrollingView, NestedScro
                    consumed = getChildAdapterPosition(lastChild) < mAdapter.getItemCount() - 1
                            || lastChild.getBottom() > getHeight() - getPaddingBottom();
                }
            }
            dispatchNestedFling(velocityX, velocityY, consumed);