I ended up creating a new DirectionalViewPager that can scroll either vertically or horizontally because all of the solutions I've seen here have flaws:
Existing VerticalViewPager implementations (by castorflex and LambergaR)
- They are based on very old support library versions.
Transformation trick with coordinate swapping
- The overscroller is still shown from the left/right edges.
- Page flinging doesn't work properly, because even with the coordinates swapped,
VelocityTracker.computeCurrentVelocity
still calculates the velocity with the X axis, probably because this internally uses a native call that ignores the coordinate swap.
View rotation
- Hack that needs every child view to be rotated too.
- If you want to read coordinates for something else you have to swap the axis.