Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,27 @@ public String getTransitionName() {
return this.transitionName;
}

private Animator setAnimatorsTarget(AnimatorSet animatorSet, final View view) {
private Animator setAnimatorsTarget(AnimatorSet source, final View view) {
// A fresh animator per run: the shared one kept, run after run, the listeners holding the animated view
// and the transition clones, so every page that ever animated stayed alive.
AnimatorSet animatorSet = source.clone();
ArrayList<Animator> animatorsList = animatorSet.getChildAnimations();
boolean resetOnTransitionEnd = this.resetOnTransitionEnd;

for (int i = 0; i < animatorsList.size(); i++) {
animatorsList.get(i).setTarget(view);
}

// Reset animation to its initial state to prevent mirrorered effect
if (this.resetOnTransitionEnd) {
this.immediateAnimatorSet = this.animatorSet.clone();
this.immediateAnimatorSet = animatorSet.clone();
}

// Switching to hardware layer during transition to improve animation performance
CustomAnimatorListener listener = new CustomAnimatorListener(view);
animatorSet.addListener(listener);
this.addListener(new CustomTransitionListenerAdapter(this));

return this.animatorSet;
return animatorSet;
}

private class ReverseInterpolator implements Interpolator {
Expand Down
Loading