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
2021-07-10 17:50:17 -04:00
demo Remove jcenter 2021-04-09 18:32:36 -04:00
gradle/wrapper Update Gradle and AGP 2021-01-03 22:58:38 -05:00
library Remove jcenter 2021-04-09 18:32:36 -04:00
.gitignore Initial commit 2018-08-14 08:57:03 +02:00
build.gradle Remove jcenter 2021-04-09 18:32:36 -04:00
gradle.properties Remove support library import to avoid needing Jetifier 2021-01-03 23:01:22 -05:00
gradlew Initial commit 2018-08-14 08:57:03 +02:00
gradlew.bat Initial commit 2018-08-14 08:57:03 +02:00
LICENSE Create LICENSE 2021-07-10 17:50:17 -04:00
README.md Update example in README 2021-01-03 22:58:53 -05: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, optionally providing android:orientation:

<androidx.viewpager.widget.DirectionalViewPager
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"/>

Or from code:

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

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

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