views:

59

answers:

2

Hi, I want to ask that is that possible do in android catch the in the touch mode catch the scrolling direction ? When user touch on the screen left to right, can I catch the change ? If it is possible which listener can ı use ?

I found some of the methods and listeners but I 'm not sure that therse are represent my requirement . http://developer.android.com/reference/android/text/method/Touch.html

Public Methods static int getInitialScrollX(TextView widget, Spannable buffer) static int getInitialScrollY(TextView widget, Spannable buffer)

If these methods enough, ıs there any example that including these methods?

Thanks

A: 

I suspect that you want to detect a sideways motion, much like the used for unlocking the screen. To do that, you have to listen for a touch down event, then an up event and compare the coordinates of the two events.

Gintautas Miliauskas
+1  A: 

You need to use gestures and gesture listeners( http://developer.android.com/reference/android/gesture/GestureOverlayView.OnGestureListener.html ). The MotionEvent that you obtain in listener contains all the information you need.

Vladimir Ivanov