Open varunrramani opened 8 years ago
When you touch on InfiniteViewPager, all events will handled by it. That means it consume all touch events on it.
For vertically scroll, this function may be added in the coming future. As I am busy with my job, I can not make a certain promise for this.
When scroll through the viewpager, autoscrolling stops, it is a naturally interaction.
@varunrramani I have got this working by changing the following code in InfiniteViewPager file
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
//to solve conflict with parent ViewGroup
//getParent().requestDisallowInterceptTouchEvent(true);
if (this.mAutoScroll || this.mTouchedWhenAutoScroll) {
int action = ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
this.mTouchedWhenAutoScroll = true;
Log.d(TAG, "onInterceptTouchEvent: down ");
stopAutoScroll();
break;
case MotionEvent.ACTION_UP:
Log.d(TAG, "onInterceptTouchEvent: up ");
break;
default:
Log.d(TAG, "onInterceptTouchEvent: "+ev.getAction()+" and "+ev.toString());
break;
}
}
return super.onInterceptTouchEvent(ev);
}
@geniushkg thanks for sharing your solution. @varunrramani may this helps.
When added as header in a recycler view, unable to vertical scroll when touched on the viewpager. and when trying to scroll through the viewpager when autoscrolling it stutters and doesnt change the page.