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.
Asked
Active
Viewed 2,372 times
2
-
two finger swipe? what does it mean? – vnshetty Jun 01 '12 at 07:25
-
It means that instead of swiping with one finger, you use two fingers simultaneously to swipe – Debtaru Jun 01 '12 at 07:34
-
what you want is to implement multitouch? – CMA Jun 01 '12 at 07:43
1 Answers
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.