From 60dd581ac23db86456cd1a7dcbb82cf089e55a94 Mon Sep 17 00:00:00 2001 From: George Mount Date: Tue, 1 Jun 2021 22:53:01 +0000 Subject: [PATCH] Fix ListView not moving during catch Fixes: 189294917 When a ListView has clickable items in it, the over scroll animation "catch" wasn't properly catching. The problem was that the over scroll animation was checked and the touch mode was set, and the touch mode was checked later. Unfortunately, the touch mode variable that was checked was different from the one that was set. Test: manual and new ListViewTest Change-Id: Iaf9b51d028d1f14195ca38a5fd511141262487ff --- core/java/android/widget/AbsListView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 5e2209e65f45b..721260e8cafe6 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -4575,7 +4575,7 @@ public abstract class AbsListView extends AdapterView implements Te int motionPosition = findMotionRow(y); if (isGlowActive()) { // Pressed during edge effect, so this is considered the same as a fling catch. - mTouchMode = TOUCH_MODE_FLING; + touchMode = mTouchMode = TOUCH_MODE_FLING; } else if (touchMode != TOUCH_MODE_FLING && motionPosition >= 0) { // User clicked on an actual view (and was not stopping a fling). // Remember where the motion event started