Java Code Examples for android.animation.Animator#pause()
The following examples show how to use
android.animation.Animator#pause() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Transition.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
/** * Pauses this transition, sending out calls to {@link * TransitionListener#onTransitionPause(Transition)} to all listeners * and pausing all running animators started by this transition. * * @hide */ public void pause(View sceneRoot) { if (!mEnded) { ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators(); int numOldAnims = runningAnimators.size(); if (sceneRoot != null) { WindowId windowId = sceneRoot.getWindowId(); for (int i = numOldAnims - 1; i >= 0; i--) { AnimationInfo info = runningAnimators.valueAt(i); if (info.view != null && windowId != null && windowId.equals(info.windowId)) { Animator anim = runningAnimators.keyAt(i); anim.pause(); } } } if (mListeners != null && mListeners.size() > 0) { ArrayList<TransitionListener> tmpListeners = (ArrayList<TransitionListener>) mListeners.clone(); int numListeners = tmpListeners.size(); for (int i = 0; i < numListeners; ++i) { tmpListeners.get(i).onTransitionPause(this); } } mPaused = true; } }
Example 2
Source File: AnimUtils.java From Android-utils with Apache License 2.0 | 5 votes |
public static void clearValueAnimator(Animator animator) { if (animator != null) { animator.removeAllListeners(); if (animator instanceof ValueAnimator) { ((ValueAnimator) animator).removeAllUpdateListeners(); } if (Build.VERSION.SDK_INT >= 19) { animator.pause(); } animator.cancel(); } }
Example 3
Source File: AnimatorUtil.java From VideoOS-Android-SDK with GNU General Public License v3.0 | 5 votes |
/** * 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; }
Example 4
Source File: AnimatorUtils.java From Transitions-Everywhere with Apache License 2.0 | 4 votes |
@Override public void pause(@NonNull Animator animator) { animator.pause(); }