shts / StoriesProgressView

show horizontal progress like instagram stories.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add method to reset a progress

teresaholfeld opened this issue · comments

I need a method where I can reset a progress.
I have issues with skip() and reverse(), because once the progress finished, they stopped working. The reason is that StoryProgressView.isComplete is true.
If I had a way of resetting that state, so that isComplete is false again, this would help a lot.

commented

call stop method to clear progress

There is no stop method. I made a PR that fixes that and adds a clear method.

Hi,
You can take the code and add this simple method:

public void setIsComplete(boolean bool) {
        isComplete = bool;
    }

Then just call:

@Override
    public void onComplete() {
        counter = 0;
        storiesProgressView.setIsComplete(false);
        destroy();
        initStory();
    }

*initStory => is my method. I initialize all the story data over there.
It works fine for me.
Let me know if you need more help :)

@adiazarya100 I already added a PR that is solving this: #18
If you work on an open source project and find yourself downloading and editing the code of that, it is good practice to make a pull request with your changes. That way, the owner of the project can merge the changes, and other people can profit from your improvement too.
On GitHub you can make a pull request if you fork a repository and commit your changes. Then in your forked repository there's a button for creating the Pull Request. That's good practice for open source contributing. 👍