Back to project page screenplay.
The source code is released under:
MIT License
If you think the Android project screenplay listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.davidstemmer.screenplay.scene.transformer; /* www .j a v a 2 s. c o m*/ import android.view.animation.Animation; import com.davidstemmer.screenplay.SceneCut; import com.davidstemmer.screenplay.flow.Screenplay; import java.util.HashSet; import java.util.Set; /** * Created by weefbellington on 10/2/14. */ public class TweenAnimationListener implements Animation.AnimationListener { private final SceneCut cut; private final Screenplay listener; private Set<Animation> animationSet = new HashSet<Animation>(); public TweenAnimationListener(SceneCut cut, Screenplay listener) { this.cut = cut; this.listener = listener; } public void addAnimation(Animation animation) { animationSet.add(animation); animation.setAnimationListener(this); } @Override public void onAnimationStart(Animation animation) {} @Override public void onAnimationEnd(Animation animation) { animationSet.remove(animation); if (animationSet.isEmpty()) { listener.endCut(cut); } } @Override public void onAnimationRepeat(Animation animation) {} }