private void finishAnimation() { final Animator a = mCurrentAnimation; if (a != null) { mCurrentAnimation = null; a.end(); } }
private void finishAnimation() { final Animator a = mCurrentAnimation; if (a != null) { mCurrentAnimation = null; a.end(); } }
/** * Enables or disables animation between show/hide states. * If animation is disabled using this method, animations in progress * will be finished. * * @param enabled true to animate, false to not animate. */ public void setShowHideAnimationEnabled(boolean enabled) { mShowHideAnimationEnabled = enabled; if (!enabled && mCurrentShowAnim != null) { mCurrentShowAnim.end(); } }
/** * Enables or disables animation between show/hide states. * If animation is disabled using this method, animations in progress * will be finished. * * @param enabled true to animate, false to not animate. */ public void setShowHideAnimationEnabled(boolean enabled) { mShowHideAnimationEnabled = enabled; if (!enabled && mCurrentShowAnim != null) { mCurrentShowAnim.end(); } }
@Override public void setVisibility(int visibility) { if (mVisibilityAnim != null) { mVisibilityAnim.end(); } super.setVisibility(visibility); }
@Override public void setVisibility(int visibility) { if (mVisibilityAnim != null) { mVisibilityAnim.end(); } super.setVisibility(visibility); }
node.animation.end();
node.animation.end();
void animateToMode(boolean toActionMode) { if (toActionMode) { show(false); } if (mCurrentModeAnim != null) { mCurrentModeAnim.end(); } mActionView.animateToVisibility(toActionMode ? View.GONE : View.VISIBLE); mContextView.animateToVisibility(toActionMode ? View.VISIBLE : View.GONE); if (mTabScrollView != null && !mActionView.hasEmbeddedTabs() && mActionView.isCollapsed()) { mTabScrollView.animateToVisibility(toActionMode ? View.GONE : View.VISIBLE); } }
void animateToMode(boolean toActionMode) { if (toActionMode) { show(false); } if (mCurrentModeAnim != null) { mCurrentModeAnim.end(); } mActionView.animateToVisibility(toActionMode ? View.GONE : View.VISIBLE); mContextView.animateToVisibility(toActionMode ? View.VISIBLE : View.GONE); if (mTabScrollView != null && !mActionView.hasEmbeddedTabs() && mActionView.isCollapsed()) { mTabScrollView.animateToVisibility(toActionMode ? View.GONE : View.VISIBLE); } }
@Override public void hide() { if (mCurrentShowAnim != null) { mCurrentShowAnim.end(); } if (mContainerView.getVisibility() == View.GONE) { return; } if (mShowHideAnimationEnabled) { mContainerView.setAlpha(1); mContainerView.setTransitioning(true); AnimatorSet anim = new AnimatorSet(); AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mContainerView, "alpha", 0)); if (mContentView != null) { b.with(ObjectAnimator.ofFloat(mContentView, "translationY", 0, -mContainerView.getHeight())); b.with(ObjectAnimator.ofFloat(mContainerView, "translationY", -mContainerView.getHeight())); } if (mSplitView != null && mSplitView.getVisibility() == View.VISIBLE) { mSplitView.setAlpha(1); b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 0)); } anim.addListener(mHideListener); mCurrentShowAnim = anim; anim.start(); } else { mHideListener.onAnimationEnd(null); } }
@Override public void hide() { if (mCurrentShowAnim != null) { mCurrentShowAnim.end(); } if (mContainerView.getVisibility() == View.GONE) { return; } if (mShowHideAnimationEnabled) { mContainerView.setAlpha(1); mContainerView.setTransitioning(true); AnimatorSet anim = new AnimatorSet(); AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mContainerView, "alpha", 0)); if (mContentView != null) { b.with(ObjectAnimator.ofFloat(mContentView, "translationY", 0, -mContainerView.getHeight())); b.with(ObjectAnimator.ofFloat(mContainerView, "translationY", -mContainerView.getHeight())); } if (mSplitView != null && mSplitView.getVisibility() == View.VISIBLE) { mSplitView.setAlpha(1); b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 0)); } anim.addListener(mHideListener); mCurrentShowAnim = anim; anim.start(); } else { mHideListener.onAnimationEnd(null); } }
void show(boolean markHiddenBeforeMode) { if (mCurrentShowAnim != null) { mCurrentShowAnim.end();
void show(boolean markHiddenBeforeMode) { if (mCurrentShowAnim != null) { mCurrentShowAnim.end();