Added in API level 29

ParagraphConstraints


open class ParagraphConstraints
kotlin.Any
   ↳ android.graphics.text.LineBreaker.ParagraphConstraints

Line breaking constraints for single paragraph.

Summary

Public constructors

Public methods
open Float

Returns the default tab stops in pixels.

open Float

Return the first line's width for this paragraph in pixel.

open Int

Return the number of lines to apply the first line's width.

open FloatArray?

Returns the array of tab stops in pixels.

open Float

Return the width for this paragraph in pixels.

open Unit
setIndent(firstWidth: Float, firstWidthLineCount: Int)

Set indent for this paragraph.

open Unit
setTabStops(tabStops: FloatArray?, defaultTabStop: Float)

Set tab stops for this paragraph.

open Unit
setWidth(width: Float)

Set width for this paragraph.

Public constructors

ParagraphConstraints

Added in API level 29
ParagraphConstraints()

Public methods

getDefaultTabStop

Added in API level 29
open fun getDefaultTabStop(): Float

Returns the default tab stops in pixels.
The units of this value are pixels.

Return
Float The units of this value are pixels. {} Value is 0 or greater

See Also

getFirstWidth

Added in API level 29
open fun getFirstWidth(): Float

Return the first line's width for this paragraph in pixel.
The units of this value are pixels.

Return
Float The units of this value are pixels. {} Value is 0.0f or greater

getFirstWidthLineCount

Added in API level 29
open fun getFirstWidthLineCount(): Int

Return the number of lines to apply the first line's width.
The units of this value are pixels.

Return
Int The units of this value are pixels. {} Value is 0 or greater

getTabStops

Added in API level 29
open fun getTabStops(): FloatArray?

Returns the array of tab stops in pixels.

Return
FloatArray? This value may be null.

See Also

getWidth

Added in API level 29
open fun getWidth(): Float

Return the width for this paragraph in pixels.
The units of this value are pixels.

Return
Float The units of this value are pixels. {} Value is 0.0f or greater

See Also

setIndent

Added in API level 29
open fun setIndent(
    firstWidth: Float,
    firstWidthLineCount: Int
): Unit

Set indent for this paragraph.

Parameters
firstWidth Float: the line width of the starting of the paragraph The units of this value are pixels. Value is 0.0f or greater
firstWidthLineCount Int: the number of lines that applies the firstWidth The units of this value are pixels. Value is 0 or greater

setTabStops

Added in API level 29
open fun setTabStops(
    tabStops: FloatArray?,
    defaultTabStop: Float
): Unit

Set tab stops for this paragraph.

Parameters
tabStops FloatArray?: the array of pixels of tap stopping position This value may be null.
defaultTabStop Float: pixels of the default tab stopping position The units of this value are pixels. Value is 0 or greater

setWidth

Added in API level 29
open fun setWidth(width: Float): Unit

Set width for this paragraph.

Parameters
width Float: The units of this value are pixels. Value is 0.0f or greater

See Also