2

I am trying to implement two finger like swipe for HorizontalPager. I understand the single swipe feature of HorizontalPager which works fine. How to distinguish between a one finger swipe and two finger swipe? Can anyone tell me how to implement two finger swipe for HorizontalPager? A code sample would be more helpful.

Jason Sturges
  • 15,855
  • 14
  • 59
  • 80
Debtaru
  • 43
  • 4

1 Answers1

1

Have a look to this answer:

https://stackoverflow.com/a/7840953/1026620

It should work if you override onTouchEvent in the View. With

event.getPointerCount()

check if it is equal to 2. In that case, change to the next page. Otherwise, ignore the gesture.

Community
  • 1
  • 1
MRD
  • 7,146
  • 1
  • 21
  • 21