resume animator - Android android.animation

Android examples for android.animation:Animator

Description

resume animator

Demo Code


//package com.java2s;
import android.animation.Animator;
import android.os.Build;
import java.util.List;

public class Main {
    /**/* w  w  w.j  ava2s .  co  m*/
     * resume animator
     *
     * @param animators
     * @return
     */
    public static boolean resume(List<Animator> animators) {
        boolean isResumeCalled = false;
        if (animators != null) {
            for (Animator animator : animators) {
                if (resume(animator)) {
                    isResumeCalled = true;
                }
            }
        }
        return isResumeCalled;
    }

    /**
     * resume
     *
     * @param animator
     */
    public static boolean resume(Animator animator) {
        if (animator != null) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                if (animator.isPaused()) {
                    animator.resume();
                    return true;
                }
            }
        }
        return false;
    }

    public static boolean isPaused(List<Animator> animators) {
        if (animators != null && animators.size() > 0) {
            boolean isAllPaused = true;
            for (Animator animator : animators) {
                if (isPaused(animator) == false) {
                    isAllPaused = false;
                }
            }
            return isAllPaused;
        }
        return false;
    }

    public static boolean isPaused(Animator animator) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            return animator != null && animator.isPaused();
        }
        return false;
    }
}

Related Tutorials