Example usage for android.animation AnimatorSet end

List of usage examples for android.animation AnimatorSet end

Introduction

In this page you can find the example usage for android.animation AnimatorSet end.

Prototype

@Override
public void end() 

Source Link

Document

Note that ending a AnimatorSet also ends all of the animations that it is responsible for.

Usage

From source file:Main.java

public static void seekAnim(AnimatorSet animatorset, long l1) {
    if (animatorset != null) {
        if (animatorset.isStarted()) {
            animatorset.end();
        }/*  ww  w .j  a v a 2s. co  m*/
        Iterator iterator = animatorset.getChildAnimations().iterator();
        do {
            if (!iterator.hasNext()) {
                break;
            }
            Animator animator = (Animator) iterator.next();
            long l2 = l1 - animator.getStartDelay();
            if (l2 < 0L) {
                l2 = 0L;
            }
            if (animator instanceof ValueAnimator) {
                ((ValueAnimator) animator).setCurrentPlayTime(l2);
            }
        } while (true);
    }
}