Java tutorial
//package com.java2s; //License from project: Apache License import android.animation.Animator; import android.os.Build; import java.util.List; public class Main { /** * pause animation * * @param animators * @return */ public static boolean pause(List<Animator> animators) { boolean isPauseCalled = false; if (animators != null) { for (Animator animator : animators) { if (pause(animator)) { isPauseCalled = true; } } } return isPauseCalled; } /** * pause * * @param animator */ public static boolean pause(Animator animator) { if (animator != null) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (!animator.isPaused()) { animator.pause(); 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; } }