Companion

object Companion

Companion object containing the constants and methods for identifying the direction of a fling gesture.

Properties

BOUNDARY_ANGLES
Link copied to clipboard
private val BOUNDARY_ANGLES: DoubleArray
Boundary angles (in radians) for distinguishing the direction of a fling gesture.

Functions

getAngle
Link copied to clipboard
private fun getAngle(x1: Float, y1: Float, x2: Float, y2: Float): Double
Computes the angle (in radians) between the points defined by the given coordinates.
getDirection
Link copied to clipboard
fun getDirection(e1: MotionEvent, e2: MotionEvent): FlingDirection
Returns the direction of the fling gesture based on the angle formed between the points defined by the coordinates of the given MotionEvents.
isDown
Link copied to clipboard
private fun isDown(angle: Double): Boolean
Checks if the angle formed between the points defined by the coordinates of the pertinent MotionEvents is indicative of a downward gesture.
isLeft
Link copied to clipboard
private fun isLeft(angle: Double): Boolean
Checks if the angle formed between the points defined by the coordinates of the pertinent MotionEvents is indicative of a left gesture.
isRight
Link copied to clipboard
private fun isRight(angle: Double): Boolean
Checks if the angle formed between the points defined by the coordinates of the pertinent MotionEvents is indicative of a right gesture.
isUp
Link copied to clipboard
private fun isUp(angle: Double): Boolean
Checks if the angle formed between the points defined by the coordinates of the pertinent MotionEvents is indicative of an upward gesture.