lib-manipulation/src/main/java/com/nhaarman/listviewanimations/itemmanipulation/dragdrop/DragAndDropHandler.java
private boolean handleMoveEvent(@NonNull final MotionEvent event) {
        boolean handled = false;

        float deltaX = event.getRawX() - mDownX;
        float deltaY = event.getRawY() - mDownY;

        if (mHoverDrawable == null && Math.abs(deltaY) > mSlop && Math.abs(deltaY) > Math.abs(deltaX)) {
            int position = mWrapper.pointToPosition((int) event.getX(), (int) event.getY());
            if (position != AdapterView.INVALID_POSITION) {
                View downView = mWrapper.getChildAt(position - mWrapper.getFirstVisiblePosition());
                assert downView != null;
                if (mDraggableManager.isDraggable(downView, position - mWrapper.getHeaderViewsCount(), event.getX() - downView.getX(), event.getY() - downView.getY())) {
                    startDragging(position - mWrapper.getHeaderViewsCount());
                    handled = true;
                }
            }
        } else if (mHoverDrawable != null) {
            mHoverDrawable.handleMoveEvent(event);

            switchIfNecessary();
            mWrapper.getListView().invalidate();
            handled = true;
        }

        return handled;
    }
private boolean handleMoveEvent(@NonNull final MotionEvent event) {
        boolean handled = false;

        float deltaX = event.getRawX() - mDownX;
        float deltaY = event.getRawY() - mDownY;

        if (mHoverDrawable == null && Math.abs(deltaY) > mSlop && Math.abs(deltaY) > Math.abs(deltaX)) {
            int position = mWrapper.pointToPosition((int) event.getX(), (int) event.getY());
            if (position != AdapterView.INVALID_POSITION) {
                View downView = mWrapper.getChildAt(position - mWrapper.getFirstVisiblePosition());
                assert downView != null;
                if (mDraggableManager.isDraggable(downView, position - mWrapper.getHeaderViewsCount(), event.getX() - downView.getX(), event.getY() - downView.getY())) {
                    startDragging(position - mWrapper.getHeaderViewsCount());
                    handled = true;
                }
            }
        } else if (mHoverDrawable != null) {
            mHoverDrawable.handleMoveEvent(event);

            switchIfNecessary();
            mWrapper.getListView().invalidate();
            handled = true;
        }

        return handled;
    }
private boolean handleMoveEvent ( @ NonNull final MotionEvent event ) { boolean handled = false ; float deltaX = event . getRawX ( ) - mDownX ; float deltaY = event . getRawY ( ) - mDownY ; if ( mHoverDrawable == null && Math . abs ( deltaY ) > mSlop && Math . abs ( deltaY ) > Math . abs ( deltaX ) ) { int position = mWrapper . pointToPosition ( ( int ) event . getX ( ) , ( int ) event . getY ( ) ) ; if ( position != AdapterView . INVALID_POSITION ) { View downView = mWrapper . getChildAt ( position - mWrapper . getFirstVisiblePosition ( ) ) ; assert downView != null ; if ( mDraggableManager . isDraggable ( downView , position - mWrapper . getHeaderViewsCount ( ) , event . getX ( ) - downView . getX ( ) , event . getY ( ) - downView . getY ( ) ) ) { startDragging ( position - mWrapper . getHeaderViewsCount ( ) ) ; handled = true ; } } } else if ( mHoverDrawable != null ) { mHoverDrawable . handleMoveEvent ( event ) ; switchIfNecessary ( ) ; mWrapper . getListView ( ) . invalidate ( ) ; handled = true ; } return handled ; }
Handles the move events.
<p/>
Applies the {@link MotionEvent} to the hover drawable, and switches {@code View}s if necessary.

@param event the {@code MotionEvent}.

@return {@code true} if the event was handled, {@code false} otherwise.
Handles the move events . <p / > Applies the { @link MotionEvent } to the hover drawable and switches { @code View } s if necessary .