Merge "Fix bug with cancelled drag" into nyc-dev

This commit is contained in:
Jorim Jaggi
2016-04-25 20:59:38 +00:00
committed by Android (Google) Code Review

View File

@@ -257,8 +257,12 @@ public class RecentsViewTouchHandler {
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL: { case MotionEvent.ACTION_CANCEL: {
if (mDragRequested) { if (mDragRequested) {
boolean cancelled = action == MotionEvent.ACTION_CANCEL;
if (cancelled) {
EventBus.getDefault().send(new DragDropTargetChangedEvent(mDragTask, null));
}
EventBus.getDefault().send(new DragEndEvent(mDragTask, mTaskView, EventBus.getDefault().send(new DragEndEvent(mDragTask, mTaskView,
action == MotionEvent.ACTION_UP ? mLastDropTarget : null)); !cancelled ? mLastDropTarget : null));
break; break;
} }
} }