DragSelectState

constructor(gridState: LazyGridState, initialIndex: Int, initialSelection: List<Item>)

A state object that can be hoisted to control and observe selected items.

In most cases, this will be created via rememberDragSelectState.

Parameters

Item

The type of the items in the list.

gridState

The LazyGridState that will be used to control the items in the grid.

initialIndex

The initial index of the item that was long pressed.

initialSelection

The initial selection of items.


constructor(initialSelection: List<Item>, gridState: LazyGridState, compareSelector: (Item) -> Any, dragState: DragState)

Parameters

Item

The type of the items in the list.

initialSelection

The initial selection of items.

gridState

The LazyGridState that will be used to control the items in the grid.

dragState

The current drag state.

compareSelector

A factory for selecting a property of Item to compare.