cancel Animator - Android android.animation

Android examples for android.animation:Animator

Description

cancel Animator

Demo Code


//package com.java2s;
import android.animation.Animator;

import java.util.List;

public class Main {
    /**/*from   www.j  a  va 2 s  .c  o  m*/
     * cancel
     *
     * @param animators
     * @return
     */
    public static boolean cancel(List<Animator> animators) {
        boolean isCancelCalled = false;
        if (animators != null) {
            for (Animator animator : animators) {
                if (cancel(animator)) {
                    isCancelCalled = true;
                }
            }
        }
        return isCancelCalled;
    }

    /**
     * cancel
     *
     * @param animator
     * @return
     */
    public static boolean cancel(Animator animator) {
        if (animator != null) {
            animator.cancel();
            return true;
        }
        return false;
    }
}

Related Tutorials