mContainerView.setAlpha(0); AnimatorSet anim = new AnimatorSet(); AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mContainerView, "alpha", 1)); mSplitView.setAlpha(0); mSplitView.setVisibility(View.VISIBLE); b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 1)); anim.start(); } else { mContainerView.setAlpha(1); mContainerView.setTranslationY(0); mShowListener.onAnimationEnd(null);
mContainerView.setAlpha(0); AnimatorSet anim = new AnimatorSet(); AnimatorSet.Builder b = anim.play(ObjectAnimator.ofFloat(mContainerView, "alpha", 1)); mSplitView.setAlpha(0); mSplitView.setVisibility(View.VISIBLE); b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 1)); anim.start(); } else { mContainerView.setAlpha(1); mContainerView.setTranslationY(0); mShowListener.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); } }
@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); } }