Skip to content

Conversation

@SiavashB
Copy link

This allows the user to distinguish between a swap that happened as a result of the dragged item passing through other items, and a swap that happened when the item was dropped into its final position (finger was lifted off the screen).

This is useful for when as a result of the items swapping, an expensive operation is performed, and we want to avoid unnecessary calls to that operation.

@vanlooverenkoen
Copy link

vanlooverenkoen commented Sep 11, 2016

awesome, this was my solution.

 mDragLayout.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (MotionEventCompat.getActionMasked(motionEvent) == MotionEvent.ACTION_UP) {
                updatePreviewsCallback.executeCallback();
            }
            return false;
        }
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants