dragSelectToggleable

fun <Item> Modifier.dragSelectToggleable(state: DragSelectState<Item>, item: Item, interactionSource: MutableInteractionSource? = null): Modifier

A toggleable modifier that is only enabled when DragSelectState.inSelectionMode is true.

This is useful for enabling selection when the user is in selection mode.

Parameters

state

The DragSelectState that will be used to determine if the user is in selection mode and selection state of item.

item

The item that will be selected or deselected when the toggleable is toggled.

interactionSource

the MutableInteractionSource that will be used to emit PressInteraction.Press when this toggleable is being pressed.


fun Modifier.dragSelectToggleable(inSelectionMode: Boolean, selected: Boolean, interactionSource: MutableInteractionSource? = null, onToggle: (toggled: Boolean) -> Unit): Modifier

A toggleable modifier that is only enabled when inSelectionMode is true.

This is useful for enabling selection when the user is in selection mode.

Parameters

inSelectionMode

Whether the user is in selection mode.

selected

Whether the item is selected.

interactionSource

the MutableInteractionSource that will be used to emit PressInteraction.Press when this toggleable is being pressed.

onToggle

Called when the toggleable is toggled.