/** * Open the panel to show the secondary view * @param animation true to animate the open motion. {@link SwipeListener} won't be * called if is animation is false. */ public void open(bool animation) { CoreUtility.ExecuteMethod("open", delegate() { mIsOpenBeforeInit = true; mAborted = false; if (animation) { mState = STATE_OPENING; mDragHelper.SmoothSlideViewTo(mMainView, mRectMainOpen.Left, mRectMainOpen.Top); if (mDragStateChangeListener != null) { mDragStateChangeListener.onDragStateChanged(mState); } } else { mState = STATE_OPEN; mDragHelper.Abort(); mMainView.Layout( mRectMainOpen.Left, mRectMainOpen.Top, mRectMainOpen.Right, mRectMainOpen.Bottom ); mSecondaryView.Layout( mRectSecOpen.Left, mRectSecOpen.Top, mRectSecOpen.Right, mRectSecOpen.Bottom ); } ViewCompat.PostInvalidateOnAnimation(this); }); }
public override void ComputeScroll() { if (!_dragHelper.ContinueSettling(true)) { return; } if (!_canSlide) { _dragHelper.Abort(); return; } ViewCompat.PostInvalidateOnAnimation(this); }