开发者

Android: Two finger double tap possible to detect with GestureDetector?

question above. For me getPointerCount() is always 1, once a double tap is detected.

 private GestureDetector mGestureDetector;
 mGestureDetector = new GestureDetector(this, new MyGestureListener());    

...

 public boolean onTouch(View v, MotionEvent event) {
     return mGestureDetector.onTouchEvent(event);
 }  

...

private class MyGestureListener extends  GestureDetector.SimpleOnGestureListener {

    @Override
    public boolean o开发者_如何学GonDoubleTap(MotionEvent e) {
         return super.onDoubleTap(e);
    } 

}


The GestureDetector is only capable of detecting "one finger" gestures. The "double tap" gesture you are currently listening to, occurs when the user tapped, released and tapped again the screen with one of his/her fingers.

If you want to listen to gestures with multiple fingers you'll have to do it on your own or use the ScaleGestureDetector (only for the scale gesture).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜