From 8621cfa43fd12b5ad1376eb1a2454729ce9d9c7e Mon Sep 17 00:00:00 2001 From: Marc Capdevielle Date: Fri, 5 Feb 2010 19:28:23 +0100 Subject: [PATCH] Fix x coordinate of the ACTION_UP event in TouchUtils.drag() method The ACTION_UP event was fired at the "fromX" position instead of being fired at the "toX" position which is the current value of local var "x". This bug had no real impact as the VelocityTracker always ignores the last MotionEvent when it received more than 3 events... --- test-runner/android/test/TouchUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-runner/android/test/TouchUtils.java b/test-runner/android/test/TouchUtils.java index 962b2f9aab30..69c6d2d57d00 100644 --- a/test-runner/android/test/TouchUtils.java +++ b/test-runner/android/test/TouchUtils.java @@ -773,7 +773,7 @@ public class TouchUtils { float xStep = (toX - fromX) / stepCount; MotionEvent event = MotionEvent.obtain(downTime, eventTime, - MotionEvent.ACTION_DOWN, fromX, y, 0); + MotionEvent.ACTION_DOWN, x, y, 0); inst.sendPointerSync(event); inst.waitForIdleSync(); @@ -787,7 +787,7 @@ public class TouchUtils { } eventTime = SystemClock.uptimeMillis(); - event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, fromX, y, 0); + event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, x, y, 0); inst.sendPointerSync(event); inst.waitForIdleSync(); } -- 2.11.0