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?
Asked
Active
Viewed 2,462 times
5

Ahmed Emad
- 619
- 10
- 23
1 Answers
0
There are already some custom controls for this. Try looking into these threads of how to implement a Vertical ViewPager.
- http://vision-apps.blogspot.ro/2013/05/4-directions-swipe-navigation.html
- How to put Vertically swiped ViewPager in a Horizontally swiped ViewPager
- https://stackoverflow.com/questions/14889530/vertical-viewpager-implementation
Hope this helps.:)
-
1Thanks 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