Skip to content

Commit

Permalink
fix bug: if the view has animation, it can't be removed by parent act…
Browse files Browse the repository at this point in the history
…ually.

fix bug: if the CircleProgressBar has a container, if the container is removed by it's parent and add back again, the animation will nerver start again.
  • Loading branch information
ashqal committed Oct 27, 2015
1 parent 240f852 commit 0d32bd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ protected void onAttachedToWindow() {
if (mProgressDrawable != null) {
mProgressDrawable.stop();
mProgressDrawable.setVisible(getVisibility() == VISIBLE, false);

requestLayout();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ public void applyTransformation(float interpolatedTime, Transformation t) {
float groupRotation = ((720.0f / NUM_POINTS) * interpolatedTime)
+ (720.0f * (mRotationCount / NUM_POINTS));
setRotation(groupRotation);

// If this view is removed by parent
// clear the anim
if ( mAnimExcutor.getParent() == null ) stop();
}
}
};
Expand Down

0 comments on commit 0d32bd5

Please sign in to comment.