Google is committed to advancing racial equity for Black communities. See how.

MultiParagraphIntrinsics

class MultiParagraphIntrinsics : ParagraphIntrinsics
kotlin.Any
   ↳ androidx.compose.ui.text.MultiParagraphIntrinsics

Calculates and provides the intrinsic width and height of text that contains ParagraphStyle.

Summary

Public constructors
<init>(annotatedString: AnnotatedString, style: TextStyle, placeholders: List<AnnotatedString.Range<Placeholder>>, density: Density, resourceLoader: Font.ResourceLoader)

Calculates and provides the intrinsic width and height of text that contains ParagraphStyle.

Properties
AnnotatedString

the text to be laid out

Float

Returns the smallest width beyond which increasing the width never decreases the height.

Float

The width for text if all soft wrap opportunities were taken.

List<AnnotatedString.Range<Placeholder>>

a list of Placeholders that specify ranges of text which will be skipped during layout and replaced with Placeholder.

Public constructors

<init>

MultiParagraphIntrinsics(
    annotatedString: AnnotatedString,
    style: TextStyle,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    density: Density,
    resourceLoader: Font.ResourceLoader)

Calculates and provides the intrinsic width and height of text that contains ParagraphStyle.

Parameters
annotatedString: AnnotatedString the text to be laid out
style: TextStyle the TextStyle to be applied to the whole text
placeholders: List<AnnotatedString.Range<Placeholder>> a list of Placeholders that specify ranges of text which will be skipped during layout and replaced with Placeholder. It's required that the range of each Placeholder doesn't cross paragraph boundary, otherwise IllegalArgumentException is thrown.
density: Density density of the device
resourceLoader: Font.ResourceLoader Font.ResourceLoader to be used to load the font given in SpanStyles
Exceptions
IllegalArgumentException if ParagraphStyle.textDirection is not set, or any of the placeholders crosses paragraph boundary.

Properties

annotatedString

val annotatedString: AnnotatedString

the text to be laid out

maxIntrinsicWidth

val maxIntrinsicWidth: Float

Returns the smallest width beyond which increasing the width never decreases the height.

minIntrinsicWidth

val minIntrinsicWidth: Float

The width for text if all soft wrap opportunities were taken.

placeholders

val placeholders: List<AnnotatedString.Range<Placeholder>>

a list of Placeholders that specify ranges of text which will be skipped during layout and replaced with Placeholder. It's required that the range of each Placeholder doesn't cross paragraph boundary, otherwise IllegalArgumentException is thrown.