tommybuonomo / dotsindicator

Three material Dots Indicators for view pagers in Android !
Apache License 2.0
3.47k stars 354 forks source link

No. of dots don't change when deleting #139

Closed RichestYoo closed 2 years ago

RichestYoo commented 2 years ago

Hello. I found something not intuitive as following: When deleting an image from ViewPager2, the number of dots doesn't change.

    [Before Delete] 
             (Image)  (Image)  (Image)           (Image - Marked)  <-- I delete last one
    [After Delete]
             (Image)  (Image)  (Image - Marked)  (Image - appear but not exists)

As a quick fix, I put removeDot() with index from 0 to 3, but all 0~3 led to indexOutOfBound. What am I supposed to do?

kacsogellert commented 2 years ago

I ended up fixing by calling refreshDots on the callback of the submitList method

  adapter.submitList(it){
             dotsIndicator.refreshDots()
           }
tommybuonomo commented 2 years ago

Hello, thanks for your contribution ! This issue is now fixed in the new version 4.3 Thanks 🔥