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

Commit 6f663c1a authored by Adam Powell's avatar Adam Powell
Browse files

Fix a bug in ListView where touch scrolling could skip a data set change

Bug 2597058

ListView's touch scrolling can query the adapter for new views. As we now
flush pending touch events before running layout/draw traversals (when we
normally bring ListView back in sync), this can now happen more often.

Resync data before executing a scroll if a data set change is pending.

Change-Id: I3e4eba4c2537911ba9cb3393ee4d9e68e46f84bb
parent 427db9b3
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3179,6 +3179,13 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                mActivePointerId = ev.getPointerId(pointerIndex);
            }
            final int y = (int) ev.getY(pointerIndex);

            if (mDataChanged) {
                // Re-sync everything if data has been changed
                // since the scroll operation can query the adapter.
                layoutChildren();
            }

            switch (mTouchMode) {
            case TOUCH_MODE_DOWN:
            case TOUCH_MODE_TAP: