Android View Pager with Auto Scroll indicator

1k Views Asked by At

In my Android app, I am have been able to auto-scroll view pager after a certain duration. I could not find a pager indicator that would show the time remaining before the scroll happens.

I have attached screenshot of a website below to give an idea of what I am trying to achieve.

Progress 1

Progress 2

Would help if you could share a library or code you have used for the tab indicator.

2

There are 2 best solutions below

0
Gouse Mohiddin On BEST ANSWER

You can use the following library to display indicators and then programmatically scroll your View Pager to next position, using these functions in that library.

 @Override
public void onNext() {
   //Move to position +1
}

@Override
public void onPrev() {
   //Move to position -1
}

@Override
public void onComplete() {
    //Called when complete
}
0
Muhammad Ammar On

I integrated same functionality of view pager with the help of this library. https://github.com/smarteist/Android-Image-Slider In this library you can set auto scroll time of sliding the view pager with this attribute app:sliderIndicatorAnimationDuration and apply different animations while sliding.

Furthermore, Disable the indicators with this attributes app:sliderIndicatorEnable =false.

Use this library for indicators.https://github.com/tommybuonomo/dotsindicator I hope it might be help for you cause I have build same functionally in my app.