Reputation: 2568
I have a mock up that I want to create for when I'm switching between views in a viewpager.
The filled in circle would be indicative of a previous page, the semi-filled in circle would indicate current page and the last couple of empty circles would be the upcoming pages not currently viewing.
I was wondering where can I get started on how to create something like this?
I was also wondering how would I know how many pages are left to be viewed set that equal to the number of empty circles to show.
How would I be able to move along the circle images when swiping between views?
Thanks.
Upvotes: 0
Views: 74
Reputation: 1812
You dont need to reinvent the wheel for it so you can use library with little modificaiton in its source code.
use the library
https://github.com/JakeWharton/Android-ViewPagerIndicator
library have CirclePageIndicator which is performing the thing you need setting current circle as you scroll pages in ViewPager.you will need to add code to below class to drawPrevious circle in onDraw method.you can do that by storing previously selected page in variable and draw the previous page indicator as per your need.
Upvotes: 1