How do I build a ViewPager that detects both swipe and click events?
I tried creating a custom ViewPager class that overrides onInterceptTouchEvent
to register both click and swipe events (because I know they interfere with each-other), and that's were I got stuck.
How to proceed?
public class CustomViewPager extends ViewPager {
public CustomViewPager(Context context) {
super(context);
}
public CustomViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public null onInterceptTouchEvent(MotionEvent ev) {
//Enter the code here to communicate a touch event
super.onInterceptTouchEvent(ev);
}
}