BasicReadMoreText

fun BasicReadMoreText(text: String, expanded: Boolean, modifier: Modifier = Modifier, onExpandedChange: (Boolean) -> Unit? = null, contentPadding: PaddingValues = PaddingValues(0.dp), style: TextStyle = TextStyle.Default, onTextLayout: (TextLayoutResult) -> Unit = {}, softWrap: Boolean = true, readMoreText: String = "", readMoreMaxLines: Int = 2, readMoreOverflow: ReadMoreTextOverflow = ReadMoreTextOverflow.Ellipsis, readMoreStyle: SpanStyle = style.toSpanStyle(), readLessText: String = "", readLessStyle: SpanStyle = readMoreStyle, toggleArea: ToggleArea = ToggleArea.All)
fun BasicReadMoreText(text: AnnotatedString, expanded: Boolean, modifier: Modifier = Modifier, onExpandedChange: (Boolean) -> Unit? = null, contentPadding: PaddingValues = PaddingValues(0.dp), style: TextStyle = TextStyle.Default, onTextLayout: (TextLayoutResult) -> Unit = {}, softWrap: Boolean = true, readMoreText: String = "", readMoreMaxLines: Int = 2, readMoreOverflow: ReadMoreTextOverflow = ReadMoreTextOverflow.Ellipsis, readMoreStyle: SpanStyle = style.toSpanStyle(), readLessText: String = "", readLessStyle: SpanStyle = readMoreStyle, toggleArea: ToggleArea = ToggleArea.All)

Basic element that displays text with read more. Typically you will instead want to use com.webtoonscorp.android.readmore.material.ReadMoreText, which is a higher level Text element that contains semantics and consumes style information from a theme.

Parameters

text

The text to be displayed.

expanded

whether this text is expanded or collapsed.

modifier

Modifier to apply to this layout node.

onExpandedChange

called when this text is clicked. If null, then this text will not be interactable, unless something else handles its input events and updates its state.

contentPadding

a padding around the text.

style

Style configuration for the text such as color, font, line height etc.

onTextLayout

Callback that is executed when a new text layout is calculated. A TextLayoutResult object that callback provides contains paragraph information, size of the text, baselines and other details. The callback can be used to add additional decoration or functionality to the text. For example, to draw selection around the text.

softWrap

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, readMoreOverflow and TextAlign may have unexpected effects.

readMoreText

The read more text to be displayed in the collapsed state.

readMoreMaxLines

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 readMoreOverflow. If it is not null, then it must be greater than zero.

readMoreOverflow

How visual overflow should be handled in the collapsed state.

readMoreStyle

Style configuration for the read more text such as color, font, line height etc.

readLessText

The read less text to be displayed in the expanded state.

readLessStyle

Style configuration for the read less text such as color, font, line height etc.

toggleArea

A clickable area of text to toggle.