SelectableLazyListState

class SelectableLazyListState(val lazyListState: LazyListState, val selectionMode: SelectionMode = SelectionMode.None) : ScrollableState

State object for a selectable lazy list, which extends ScrollableState.

Parameters

lazyListState

The state object for the underlying lazy list.

selectionMode

The selection mode for the list.

Constructors

Link copied to clipboard
constructor(lazyListState: LazyListState, selectionMode: SelectionMode = SelectionMode.None)

Properties

Link copied to clipboard
open override val canScrollBackward: Boolean
Link copied to clipboard
open override val canScrollForward: Boolean
Link copied to clipboard

The index of the first item that is visible

Link copied to clipboard

The scroll offset of the first visible item. Scrolling forward is positive - i.e., the amount that the item is offset backwards

Link copied to clipboard
val interactionSource: InteractionSource

InteractionSource that will be used to dispatch drag events when this list is being dragged. If you want to know whether the fling (or animated scroll) is in progress, use isScrollInProgress.

Link copied to clipboard
open override val isScrollInProgress: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val layoutInfo: LazyListLayoutInfo
Link copied to clipboard
val lazyListState: LazyListState
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun addElementsToSelection(itemIndexes: List<Int>, itemToFocus: Int? = itemIndexes.lastOrNull())
Link copied to clipboard
suspend fun addElementToSelection(itemIndex: Int, changeFocus: Boolean = true, skipScroll: Boolean = false)
Link copied to clipboard
Link copied to clipboard
suspend fun deselectSingleElement(itemIndex: Int, changeFocus: Boolean = true, skipScroll: Boolean = false)
Link copied to clipboard
open override fun dispatchRawDelta(delta: Float): Float
Link copied to clipboard
suspend fun focusItem(itemIndex: Int, animateScroll: Boolean = false, scrollOffset: Int = 0, skipScroll: Boolean = false)

Focuses on the item at the specified index within the lazy list.

Link copied to clipboard
fun indexOfNextSelectable(currentIndex: Int): Int?
Link copied to clipboard
fun indexOfPreviousSelectable(currentIndex: Int): Int?
Link copied to clipboard
suspend fun onExtendSelectionToIndex(itemIndex: Int, changeFocus: Boolean = true, skipScroll: Boolean = false)
Link copied to clipboard
suspend fun removeElementsToSelection(itemIndexes: List<Int>, itemToFocus: Int? = itemIndexes.lastOrNull())
Link copied to clipboard
open suspend override fun scroll(scrollPriority: MutatePriority, block: suspend ScrollScope.() -> Unit)
Link copied to clipboard
suspend fun selectSingleItem(itemIndex: Int, changeFocus: Boolean = true, skipScroll: Boolean = false)

Selects a single item at the specified index within the lazy list.

Link copied to clipboard
suspend fun selectSingleKey(key: Any, changeFocus: Boolean = true, skipScroll: Boolean = false)

Selects a single item with the specified key within the lazy list.

Link copied to clipboard
suspend fun toggleElementsToSelection(itemIndexes: List<Int>, itemToFocus: Int? = itemIndexes.lastOrNull())
Link copied to clipboard
suspend fun toggleSelection(itemIndex: Int, skipScroll: Boolean = false)
Link copied to clipboard
suspend fun toggleSelectionKey(key: Any, skipScroll: Boolean = false)