Class DragToReorder
-
- All Implemented Interfaces:
public final class DragToReorder
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> Modifier
dragToReorder(Modifier $self, T item, List<T> itemList, Integer itemHeight, Function2<T, SlideState, Unit> updateSlideState, Function1<Integer, Unit> onStartDrag, Function3<Float, Integer, Integer, Unit> onDrag, Function2<Integer, Integer, Unit> onStopDrag)
Adds a drag-to-reorder functionality to the given modifier. final static Modifier
indicateAsDragged(Modifier $self, Boolean isDragged)
-
-
Method Detail
-
dragToReorder
final static <T extends Any> Modifier dragToReorder(Modifier $self, T item, List<T> itemList, Integer itemHeight, Function2<T, SlideState, Unit> updateSlideState, Function1<Integer, Unit> onStartDrag, Function3<Float, Integer, Integer, Unit> onDrag, Function2<Integer, Integer, Unit> onStopDrag)
Adds a drag-to-reorder functionality to the given modifier.
- Parameters:
item
- The item to be dragged.itemList
- The list of items to which the item belongs.itemHeight
- The height of each item in the list in pixels.updateSlideState
- A callback function to update the slide state of an item.onStartDrag
- A callback function to be invoked when the drag operation starts and provides the starting index.onDrag
- A callback function to be invoked during the dragging operationonStopDrag
- A callback function to be invoked when the drag operation ends.- Returns:
A modifier that adds drag-to-reorder functionality.
-
indicateAsDragged
final static Modifier indicateAsDragged(Modifier $self, Boolean isDragged)
-
-
-
-