ParagraphConstraints

data class ParagraphConstraints
kotlin.Any
   ↳ androidx.ui.text.ParagraphConstraints

Layout constraints for Paragraph objects.

Instances of this class are typically used with Paragraph.

The only constraint that can be specified is the width. See the discussion at width for more details.

Creates constraints for laying out a paragraph.

The width argument must not be null.

The width the paragraph should use whey computing the positions of glyphs.

If possible, the paragraph will select a soft line break prior to reaching this width. If no soft line break is available, the paragraph will select a hard line break prior to reaching this width. If that would force a line break without any characters having been placed (i.e. if the next character to be laid out does not fit within the given width constraint) then the next character is allowed to overflow the width constraint and a forced line break is placed after it (even if an explicit line break follows).

The width influences how ellipses are applied.

This width is also used to position glyphs according to the text alignment described in the ParagraphStyle.textAlign to create Paragraph.

Summary

Public constructors

<init>(width: Float)

Layout constraints for Paragraph objects.

Public methods

String

Properties

Float

Public constructors

<init>

ParagraphConstraints(width: Float)

Layout constraints for Paragraph objects.

Instances of this class are typically used with Paragraph.

The only constraint that can be specified is the width. See the discussion at width for more details.

Creates constraints for laying out a paragraph.

The width argument must not be null.

The width the paragraph should use whey computing the positions of glyphs.

If possible, the paragraph will select a soft line break prior to reaching this width. If no soft line break is available, the paragraph will select a hard line break prior to reaching this width. If that would force a line break without any characters having been placed (i.e. if the next character to be laid out does not fit within the given width constraint) then the next character is allowed to overflow the width constraint and a forced line break is placed after it (even if an explicit line break follows).

The width influences how ellipses are applied.

This width is also used to position glyphs according to the text alignment described in the ParagraphStyle.textAlign to create Paragraph.

Public methods

toString

fun toString(): String

Properties

width

val width: Float