-
public interface ItemTouchHelper.ViewDropHandler
An interface which can be implemented by LayoutManager for better integration with ItemTouchHelper.
-
-
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. -
-
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
- Theleft
offset of the View that is being dragged.y
- Thetop
offset of the View that is being dragged.
-
-
-
-