TOrnelas / SegmentedProgressBar

An instagram-like segmented progress bar
MIT License
381 stars 36 forks source link

Set different time for each segment #42

Open 3llomi opened 2 years ago

3llomi commented 2 years ago

39

3llomi commented 2 years ago

I just pushed a fix where calling next() method would leave the previous bar incomplete while the next story is paused. Here is the code snipped that may clarify the issue

  override fun onPage(oldPageIndex: Int, newPageIndex: Int) {
                spb.pause()
                Handler().postDelayed({
                    spb.start()
                }, 2000)
                // New page started animating
            }

here we're simulating downloading a story scenario by adding a delay, and then start the story after the delay.

Here is a video of the issue

https://user-images.githubusercontent.com/8546946/160190551-941ea378-8bc8-4743-ab89-9e58638d41d0.mov