Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

ACTION_CANCEL was doing the same as ACTION_UP #115

Closed
wants to merge 3 commits into from

Conversation

wdullaer
Copy link

@wdullaer wdullaer commented Jan 7, 2014

This causes issues when a parent view tries to steal a MotionEvent using onInterceptTouchEvent (such as a DrawerLayout opening the side menu).

I've added an implementation for ACTION_CANCEL (looking at the latest romannurik code). This solves issue #65 on your issue tracker.

I hope I did this pull request right, I'm a bit new to the entire Github thing.

@nhaarman
Copy link
Owner

nhaarman commented Jan 8, 2014

Thanks! However, #65 doesn't have anything to do with swipedismiss. Do you mean #64 ?

@wdullaer
Copy link
Author

wdullaer commented Jan 8, 2014

Yes indeed #64. I must have made a typo.
Op 8 jan. 2014 14:24 schreef "Niek Haarman" notifications@github.com:

Thanks! However, #65https://github.com/nhaarman/ListViewAnimations/issues/65doesn't have anything to do with swipedismiss. Do you mean
#64 https://github.com/nhaarman/ListViewAnimations/issues/64 ?


Reply to this email directly or view it on GitHubhttps://github.com//pull/115#issuecomment-31830315
.

@nhaarman
Copy link
Owner

cb9b979 & 55e6dca

@nhaarman nhaarman closed this Feb 10, 2014
@ishish
Copy link

ishish commented Jul 30, 2014

Note only the change for SwipeDismissListViewTouchListener was taken from the Pull request. The issue still occurs for the ContextualUndoListViewTouchListener. I split the up and cancel and sent the Cancel event to the following method:

private boolean handleCancelEvent(final View view, final MotionEvent motionEvent)
{
     if (mVelocityTracker == null) {
         return false;
      }

      if (mDownView != null && mSwiping) {
          // cancel
          animate(mDownView).translationX(0).alpha(1).setDuration(mAnimationTime).setListener(null);
      }

      mVelocityTracker.recycle();
      mVelocityTracker = null;
      mDownX = 0;
      mDownY = 0;
      mDownView = null;
      mDownPosition = ListView.INVALID_POSITION;
      mSwiping = false;
      return false;

}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants