Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

androidx.compose.foundation.text

Classes

InlineTextContent

A data class that stores a composable to be inserted into the text layout.

KeyboardOptions

The keyboard configuration options for TextFields.

Top-level functions summary

Unit
BasicText(text: String, modifier: Modifier = Modifier, style: TextStyle = TextStyle.Default, onTextLayout: (TextLayoutResult) -> Unit = {}, overflow: TextOverflow = TextOverflow.Clip, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE)

Basic element that displays text and provides semantics / accessibility information.

Unit
BasicText(text: AnnotatedString, modifier: Modifier = Modifier, style: TextStyle = TextStyle.Default, onTextLayout: (TextLayoutResult) -> Unit = {}, overflow: TextOverflow = TextOverflow.Clip, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, inlineContent: Map<String, InlineTextContent> = mapOf())

Basic element that displays text and provides semantics / accessibility information.

Unit
BasicTextField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, textStyle: TextStyle = TextStyle.Default, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, maxLines: Int = Int.MAX_VALUE, onImeActionPerformed: (ImeAction) -> Unit = {}, visualTransformation: VisualTransformation = VisualTransformation.None, onTextLayout: (TextLayoutResult) -> Unit = {}, onTextInputStarted: (SoftwareKeyboardController) -> Unit = {}, cursorColor: Color = Color.Black)

Basic composable that enables users to edit text via hardware or software keyboard, but provides no decorations like hint or placeholder.

Unit
BasicTextField(value: TextFieldValue, onValueChange: (TextFieldValue) -> Unit, modifier: Modifier = Modifier, textStyle: TextStyle = TextStyle.Default, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, maxLines: Int = Int.MAX_VALUE, onImeActionPerformed: (ImeAction) -> Unit = {}, visualTransformation: VisualTransformation = VisualTransformation.None, onTextLayout: (TextLayoutResult) -> Unit = {}, onTextInputStarted: (SoftwareKeyboardController) -> Unit = {}, cursorColor: Color = Color.Black)

Basic composable that enables users to edit text via hardware or software keyboard, but provides no decorations like hint or placeholder.

Unit
CoreText(text: AnnotatedString, modifier: Modifier = Modifier, style: TextStyle, softWrap: Boolean, overflow: TextOverflow, maxLines: Int, inlineContent: Map<String, InlineTextContent>, onTextLayout: (TextLayoutResult) -> Unit)

CoreText is a low level element that displays text with multiple different styles.

Unit
CoreTextField(value: TextFieldValue, modifier: Modifier = Modifier, onValueChange: (TextFieldValue) -> Unit, textStyle: TextStyle = TextStyle.Default, onImeActionPerformed: (ImeAction) -> Unit = {}, visualTransformation: VisualTransformation = VisualTransformation.None, onTextLayout: (TextLayoutResult) -> Unit = {}, onTextInputStarted: (SoftwareKeyboardController) -> Unit = {}, cursorColor: Color = Color.Unspecified, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, imeOptions: ImeOptions = ImeOptions.Default)

Base composable that enables users to edit text via hardware or software keyboard.

Extension functions summary

For Builder
Unit
AnnotatedString.Builder.appendInlineContent(id: String, alternateText: String = REPLACEMENT_CHAR)

Append an inline content into the AnnotatedString.

For SemanticsPropertyReceiver
Unit

Whether the component supports input methods.

Extension properties summary

For SemanticsPropertyReceiver
ImeAction

Contains the IME action provided by the node.

Top-level functions

BasicText

@Composable fun BasicText(
    text: String,
    modifier: Modifier = Modifier,
    style: TextStyle = TextStyle.Default,
    onTextLayout: (TextLayoutResult) -> Unit = {},
    overflow: TextOverflow = TextOverflow.Clip,
    softWrap: Boolean = true,
    maxLines: Int = Int.MAX_VALUE
): Unit

Basic element that displays text and provides semantics / accessibility information.

Parameters
text: String The text to be displayed.
modifier: Modifier = Modifier Modifier to apply to this layout node.
style: TextStyle = TextStyle.Default Style configuration for the text such as color, font, line height etc.
onTextLayout: (TextLayoutResult) -> Unit = {} Callback that is executed when a new text layout is calculated.
overflow: TextOverflow = TextOverflow.Clip How visual overflow should be handled.
softWrap: Boolean = true Whether the text should break at soft line breaks. If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. If softWrap is false, overflow and TextAlign may have unexpected effects.
maxLines: Int = Int.MAX_VALUE An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow and softWrap. If it is not null, then it must be greater than zero.

BasicText

@Composable fun BasicText(
    text: AnnotatedString,
    modifier: Modifier = Modifier,
    style: TextStyle = TextStyle.Default,
    onTextLayout: (TextLayoutResult) -> Unit = {},
    overflow: TextOverflow = TextOverflow.Clip,
    softWrap: Boolean = true,
    maxLines: Int = Int.MAX_VALUE,
    inlineContent: Map<String, InlineTextContent> = mapOf()
): Unit

Basic element that displays text and provides semantics / accessibility information.

Parameters
text: AnnotatedString The text to be displayed.
modifier: Modifier = Modifier Modifier to apply to this layout node.
style: TextStyle = TextStyle.Default Style configuration for the text such as color, font, line height etc.
onTextLayout: (TextLayoutResult) -> Unit = {} Callback that is executed when a new text layout is calculated.
overflow: TextOverflow = TextOverflow.Clip How visual overflow should be handled.
softWrap: Boolean = true Whether the text should break at soft line breaks. If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. If softWrap is false, overflow and TextAlign may have unexpected effects.
maxLines: Int = Int.MAX_VALUE An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to overflow and softWrap. If it is not null, then it must be greater than zero.
inlineContent: Map<String, InlineTextContent> = mapOf() A map store composables that replaces certain ranges of the text. It's used to insert composables into text layout. Check InlineTextContent for more information.

BasicTextField

@Composable fun BasicTextField(
    value: String,
    onValueChange: (String) -> Unit,
    modifier: Modifier = Modifier,
    textStyle: TextStyle = TextStyle.Default,