@@ -34,14 +34,15 @@ fun rememberReorderableLazyGridState(
3434 onMove : (ItemPosition , ItemPosition ) -> Unit ,
3535 gridState : LazyGridState = rememberLazyGridState(),
3636 canDragOver : ((draggedOver: ItemPosition , dragging: ItemPosition ) -> Boolean )? = null,
37+ onDragStart : ((startIndex: Int , x: Int , y: Int ) -> (Unit ))? = null,
3738 onDragEnd : ((startIndex: Int , endIndex: Int ) -> (Unit ))? = null,
3839 maxScrollPerFrame : Dp = 20.dp,
3940 dragCancelledAnimation : DragCancelledAnimation = SpringDragCancelledAnimation ()
4041): ReorderableLazyGridState {
4142 val maxScroll = with (LocalDensity .current) { maxScrollPerFrame.toPx() }
4243 val scope = rememberCoroutineScope()
4344 val state = remember(gridState) {
44- ReorderableLazyGridState (gridState, scope, maxScroll, onMove, canDragOver, onDragEnd, dragCancelledAnimation)
45+ ReorderableLazyGridState (gridState, scope, maxScroll, onMove, canDragOver, onDragStart, onDragEnd, dragCancelledAnimation)
4546 }
4647 LaunchedEffect (state) {
4748 state.visibleItemsChanged()
@@ -63,9 +64,10 @@ class ReorderableLazyGridState(
6364 maxScrollPerFrame : Float ,
6465 onMove : (fromIndex: ItemPosition , toIndex: ItemPosition ) -> (Unit ),
6566 canDragOver : ((draggedOver: ItemPosition , dragging: ItemPosition ) -> Boolean )? = null ,
67+ onDragStart : ((startIndex: Int , x: Int , y: Int ) -> (Unit ))? = null ,
6668 onDragEnd : ((startIndex: Int , endIndex: Int ) -> (Unit ))? = null ,
6769 dragCancelledAnimation : DragCancelledAnimation = SpringDragCancelledAnimation ()
68- ) : ReorderableState<LazyGridItemInfo>(scope, maxScrollPerFrame, onMove, canDragOver, onDragEnd, dragCancelledAnimation) {
70+ ) : ReorderableState<LazyGridItemInfo>(scope, maxScrollPerFrame, onMove, canDragOver, onDragStart, onDragEnd, dragCancelledAnimation) {
6971 override val isVerticalScroll: Boolean
7072 get() = gridState.layoutInfo.orientation == Orientation .Vertical
7173 override val LazyGridItemInfo .left: Int
0 commit comments