Skip to content
Auto scroll viewpager working with Androidx libraries
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
autoscrollviewpager code cleanup Sep 27, 2019
gradle/wrapper init library Sep 27, 2019
.gitignore init library Sep 27, 2019
LICENSE Create LICENSE Sep 27, 2019
build.gradle init library Sep 27, 2019
gradlew init library Sep 27, 2019

API GitHub issues Android Arsenal GitHub license androidx

Androidx Auto Scroll ViewPager

  • ViewPager which can auto scrolling, cycling, decelerating.
  • ViewPager which can be slided manually in parent ViewPager.
  • ViewPager which is compatible with AndroidX library.
  • ViewPager which is written in Kotlin and be supported for a long time.


Many thanks to Trinea because this library is the newest, kotlin version of his library. We support AndroidX library, so if you have problem when migrating to AndroidX, this version should work like a charm.



Add this to your root build.gradle file under repositories:

allprojects {
	repositories {
		maven { url "" }

Add this to your app level build.gradle as dependency:

implementation 'com.github.pzienowicz:androidx-auto-scroll-view-pager:{latest.version}'

Latest version:


  • include this library
  • use below code
	android:layout_height="wrap_content" />

instead of

	android:layout_height="wrap_content" />


  • startAutoScroll() start auto scroll, delay time is getInterval().
  • startAutoScroll(int) start auto scroll delayed.
  • stopAutoScroll() stop auto scroll.


  • setInterval(long) set auto scroll time in milliseconds, default is 1500.
  • setDirection(Direction) set auto scroll direction, default is Direction.RIGHT.
  • setCycle(boolean) set whether automatic cycle when auto scroll reaching the last or first item, default is true.
  • setScrollDurationFactor(double) set the factor by which the duration of sliding animation will change.
  • setSlideBorderMode(SlideBorderMode) set how to process when sliding at the last or first item, default is SlideBorderMode.NONE.
  • setStopScrollWhenTouch(boolean) set whether stop auto scroll when touching, default is true.
  • setBorderAnimation(boolean) set whether animating when auto scroll at the last or first item, default is true.
  • You cannot combine with ViewPagerIndicator if setCycle(true).


Please check example app contained in this repository. This is how it looks like: Example

You can’t perform that action at this time.