am d699ad18: Merge "Remove the WaitEvent added in Tap and Drag." into jb-dev
* commit 'd699ad187756b1138e6c697c285dd476c2d0c449': Remove the WaitEvent added in Tap and Drag.
This commit is contained in:
@@ -328,7 +328,7 @@ public class MonkeySourceScript implements MonkeyEventSource {
|
|||||||
try {
|
try {
|
||||||
float x = Float.parseFloat(args[0]);
|
float x = Float.parseFloat(args[0]);
|
||||||
float y = Float.parseFloat(args[1]);
|
float y = Float.parseFloat(args[1]);
|
||||||
long tapDuration = 5;
|
long tapDuration = 0;
|
||||||
if (args.length == 3) {
|
if (args.length == 3) {
|
||||||
tapDuration = Long.parseLong(args[2]);
|
tapDuration = Long.parseLong(args[2]);
|
||||||
}
|
}
|
||||||
@@ -396,7 +396,6 @@ public class MonkeySourceScript implements MonkeyEventSource {
|
|||||||
long downTime = SystemClock.uptimeMillis();
|
long downTime = SystemClock.uptimeMillis();
|
||||||
long eventTime = SystemClock.uptimeMillis();
|
long eventTime = SystemClock.uptimeMillis();
|
||||||
|
|
||||||
MonkeyWaitEvent wayPointDelay = new MonkeyWaitEvent(5);
|
|
||||||
if (stepCount > 0) {
|
if (stepCount > 0) {
|
||||||
float xStep = (xEnd - xStart) / stepCount;
|
float xStep = (xEnd - xStart) / stepCount;
|
||||||
float yStep = (yEnd - yStart) / stepCount;
|
float yStep = (yEnd - yStart) / stepCount;
|
||||||
@@ -407,7 +406,6 @@ public class MonkeySourceScript implements MonkeyEventSource {
|
|||||||
mQ.addLast(e);
|
mQ.addLast(e);
|
||||||
|
|
||||||
for (int i = 0; i < stepCount; ++i) {
|
for (int i = 0; i < stepCount; ++i) {
|
||||||
mQ.addLast(wayPointDelay);
|
|
||||||
x += xStep;
|
x += xStep;
|
||||||
y += yStep;
|
y += yStep;
|
||||||
eventTime = SystemClock.uptimeMillis();
|
eventTime = SystemClock.uptimeMillis();
|
||||||
@@ -416,7 +414,6 @@ public class MonkeySourceScript implements MonkeyEventSource {
|
|||||||
mQ.addLast(e);
|
mQ.addLast(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
mQ.addLast(wayPointDelay);
|
|
||||||
eventTime = SystemClock.uptimeMillis();
|
eventTime = SystemClock.uptimeMillis();
|
||||||
e = new MonkeyTouchEvent(MotionEvent.ACTION_UP).setDownTime(downTime)
|
e = new MonkeyTouchEvent(MotionEvent.ACTION_UP).setDownTime(downTime)
|
||||||
.setEventTime(eventTime).addPointer(0, x, y, 1, 5);
|
.setEventTime(eventTime).addPointer(0, x, y, 1, 5);
|
||||||
|
|||||||
Reference in New Issue
Block a user