What Android Api is used to get the scrolling to the left or to the right on the start screen on Android?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The simplest way is by detecting a “Fling” gesture. The android API has a built in detector for basic gestures like flinging, scrolling, long press, double tap, pinch zoom, etc.
The documentation is available at http://developer.android.com/reference/android/view/GestureDetector.html.
What you do is create an instance of GestureDetector, override the onTouchEvent method of the view you are interested in detecting gestures for, and pass the MotionEvent to the GestureDetector.
You also have to supply a OnGestureListener implementation (easiest to extend SimpleOnGestureListener) to the GestureDetector and that will handle all of your gesture events.
Example: