Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to reset a progress #17

Open
teresaholfeld opened this issue Oct 25, 2018 · 4 comments
Open

Add method to reset a progress #17

teresaholfeld opened this issue Oct 25, 2018 · 4 comments

Comments

@teresaholfeld
Copy link
Contributor

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.

@dajver
Copy link

dajver commented Nov 26, 2018

call stop method to clear progress

@teresaholfeld
Copy link
Contributor Author

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

@adiazarya100
Copy link

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 :)

@teresaholfeld
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants