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

ValueBar in ViewPager #6

Closed
MaxBatt opened this issue Aug 12, 2015 · 1 comment
Closed

ValueBar in ViewPager #6

MaxBatt opened this issue Aug 12, 2015 · 1 comment

Comments

@MaxBatt
Copy link

MaxBatt commented Aug 12, 2015

I have a ViewPager in which I can swipe between different fragments and integrated the ValueBar in one of these Fragments.
Now when I try to drag the ValueBar, the ViewPager always catches the motion-event and swipes to the next or previous fragment :(

@MaxBatt
Copy link
Author

MaxBatt commented Aug 12, 2015

Allright, I got this one on my own, you can do it just like this:

   // Disable siwping fragments in the ViewPager when you drag the ValueBar
    valueBar.setOnTouchListener(new OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            ViewParent parent = getParent();
            parent.requestDisallowInterceptTouchEvent(true);
            return false;
        }
    });

@PhilJay PhilJay closed this as completed Aug 26, 2015
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

2 participants