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

Unexpected behavior when setting progress outside set min (0) and max #17

Open
josefdlange opened this issue Apr 13, 2016 · 0 comments
Open

Comments

@josefdlange
Copy link

I ran into a crash that was a stupid error on my part, but perhaps could be handled more gracefully by the library or at least be well-documented. If I set a progress value that is outside the range of 0 to max, I get a crash.

I could see perhaps a modification to this library that, when receiving a progress value, floors or ceilings it to the acceptable range. For example, if a progress of 6 is set on a pie view with a max of 4, the effective progress value would become 4. Likewise for negative numbers, if progress is set as -3, then the effective progress for display becomes 0.

If you'd rather not sanitize inputs in that way, I'd suggest either a note about it in the documentation and/or a RuntimeException subclass that is thrown when this occurs, and a throws declaration on the setProgress and setMax signatures.

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

1 participant