I want to implement a non-scrollable ViewPager
. People say that I should override the onInterceptTouchEvent
and onTouchEvent
functions:
@Override
public boolean onTouchEvent(MotionEvent event) {
if (this.enabled) {
return super.onTouchEvent(event);
}
return false;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
if (this.enabled) {
return super.onInterceptTouchEvent(event);
}
return false;
}
Okay, I can't swipe now. But I need the taps that are gone too! Both of them are MotionEvents
with action=ACTION_DOWN
, so how can I differentiate one from another and pass only taps in this case?
P. S. What the hell? In iOS I can disable scrolling by unchecking one checkmark.