Home » Android » What is the purpose of "onFling" and "onScroll" event in GestureDetector of Android?

What is the purpose of "onFling" and "onScroll" event in GestureDetector of Android?

Posted by: admin June 15, 2020 Leave a comment

Questions:

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.

How to&Answers:

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.