There is a ViewPager, inside which is another ViewPager.
The internal pager does not have to react to the touch, in it the pages are switched by timer. But the external - must.
How to make it so that only an external one would react to the svayp via the internal pager?

    1 answer 1

    Internal

    public class CustomViewPager extends ViewPager { private boolean enabled; public CustomViewPager(Context context, AttributeSet attrs) { super(context, attrs); this.enabled = true; } @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; } public void setPagingEnabled(boolean enabled) { this.enabled = enabled; } }