Merge "Accelerating dragging to workspace by using pause at the end of the gesture" into ub-launcher3-master
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 4024ff0..ad67f1b 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -873,12 +873,17 @@
final Point start = new Point(startX, startY);
final Point end = new Point(endX, endY);
sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, start);
+ final long endTime = movePointer(start, end, steps, downTime, slowDown);
+ sendPointer(downTime, endTime, MotionEvent.ACTION_UP, end);
+ }
+
+ long movePointer(Point start, Point end, int steps, long downTime, boolean slowDown) {
long endTime = movePointer(downTime, downTime, steps * GESTURE_STEP_MS, start, end);
if (slowDown) {
endTime = movePointer(downTime, endTime + GESTURE_STEP_MS, 5 * GESTURE_STEP_MS, end,
end);
}
- sendPointer(downTime, endTime, MotionEvent.ACTION_UP, end);
+ return endTime;
}
void waitForIdle() {
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index 3301dd8..81d343d 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -39,7 +39,6 @@
* Operations on the workspace screen.
*/
public final class Workspace extends Home {
- private static final int DRAG_DURATION = 500;
private static final int FLING_STEPS = 10;
private final UiObject2 mHotseat;
@@ -170,8 +169,7 @@
LauncherInstrumentation.log("dragIconToWorkspace: sent down");
launcher.waitForLauncherObject(longPressIndicator);
LauncherInstrumentation.log("dragIconToWorkspace: indicator");
- launcher.movePointer(
- downTime, SystemClock.uptimeMillis(), DRAG_DURATION, launchableCenter, dest);
+ launcher.movePointer(launchableCenter, dest, 10, downTime, true);
LauncherInstrumentation.log("dragIconToWorkspace: moved pointer");
launcher.sendPointer(
downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, dest);