Implementation of a ViewPager that supports both vertical and horizontal swiping.

arkon 7168aff0a0 Create LICENSE 3 jaren geleden
demo bbbddc7b19 Remove jcenter 3 jaren geleden
gradle c5a0edeb46 Update Gradle and AGP 3 jaren geleden
library bbbddc7b19 Remove jcenter 3 jaren geleden
.gitignore 48f5c271fa Initial commit 6 jaren geleden
LICENSE 7168aff0a0 Create LICENSE 3 jaren geleden
README.md 1979b10df6 Update example in README 3 jaren geleden
build.gradle bbbddc7b19 Remove jcenter 3 jaren geleden
gradle.properties 7d0617d441 Remove support library import to avoid needing Jetifier 3 jaren geleden
gradlew 48f5c271fa Initial commit 6 jaren geleden
gradlew.bat 48f5c271fa Initial commit 6 jaren geleden
settings.gradle 48f5c271fa Initial commit 6 jaren geleden

README.md

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());