public T doubleTap ( final GestureDetector . OnDoubleTapListener listener ) { if ( view != null ) { final GestureDetector detector = new GestureDetector ( view . getContext ( ) , new GestureDetector . SimpleOnGestureListener ( ) ) ; detector . setOnDoubleTapListener ( listener ) ; view . setOnTouchListener ( new View . OnTouchListener ( ) { @ Override public boolean onTouch ( View v , MotionEvent event ) { return detector . onTouchEvent ( event ) ; } } ) ; } return self ( ) ; }
Register listener on double - tap gesture for view