rememberDragSelectState

fun <Item> rememberDragSelectState(lazyGridState: LazyGridState = rememberLazyGridState(), initialSelection: List<Item> = emptyList()): DragSelectState<Item>

Creates a DragSelectState that is remembered across compositions.

Changes to the provided initial values will not result in the state being recreated or changed in any way if it has already been created.

Return

A DragSelectState that can be used to control the selection.

Parameters

Item

The type of the items in the list.

lazyGridState

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

initialSelection

The initial selection of items.


fun <Item> rememberDragSelectState(compareSelector: (Item) -> Any = { it as Any }, lazyGridState: LazyGridState = rememberLazyGridState(), initialSelection: List<Item> = emptyList()): DragSelectState<Item>

Creates a DragSelectState that is remembered across compositions.

Changes to the provided initial values will not result in the state being recreated or changed in any way if it has already been created.

Return

A DragSelectState that can be used to control the selection.

Parameters

Item

The type of the items in the list.

lazyGridState

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

initialSelection

The initial selection of items.

compareSelector

A factory for selecting a property of Item to compare.