I am developing an Android application. I am novice in Touch enabled Android Application. I have read the article about onFling
and onScroll
events on:
http://developer.android.com/reference/android/view/GestureDetector.OnGestureListener.html
But I didn't get exactly what is the meaning and for what we can use onFling
and onScroll
events.
onFling: is that the user lifts his finger in the end of the movement (that is the reason for what onFling is called one time).
GestureDetector. SimpleOnGestureListener provides an implementation for all of the on<TouchEvent> methods by returning false for all of them. Thus you can override only the methods you care about. For example, the snippet below creates a class that extends GestureDetector.
A "touch gesture" occurs when a user places one or more fingers on the touch screen, and your application interprets that pattern of touches as a particular gesture. There are correspondingly two phases to gesture detection: Gather data about touch events.
onScroll event is when user touches down the screen, moves finger in some direction and lift up. It is mostly used to scroll larger layouts over a smaller viewport. onFling is the same, but made faster and usually triggers an animation that keeps scrolling few moments more after finger lifted up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With