Skip to content

added new call back to handle when the dragged view is dropped #31

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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;
        }
    });

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants