androidx.compose.ui.selection
Interfaces
Selectable |
Provides Selection information for a composable to SelectionContainer. |
SelectionRegistrar |
An interface allowing a composable to subscribe and unsubscribe to selection changes. |
Classes
Selection |
Information about the current Selection. |
TextSelectionColors |
Represents the colors used for text selection by text and text field components. |
Top-level functions summary
Unit |
DisableSelection(content: () -> Unit) Disables text selection for it's direct or indirection children. |
Unit |
SelectionContainer(modifier: Modifier = Modifier, content: () -> Unit) Enables text selection for it's direct or indirection children. |
Unit |
SelectionContainer(modifier: Modifier = Modifier, selection: Selection?, onSelectionChange: (Selection?) -> Unit, children: () -> Unit) Selection Composable. |
Top-level properties summary
ProvidableAmbient<SelectionRegistrar?> |
Ambient of SelectionRegistrar. |
ProvidableAmbient<TextSelectionColors> |
Ambient used to change the TextSelectionColors used by text and text field components in the hierarchy. |
ProvidableAmbient<SelectionRegistrar?> |
Ambient of SelectionRegistrar. |
Top-level functions
DisableSelection
@Composable fun DisableSelection(content: () -> Unit): Unit
Disables text selection for it's direct or indirection children. To use this, simply add this to wrap one or more text composables.
import androidx.compose.foundation.layout.Column import androidx.compose.material.Text import androidx.compose.ui.selection.DisableSelection import androidx.compose.ui.selection.SelectionContainer SelectionContainer { Column { Text("Text 1") DisableSelection { Text("Text 2") Text("טקסט 3") } Text("Text 3") } }
SelectionContainer
@Composable fun SelectionContainer(
modifier: Modifier = Modifier,
content: () -> Unit
): Unit
Enables text selection for it's direct or indirection children.
import androidx.compose.foundation.layout.Column import androidx.compose.material.Text import androidx.compose.ui.selection.SelectionContainer SelectionContainer { Column { Text("Text 1") Text("Text 2") Text("טקסט 3") } }
SelectionContainer
@Composable funSelectionContainer(
modifier: Modifier = Modifier,
selection: Selection?,
onSelectionChange: (Selection?) -> Unit,
children: () -> Unit
): Unit
Deprecated.
Selection Composable.
The selection composable wraps composables and let them to be selectable. It paints the selection area with start and end handles.
Top-level properties
AmbientSelectionRegistrar
val AmbientSelectionRegistrar: ProvidableAmbient<SelectionRegistrar?>
Ambient of SelectionRegistrar. Composables that implement selection logic can use this ambient to get a SelectionRegistrar in order to subscribe and unsubscribe to SelectionRegistrar.
AmbientTextSelectionColors
val AmbientTextSelectionColors: ProvidableAmbient<TextSelectionColors>
Ambient used to change the TextSelectionColors used by text and text field components in the hierarchy.
SelectionRegistrarAmbient
valSelectionRegistrarAmbient: ProvidableAmbient<SelectionRegistrar?>
Deprecated.
Ambient of SelectionRegistrar. Composables that implement selection logic can use this ambient to get a SelectionRegistrar in order to subscribe and unsubscribe to SelectionRegistrar.