Skip to content

Instantly share code, notes, and snippets.

@stefanJi
Last active April 17, 2020 15:28
Show Gist options
  • Save stefanJi/d16dbaa0cf2eac49f643edb239498faa to your computer and use it in GitHub Desktop.
Save stefanJi/d16dbaa0cf2eac49f643edb239498faa to your computer and use it in GitHub Desktop.
animator_cancel_android_8
public void cancel() {
if (isStarted()) {
ArrayList<AnimatorListener> tmpListeners = null;
if (mListeners != null) {
tmpListeners = (ArrayList<AnimatorListener>) mListeners.clone();
int size = tmpListeners.size();
for (int i = 0; i < size; i++) {
tmpListeners.get(i).onAnimationCancel(this);
}
}
ArrayList<Node> playingSet = new ArrayList<>(mPlayingSet);
int setSize = playingSet.size();
for (int i = 0; i < setSize; i++) {
playingSet.get(i).mAnimation.cancel();
}
mPlayingSet.clear();
endAnimation();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment