Package 

Interface ItemTouchHelper.ViewDropHandler

    • Method Summary

      Modifier and Type Method Description
      abstract void prepareForDrop(@NonNull() View view, @NonNull() View target, int x, int y) Called by the ItemTouchHelper after a View is dropped over another View.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • prepareForDrop

         abstract void prepareForDrop(@NonNull() View view, @NonNull() View target, int x, int y)

        Called by the ItemTouchHelper after a View is dropped over another View.

        A LayoutManager should implement this interface to get ready for the upcoming moveoperation.

        For example, LinearLayoutManager sets up a "scrollToPositionWithOffset" calls so thatthe View under drag will be used as an anchor View while calculating the next layout,making layout stay consistent.

        Parameters:
        view - The View which is being dragged.
        target - The target view which is being dropped on.
        x - The left offset of the View that is being dragged.
        y - The top offset of the View that is being dragged.