tinkoff-mobile-tech / ScrollingPagerIndicator

Pager indicator inspired by Instagram. Lightweight and easy to set up.
Apache License 2.0
667 stars 102 forks source link

set visibleDotCount as even numbers #16

Open lferruzzi opened 5 years ago

lferruzzi commented 5 years ago

Firstly, thank you for the project. I was trying to set the visibleDotCount property as 4 and noticed that on the code force to be an odd number, is there any reason for that? Is there any plans to add this as a feature?

N-Olifer commented 5 years ago

Hi! Implementation doesn't allow even visibleDotCount now, because center dot is considired selected (when there are actually more dots than visibleDotCount), and for even visibleDotCount there wouldn't be one center dot. So some significant refactoring is needed to allow it.

If you use indicator horizontally centered on screen, you probably wouldn't need even visibleDotCount. What kind of layout are you going to implement?

lferruzzi commented 5 years ago

I see, I checked the code and tried to change it by myself and found out that it would require a big change. The idea is to make a pager with the horizontally centered indicator at the bottom, but the designers would like a maximum of four dots to appear, making an analogy with a previous layout. For now I'm using five and it's working fine, but I was also curious to know the reason of this limitation, thank you so much for the answer.