Ra Ghazi
Ra Ghazi

Reputation: 127

Detecting left and right swipe android?

I have a RelativeLayout defined as follows:

<RelativeLayot>

  <TextView />
  <TextView />
  <EditText />
  <Button />

</RelativeLayout

I want to detect swipes to the left or right on this RelativeLayout and update the two textviews with new text. What is the easiest or most efficient way of goiing about doing this? Any help is appreciated.

Upvotes: 1

Views: 1152

Answers (2)

Sachin Fulzele
Sachin Fulzele

Reputation: 31

To detect swipes either left or right we use Gesture in android. Please go through following link shows you different kinds gesture you can capture.

http://developer.android.com/design/patterns/gestures.html http://www.vogella.com/articles/AndroidGestures/article.html

Upvotes: 1

Ravi
Ravi

Reputation: 3772

Use Gesture overlay for detecting the swipes.You can create left and right swipes through gesture builder . Refer to this link http://www.vogella.com/articles/AndroidGestures/article.html or this Using a gesture overlay view in android . Developer docs http://developer.android.com/reference/android/gesture/GestureOverlayView.html

Upvotes: 0

Related Questions