private boolean isClick ( MotionEvent upEvent , float xDown , float yDown , float xUp , float yUp ) { if ( upEvent == null ) return false ; long time = upEvent . getEventTime ( ) - upEvent . getDownTime ( ) ; float distance = PointF . length ( // xDown - xUp , // yDown - yUp ) ; return time < MAX_CLICK_TIME && distance < MAX_CLICK_DISTANCE ; }
Test if a MotionEvent with the given start and end offsets can be considered as a click .