5

I would like to allow the ViewPager to swipe normally to the right/left as it is and detect Vertical Flings. I tried to assign a GestureDetector but the problem is that returning true from the method public boolean onDown(MotionEvent e) disables the normal horizontal swiping of the ViewPager. Any ideas how to allow both?

Ahmed Emad
  • 619
  • 10
  • 23

1 Answers1

0

There are already some custom controls for this. Try looking into these threads of how to implement a Vertical ViewPager.

  1. http://vision-apps.blogspot.ro/2013/05/4-directions-swipe-navigation.html
  2. How to put Vertically swiped ViewPager in a Horizontally swiped ViewPager
  3. https://stackoverflow.com/questions/14889530/vertical-viewpager-implementation

Hope this helps.:)

Community
  • 1
  • 1
A B
  • 338
  • 3
  • 10
  • 1
    Thanks a lot. I checked some of them before but I don't need it to swipe, I just need to detect the vertical fling. totally failed to customize it. – Ahmed Emad Mar 09 '15 at 07:52
  • So what you want is to have like a vertical scrollview inside your viewpager? I mean what is the purpose of the vertical fling? – A B Mar 09 '15 at 08:01
  • I want to detect the vertical fling to change the Fragment list of the adapter for the viewpager. – Ahmed Emad Mar 10 '15 at 09:23
  • Hey @AhmedEmad ,Did you find any work around ..Actually I'm also stucked on this – Prinkal Kumar Dec 27 '17 at 06:20