Selectable

interface Selectable
androidx.ui.core.selection.Selectable

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

Summary

Public methods

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

Returns Selection information for a selectable composable.

Public methods

getSelection

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.

Parameters
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
Return
null if no selection will be applied for this composable, or Selection instance if selection is applied to this composable.