From 9a67ea23485c533a61ae0ac4425ff74b4633c1be Mon Sep 17 00:00:00 2001 From: lujun Date: Sun, 29 Mar 2015 23:21:12 +0800 Subject: [PATCH] fixed when click LoadingBtn, anim always showing --- .../java/com/shadev/easyloadingdemo/view/LoadingButton.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/main/java/com/shadev/easyloadingdemo/view/LoadingButton.java b/lib/src/main/java/com/shadev/easyloadingdemo/view/LoadingButton.java index 1a7e90d..c057a9c 100644 --- a/lib/src/main/java/com/shadev/easyloadingdemo/view/LoadingButton.java +++ b/lib/src/main/java/com/shadev/easyloadingdemo/view/LoadingButton.java @@ -94,7 +94,6 @@ public void onAnimationStart(Animation animation) { @Override public void onAnimationEnd(Animation animation) { - isDefaultDraw = false; isShowArc = true; invalidate(); ScaleAnimation scaleAnimation = new ScaleAnimation(0f,1f,0f,1f, Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f); @@ -109,7 +108,8 @@ public void onAnimationEnd(Animation animation) { } }); - LoadingButton.this.startAnimation(scaleAnimation); + if(isDefaultDraw) LoadingButton.this.startAnimation(scaleAnimation); + isDefaultDraw = false; } @@ -118,7 +118,7 @@ public void onAnimationRepeat(Animation animation) { } }); - LoadingButton.this.startAnimation(scaleAnimation); + if(isDefaultDraw) LoadingButton.this.startAnimation(scaleAnimation); } }); }