private float distance ( MotionEvent event ) { if ( event . getPointerCount ( ) < 2 ) { return 0 ; } return PointF . length ( event . getX ( POINTER1 ) - event . getX ( POINTER2 ) , // event . getY ( POINTER1 ) - event . getY ( POINTER2 ) ) ; }
Calculates the distance between the 2 current pointers