如何以编程方式模拟手势。
我得到了所有的分数,我希望我的应用程序能重复这些图纸。
public void onGestureStarted(GestureOverlayView gestureOverlayView, MotionEvent motionEvent) {
Log.d("TAG", "Started gesture: \n" + motionEvent.getRawX() + "\n" +
motionEvent.getRawY() + "\n" + motionEvent.getEventTime());
gestures.add(new GesturePoint(motionEvent.getRawX(), motionEvent.getRawY(), 100));
}
@Override
public void onGesture(GestureOverlayView gestureOverlayView, MotionEvent motionEvent) {
//To change body of implemented methods use File | Settings | File Templates.
gestures.add(new GesturePoint(motionEvent.getRawX(), motionEvent.getRawY(), 100));
Log.e("TAG", "gesture: \n" + motionEvent.getRawX() + "\n" +
motionEvent.getRawY() + "\n" + motionEvent.getEventTime());
}
@Override
public void onGestureEnded(GestureOverlayView gestureOverlayView, MotionEvent motionEvent) {
gestures.add(new GesturePoint(motionEvent.getRawX(), motionEvent.getRawY(), 100));
Log.d("TAG", "Ended gesture: \n" + motionEvent.getRawX() + "\n" +
motionEvent.getRawY() + "\n" + motionEvent.getEventTime());
g.addStroke(new GestureStroke(gestures));
gestureOverlayView.setGesture(g);
有没有像 startDraw(Arraylist) 这样的方法?
我需要它来模拟用户交互。