StoriesProgressView icon indicating copy to clipboard operation
StoriesProgressView copied to clipboard

Add method to reset a progress

Open teresaholfeld opened this issue 6 years ago • 4 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.

teresaholfeld avatar Oct 25 '18 10:10 teresaholfeld

call stop method to clear progress

dajver avatar Nov 26 '18 09:11 dajver

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

teresaholfeld avatar Nov 28 '18 12:11 teresaholfeld

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 avatar Dec 16 '18 01:12 adiazarya100

@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. 👍

teresaholfeld avatar Dec 17 '18 09:12 teresaholfeld