简单的答案是
boolean onDoubleTap (MotionEvent e) -
当双击发生通知。
当双击发生 和param motionEvent
是:l,下来第一次轻触的运动事件时,可以通知作业人员。
boolean onDoubleTapEvent (MotionEvent e)` -
当双击手势内的事件发生
您可以在双击手势发生内通知作业人员的事件,包括已通知down
,move
和up
事件和和param motionEvent
是为运动事件
所以用doubleTapEvent
你可以得到额外的选项卡手势以及水龙头
看看 - >https://stackoverflow.com/a/19629851/5188159这种力量有助于您的触摸手势
进一步尝试了解这里发生了什么这个例子
//initialize the Gesture Detector
gd = new GestureDetector(this);
//set the on Double tap listener
gd.setOnDoubleTapListener(new OnDoubleTapListener()
{
@Override
public boolean onDoubleTap(MotionEvent e)
{
//set text color to green
tvTap.setTextColor(0xff00ff00);
//print a confirmation message
tvTap.setText("The screen has been double tapped.");
return false;
}
@Override
public boolean onDoubleTapEvent(MotionEvent e)
{
//if the second tap hadn't been released and it's being moved
if(e.getAction() == MotionEvent.ACTION_MOVE)
{
//set text to blue
tvTapEvent.setTextColor(0xff0000ff);
//print a confirmation message and the position
tvTapEvent.setText("Double tap with movement. Position:\n"
+ "X:" + Float.toString(e.getRawX()) +
"\nY: " + Float.toString(e.getRawY()));
}
else if(e.getAction() == MotionEvent.ACTION_UP)//user released the screen
{
tvTapEvent.setText("");
}
return false;
}
@Override
public boolean onSingleTapConfirmed(MotionEvent e)
{
//set text color to red
tvTap.setTextColor(0xffff0000);
//print a confirmation message and the tap position
tvTap.setText("Double tap failed. Please try again.");
return false;
}
});
我编辑了一个清晰的思路,答案:)希望我会帮你的 –