Skip to content

Instantly share code, notes, and snippets.

@stefanJi
Created April 17, 2020 15:28
Show Gist options
  • Save stefanJi/cc43657c2674895b76dd7bedf3c8b5a8 to your computer and use it in GitHub Desktop.
Save stefanJi/cc43657c2674895b76dd7bedf3c8b5a8 to your computer and use it in GitHub Desktop.
animator_cancel_7
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<Animator> playingSet = new ArrayList<>(mPlayingSet);
int setSize = playingSet.size();
for (int i = 0; i < setSize; i++) {
playingSet.get(i).cancel();
}
if (tmpListeners != null) {
int size = tmpListeners.size();
for (int i = 0; i < size; i++) {
tmpListeners.get(i).onAnimationEnd(this);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment