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

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

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