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
StaticLayout(source: CharSequence!, paint: TextPaint!, width: Int, align: Layout.Alignment!, spacingmult: Float, spacingadd: Float, includepad: Boolean)

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

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)

Public methods
open RectF

Get an actual bounding box that draws text content.

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
Inherited properties

Public constructors

StaticLayout

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.

StaticLayout

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.

StaticLayout

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

computeDrawingBoundingBox

Added in API level 35
open fun computeDrawingBoundingBox(): RectF

Get an actual bounding box that draws text content. Note that the RectF.top and RectF.bottom may be different from the Layout.getLineTop(int) of the first line and Layout.getLineBottom(int) of the last line. The line top and line bottom are calculated based on yMin/yMax or ascent/descent value of font file. On the other hand, the drawing bounding boxes are calculated based on actual glyphs used there.

Return
RectF This value cannot be null.

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

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