Implementation of a ViewPager that supports both vertical and horizontal swiping.
This repository has been archived on 2024-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2018-08-14 08:57:03 +02:00
demo Initial commit 2018-08-14 08:57:03 +02:00
gradle/wrapper Initial commit 2018-08-14 08:57:03 +02:00
library Initial commit 2018-08-14 08:57:03 +02:00
.gitignore Initial commit 2018-08-14 08:57:03 +02:00
build.gradle Initial commit 2018-08-14 08:57:03 +02:00
gradle.properties Initial commit 2018-08-14 08:57:03 +02:00
gradlew Initial commit 2018-08-14 08:57:03 +02:00
gradlew.bat Initial commit 2018-08-14 08:57:03 +02:00
README.md Initial commit 2018-08-14 08:57:03 +02:00
settings.gradle Initial commit 2018-08-14 08:57:03 +02:00

Implementation of a ViewPager that supports both vertical and horizontal swiping. It's based on the support library 27.1.1 and uses the same package as ViewPager in order to use its interfaces and make it compatible with adapters and listeners.

A pager can be instantiated either from XML:

<android.support.v4.view.DirectionalViewPager
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"/>

Or from code:

val pager = DirectionalViewPager(context, false) // true for horizontal

The direction of the pager can be changed at runtime with:

pager.setHorizontal(!pager.isHorizontal());