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

ProgressArcView stop method can not work #31

Open
ringcentraljerry opened this issue Jul 25, 2016 · 1 comment
Open

ProgressArcView stop method can not work #31

ringcentraljerry opened this issue Jul 25, 2016 · 1 comment

Comments

@ringcentraljerry
Copy link

ringcentraljerry commented Jul 25, 2016

Issue:
If the app start to show the progress view, and then stop it immediately, the progress can't not be stopped.
Root Cause:
ProgressArcView.show() method, it will delay the running task 150 ms, so during the time, if the app call the method ProgressArcView.stop(), will cause progress view still in progress.
Solution:
private Runnable animationRunnable = new Runnable() {
public void run() {
ProgressArcView.this.setAlpha(1.0F);
ProgressArcView.this.getDrawable().reset();
}
};
public void show() {
postDelayed(animationRunnable, SHOW_SCALE_ANIM_DELAY);
}

public void stop() {
removeCallbacks(animationRunnable);
getDrawable().stop();
ValueAnimator fadeOutAnim = ObjectAnimator.ofFloat(this, "alpha", 1, 0);
fadeOutAnim.setDuration(100).start();
}

@tiba1987
Copy link

tiba1987 commented Aug 8, 2016

I've noticed this as well. Your fix seems to work! Thanks for sharing

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

2 participants