tommybuonomo / dotsindicator

Three material Dots Indicators for view pagers in Android !

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dots indicator initialises with the wrong number of dots initially

createS0ftware opened this issue · comments

I have 2 items in my viewpager and the dots indicator initialises with 3 dots

I can't see why - but if is set the viewpager to the second page then it initialises with 2 dots.

i think the problem is that in refreshDots() you call buildDot which adds a child view (dot) to the layout - if dotIndicatorView is not initialised.

You need to remove this view after you find that the viewpager adapter has pages - in that same refreshDots() method

Hmmm.. i just checked the code again - looks like i have a different version than what is in the maven rep... You removed that code. Ok i will try to get that version. You obviously fixed this bug.

Oh actually the problem is in SpringDotsIndicator. I was looking in DotsIndicator. So this is still a problem.

This problem is also existent on the WormDotsIndicator too. Any updates on this?

Hello @createS0ftware and @GalatiaPar,

I can't reproduce the bug of the three dots instead of two.

Does the new release 3.0.2 fix the issue ?

Hi @tommybuonomo. Not really.

I can see a different issue arising depending on the case:

  • Set up the view pager on the WormDotsIndicator as soon as you retrieve the list info you want to swipe through and list is empty. In this case it shows only one dot, which stays there no matter if you have updated the data (can provide video)
  • Setup the view pager on the WormDotsIndicator, if and only if I have a non-empty list, in which case when the containers of the list are 2, I get 3 dots instead of 2. The first dot seems to be excess, as it goes away on the first swipe I do.

I hope this helps. If you need any more clarifications please do not hesitate to ask!

@GalatiaPar can you check now with 3.0.3 please ?

@tommybuonomo all seems to be working well! thank you! Keep up the great work 👍

I'll check it in the next few hours

Fixed !! Well done !! Thanks !!

I am still facing the same problem with the wrong number of dots in 3.0.3