The Developer Preview for Android 11 is now available; test it out and share your feedback.

SelectionRegistrar

interface SelectionRegistrar
androidx.ui.core.selection.SelectionRegistrar

An interface allowing a composable to subscribe and unsubscribe to selection changes.

Summary

Public methods

abstract Unit

When the Global Position of a subscribed Selectable changes, this method is called.

abstract Selectable
subscribe(selectable: Selectable)

Subscribe to SelectionContainer selection changes.

abstract Unit
unsubscribe(selectable: Selectable)

Unsubscribe from SelectionContainer selection changes.

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Public methods

onPositionChange

abstract fun onPositionChange(): Unit

When the Global Position of a subscribed Selectable changes, this method is called.

subscribe

abstract fun subscribe(selectable: Selectable): Selectable

Subscribe to SelectionContainer selection changes.

unsubscribe

abstract fun unsubscribe(selectable: Selectable): Unit

Unsubscribe from SelectionContainer selection changes.