Android??????????????????????
???????????? ???????[ 2013/8/26 13:54:31 ] ????????
????Android?????????????У??????????????????????????????????UC??????У?????????????е???????????????????????????????????????????????????????λ?????robotium???и?drag(float fromX?? float toX?? float fromY?? float toY??int stepCount)????????????drag??г?????????裬????????????????????????????????????????????????????
????drag?????????????£?
public void drag(float fromX?? float toX?? float fromY?? float toY??
int stepCount) {
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
float y = fromY;
float x = fromX;
float yStep = (toY - fromY) / stepCount;
float xStep = (toX - fromX) / stepCount;
MotionEvent event = MotionEvent.obtain(downTime?? eventTime??MotionEvent.ACTION_DOWN?? fromX?? fromY?? 0);
try {
inst.sendPointerSync(event);
} catch (SecurityException ignored) {}
for (int i = 0; i < stepCount; ++i) {
y += yStep;
x += xStep;
eventTime = SystemClock.uptimeMillis();
event = MotionEvent.obtain(downTime?? eventTime??MotionEvent.ACTION_MOVE?? x?? y?? 0);
try {
inst.sendPointerSync(event);
} catch (SecurityException ignored) {}
}
eventTime = SystemClock.uptimeMillis();
event = MotionEvent.obtain(downTime?? eventTime?? MotionEvent.ACTION_UP??toX?? toY?? 0);
try {
inst.sendPointerSync(event);
} catch (SecurityException ignored) {}
}
???????????????????MotionEvent??ACTION_DOWN?????????2?????ACTION_MOVE???????????????????ACTION_UP???????????????????????????????????????robotium?е?????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11