@Override public int getHeight() { return mContainerView.getHeight(); }
@Override public int getHeight() { return mContainerView.getHeight(); }
@Override public void onDraw(Canvas canvas) { if (getWidth() == 0 || getHeight() == 0) { return; } if (mIsSplit) { if (mSplitBackground != null) mSplitBackground.draw(canvas); } else { if (mBackground != null) { mBackground.draw(canvas); } if (mStackedBackground != null && mIsStacked) { mStackedBackground.draw(canvas); } } }
@Override public void onDraw(Canvas canvas) { if (getWidth() == 0 || getHeight() == 0) { return; } if (mIsSplit) { if (mSplitBackground != null) mSplitBackground.draw(canvas); } else { if (mBackground != null) { mBackground.draw(canvas); } if (mStackedBackground != null && mIsStacked) { mStackedBackground.draw(canvas); } } }
@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); } }