I have a ViewPager that uses GridViews for pages. I would like ViewPager to switch pages as I scroll through the screen.
The problem is that swipes are not detected when they are done through the GridView. Outside of the GridView, palms are working correctly; it seems that the GridView captures all touch events without passing it to the ViewPager first.
While working with the source code, I did this for a special class extended from GridView:
@Override public boolean onTouchEvent(MotionEvent event) { return pager.onInterceptTouchEvent(event); }
- where pager
belongs to the ViewPager class. In this case, the ViewPager will correctly detect errors and move pages accordingly, but this does not allow the GridView to receive any events, so I can not click on the elements.
What I would like to do is correctly detect the swipes in the ViewPager and click the element on the GridView.
colig source share