October 2018
Intermediate to advanced
464 pages
15h 17m
English
We're using GestureDetectorCompat, which is from the support library that allows gesture support on devices running Android 1.6 and later.
As mentioned in the recipe introduction, detecting gestures is a two-step process. To gather movement or gesture data, we start tracking movement with the touch event. Every time the onTouchEvent() is called, we send that data to the GestureDetector. The GestureDetector handles the second step, analyzing the data. Once a gesture has been detected, the appropriate callback is made. Our example handles both single and double tap gestures.