Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to vertical scroll #3

Open
varunrramani opened this issue Dec 8, 2015 · 3 comments
Open

Unable to vertical scroll #3

varunrramani opened this issue Dec 8, 2015 · 3 comments

Comments

@varunrramani
Copy link

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.

@waylife
Copy link
Owner

waylife commented Dec 15, 2015

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.

@geniushkg
Copy link

@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);
}

@waylife
Copy link
Owner

waylife commented May 8, 2017

@geniushkg thanks for sharing your solution.
@varunrramani may this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants