* animating.
*/
private boolean mOnlyScrollingInThisMotion;
+ private boolean mDisallowDismissInThisMotion;
private boolean mInterceptDelegateEnabled;
private boolean mDelegateToScrollView;
private boolean mDisallowScrollingInThisMotion;
if (!mIsBeingDragged
&& !mExpandingNotification
&& !mExpandedInThisMotion
- && !mOnlyScrollingInThisMotion) {
+ && !mOnlyScrollingInThisMotion
+ && !mDisallowDismissInThisMotion) {
horizontalSwipeWantsIt = mSwipeHelper.onTouchEvent(ev);
}
return horizontalSwipeWantsIt || scrollerWantsIt || expandWantsIt || super.onTouchEvent(ev);
if (!mIsBeingDragged
&& !mExpandingNotification
&& !mExpandedInThisMotion
- && !mOnlyScrollingInThisMotion) {
+ && !mOnlyScrollingInThisMotion
+ && !mDisallowDismissInThisMotion) {
swipeWantsIt = mSwipeHelper.onInterceptTouchEvent(ev);
}
return swipeWantsIt || scrollWantsIt || expandWantsIt || super.onInterceptTouchEvent(ev);
mExpandedInThisMotion = false;
mOnlyScrollingInThisMotion = !mScroller.isFinished();
mDisallowScrollingInThisMotion = false;
+ mDisallowDismissInThisMotion = false;
mTouchIsClick = true;
mInitialTouchX = ev.getX();
mInitialTouchY = ev.getY();
removeLongPressCallback();
}
+ @Override
+ public void requestDisallowDismiss() {
+ mDisallowDismissInThisMotion = true;
+ }
+
public void removeLongPressCallback() {
mSwipeHelper.removeLongPressCallback();
}