Google is committed to advancing racial equity for Black communities. See how.
Added in API level 1

StaticLayout

open class StaticLayout : Layout
kotlin.Any
   ↳ android.text.Layout
   ↳ android.text.StaticLayout

StaticLayout is a Layout for text that will not be edited after it is laid out. Use DynamicLayout for text that may change.

This is used by widgets to control text layout. You should not need to use this class directly unless you are implementing your own widget or custom display object, or would be tempted to call Canvas.drawText() directly.

Summary

Nested classes

Builder for static layouts.

Inherited constants

Public constructors

<init>(source: CharSequence!, paint: TextPaint!, width: Int, align: Layout.Alignment!, spacingmult: Float, spacingadd: Float, includepad: Boolean)

<init>(source: CharSequence!, bufstart: Int, bufend: Int, paint: TextPaint!, outerwidth: Int, align: Layout.Alignment!, spacingmult: Float, spacingadd: Float, includepad: Boolean)

<init>(source: CharSequence!, bufstart: Int, bufend: Int, paint: TextPaint!, outerwidth: Int, align: Layout.Alignment!, spacingmult: Float, spacingadd: Float, includepad: Boolean, ellipsize: TextUtils.TruncateAt!, ellipsizedWidth: Int)

Public methods

open Int

open Int

open Int

open Int

open Boolean

open Int

open Int

Layout.Directions!

open Int

open Int

open Int
getLineTop(line: Int)

open Int

open Int

Inherited functions

Public constructors

<init>

Added in API level 1
StaticLayout(
    source: CharSequence!,
    paint: TextPaint!,
    width: Int,
    align: Layout.Alignment!,
    spacingmult: Float,
    spacingadd: Float,
    includepad: Boolean)

Deprecated: Use Builder instead.

<init>

Added in API level 1
StaticLayout(
    source: CharSequence!,
    bufstart: Int,
    bufend: Int,
    paint: TextPaint!,
    outerwidth: Int,
    align: Layout.Alignment!,
    spacingmult: Float,
    spacingadd: Float,
    includepad: Boolean)

Deprecated: Use Builder instead.

<init>

Added in API level 1
StaticLayout(
    source: CharSequence!,
    bufstart: Int,
    bufend: Int,
    paint: TextPaint!,
    outerwidth: Int,
    align: Layout.Alignment!,
    spacingmult: Float,
    spacingadd: Float,
    includepad: Boolean,
    ellipsize: TextUtils.TruncateAt!,
    ellipsizedWidth: Int)

Deprecated: Use Builder instead.

Public methods

getBottomPadding

Added in API level 1
open fun getBottomPadding(): Int

getEllipsisCount

Added in API level 1
open fun getEllipsisCount(line: Int): Int

getEllipsisStart

Added in API level 1
open fun getEllipsisStart(line: Int): Int

getEllipsizedWidth

Added in API level 1
open fun getEllipsizedWidth(): Int

getLineContainsTab

Added in API level 1
open fun getLineContainsTab(line: Int): Boolean

getLineCount

Added in API level 1
open fun getLineCount(): Int

getLineDescent

Added in API level 1
open fun getLineDescent(line: Int): Int

getLineDirections

Added in API level 1
fun getLineDirections(line: Int): Layout.Directions!

getLineForVertical

Added in API level 1
open fun getLineForVertical(vertical: Int): Int

getLineStart

Added in API level 1
open fun getLineStart(line: Int): Int

getLineTop

Added in API level 1
open fun getLineTop(line: Int): Int

getParagraphDirection

Added in API level 1
open fun getParagraphDirection(line: Int): Int

getTopPadding

Added in API level 1
open fun getTopPadding(): Int