interface Selectable

Provides Selection information for a composable to SelectionContainer. Composables who can be selected should subscribe to SelectionRegistrar using this interface.


Public methods

abstract Selection?
getSelection(startPosition: PxPosition, endPosition: PxPosition, containerLayoutCoordinates: LayoutCoordinates, longPress: Boolean)

Returns Selection information for a selectable composable.

Public methods


abstract fun getSelection(
    startPosition: PxPosition,
    endPosition: PxPosition,
    containerLayoutCoordinates: LayoutCoordinates,
    longPress: Boolean
): Selection?

Returns Selection information for a selectable composable. If no selection can be provided null should be returned.

startPosition: PxPosition graphical position of the start of the selection
endPosition: PxPosition graphical position of the end of the selection
containerLayoutCoordinates: LayoutCoordinates LayoutCoordinates of the widget
longPress: Boolean true represents that selection is either initiated via a long press or being dragged after long press
null if no selection will be applied for this composable, or Selection instance if selection is applied to this composable.