Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/text/DynamicLayout#nestedclasses) \| [Inherited Constants](https://developer.android.com/reference/android/text/DynamicLayout#inhconstants) \| [Inherited Fields](https://developer.android.com/reference/android/text/DynamicLayout#inhfields) \| [Ctors](https://developer.android.com/reference/android/text/DynamicLayout#pubctors) \| [Methods](https://developer.android.com/reference/android/text/DynamicLayout#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/text/DynamicLayout#inhmethods)

# DynamicLayout

*** ** * ** ***


`
public


class
DynamicLayout
`


`


`

`

extends https://developer.android.com/reference/android/text/Layout


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.text.Layout](https://developer.android.com/reference/android/text/Layout) ||
|   | ↳ | android.text.DynamicLayout |

<br />

*** ** * ** ***

DynamicLayout is a text layout that updates itself as the text is edited.

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 need to call
`https://developer.android.com/reference/android/graphics/Canvas#drawText(java.lang.CharSequence,%20int,%20int,%20float,%20float,%20android.graphics.Paint)` directly.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/text/DynamicLayout.Builder` Builder for dynamic layouts. |

| ### Inherited constants |
|---|
| From class `https://developer.android.com/reference/android/text/Layout` |---|---| | `int` | `https://developer.android.com/reference/android/text/Layout#BREAK_STRATEGY_BALANCED` Value for break strategy indicating balanced line breaking. | | `int` | `https://developer.android.com/reference/android/text/Layout#BREAK_STRATEGY_HIGH_QUALITY` Value for break strategy indicating high quality line breaking, including automatic hyphenation and doing whole-paragraph optimization of line breaks. | | `int` | `https://developer.android.com/reference/android/text/Layout#BREAK_STRATEGY_SIMPLE` Value for break strategy indicating simple line breaking. | | `float` | `https://developer.android.com/reference/android/text/Layout#DEFAULT_LINESPACING_ADDITION` | | `float` | `https://developer.android.com/reference/android/text/Layout#DEFAULT_LINESPACING_MULTIPLIER` | | `int` | `https://developer.android.com/reference/android/text/Layout#DIR_LEFT_TO_RIGHT` | | `int` | `https://developer.android.com/reference/android/text/Layout#DIR_RIGHT_TO_LEFT` | | `int` | `https://developer.android.com/reference/android/text/Layout#HYPHENATION_FREQUENCY_FULL` Value for hyphenation frequency indicating the full amount of automatic hyphenation, typical in typography. | | `int` | `https://developer.android.com/reference/android/text/Layout#HYPHENATION_FREQUENCY_FULL_FAST` Value for hyphenation frequency indicating the full amount of automatic hyphenation with using faster algorithm. | | `int` | `https://developer.android.com/reference/android/text/Layout#HYPHENATION_FREQUENCY_NONE` Value for hyphenation frequency indicating no automatic hyphenation. | | `int` | `https://developer.android.com/reference/android/text/Layout#HYPHENATION_FREQUENCY_NORMAL` Value for hyphenation frequency indicating a light amount of automatic hyphenation, which is a conservative default. | | `int` | `https://developer.android.com/reference/android/text/Layout#HYPHENATION_FREQUENCY_NORMAL_FAST` Value for hyphenation frequency indicating a light amount of automatic hyphenation with using faster algorithm. | | `int` | `https://developer.android.com/reference/android/text/Layout#JUSTIFICATION_MODE_INTER_CHARACTER` Value for justification mode indicating the text is justified by stretching letter spacing. | | `int` | `https://developer.android.com/reference/android/text/Layout#JUSTIFICATION_MODE_INTER_WORD` Value for justification mode indicating the text is justified by stretching word spacing. | | `int` | `https://developer.android.com/reference/android/text/Layout#JUSTIFICATION_MODE_NONE` Value for justification mode indicating no justification. | |

| ### Inherited fields |
|---|
| From class `https://developer.android.com/reference/android/text/Layout` |---|---| | ` public static final https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy` | `https://developer.android.com/reference/android/text/Layout#INCLUSION_STRATEGY_ANY_OVERLAP` Strategy which considers a text segment to be inside a rectangle area if the segment bounds intersect the rectangle. | | ` public static final https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy` | `https://developer.android.com/reference/android/text/Layout#INCLUSION_STRATEGY_CONTAINS_ALL` Strategy which considers a text segment to be inside a rectangle area if the segment bounds are completely contained within the rectangle. | | ` public static final https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy` | `https://developer.android.com/reference/android/text/Layout#INCLUSION_STRATEGY_CONTAINS_CENTER` Strategy which considers a text segment to be inside a rectangle area if the center of the segment bounds is inside the rectangle. | |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/text/DynamicLayout#DynamicLayout(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20boolean)(https://developer.android.com/reference/java/lang/CharSequence base, https://developer.android.com/reference/android/text/TextPaint paint, int width, https://developer.android.com/reference/android/text/Layout.Alignment align, float spacingmult, float spacingadd, boolean includepad) ` *This constructor is deprecated. Use `https://developer.android.com/reference/android/text/DynamicLayout.Builder` instead.* |
| ` https://developer.android.com/reference/android/text/DynamicLayout#DynamicLayout(java.lang.CharSequence,%20java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20boolean)(https://developer.android.com/reference/java/lang/CharSequence base, https://developer.android.com/reference/java/lang/CharSequence display, https://developer.android.com/reference/android/text/TextPaint paint, int width, https://developer.android.com/reference/android/text/Layout.Alignment align, float spacingmult, float spacingadd, boolean includepad) ` *This constructor is deprecated. Use `https://developer.android.com/reference/android/text/DynamicLayout.Builder` instead.* |
| ` https://developer.android.com/reference/android/text/DynamicLayout#DynamicLayout(java.lang.CharSequence,%20java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20boolean,%20android.text.TextUtils.TruncateAt,%20int)(https://developer.android.com/reference/java/lang/CharSequence base, https://developer.android.com/reference/java/lang/CharSequence display, https://developer.android.com/reference/android/text/TextPaint paint, int width, https://developer.android.com/reference/android/text/Layout.Alignment align, float spacingmult, float spacingadd, boolean includepad, https://developer.android.com/reference/android/text/TextUtils.TruncateAt ellipsize, int ellipsizedWidth) ` *This constructor is deprecated. Use `https://developer.android.com/reference/android/text/DynamicLayout.Builder` instead.* |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getBottomPadding()() ` Returns the number of extra pixels of descent padding in the bottom line of the Layout. |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getEllipsisCount(int)(int line) ` Returns the number of characters to be ellipsized away, or 0 if no ellipsis is to take place. |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getEllipsisStart(int)(int line) ` Return the offset of the first character to be ellipsized away, relative to the start of the line. |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getEllipsizedWidth()() ` Return the width to which this layout is ellipsized. |
| ` https://developer.android.com/reference/android/graphics/text/LineBreakConfig` | ` https://developer.android.com/reference/android/text/DynamicLayout#getLineBreakConfig()() ` Gets the `https://developer.android.com/reference/android/graphics/text/LineBreakConfig` used in this DynamicLayout. |
| ` boolean` | ` https://developer.android.com/reference/android/text/DynamicLayout#getLineContainsTab(int)(int line) ` Returns whether the specified line contains one or more characters that need to be handled specially, like tabs. |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getLineCount()() ` Return the number of lines of text in this layout. |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getLineDescent(int)(int line) ` Return the descent of the specified line(0...getLineCount() - 1). |
| ` final https://developer.android.com/reference/android/text/Layout.Directions` | ` https://developer.android.com/reference/android/text/DynamicLayout#getLineDirections(int)(int line) ` Returns the directional run information for the specified line. |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getLineStart(int)(int line) ` Return the text offset of the beginning of the specified line ( 0...getLineCount()). |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getLineTop(int)(int line) ` Return the vertical position of the top of the specified line (0...getLineCount()). |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getParagraphDirection(int)(int line) ` Returns the primary directionality of the paragraph containing the specified line, either 1 for left-to-right lines, or -1 for right-to-left lines (see `https://developer.android.com/reference/android/text/Layout#DIR_LEFT_TO_RIGHT`, `https://developer.android.com/reference/android/text/Layout#DIR_RIGHT_TO_LEFT`). |
| ` int` | ` https://developer.android.com/reference/android/text/DynamicLayout#getTopPadding()() ` Returns the (negative) number of extra pixels of ascent padding in the top line of the Layout. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/text/Layout ` |---|---| | ` https://developer.android.com/reference/android/graphics/RectF` | ` https://developer.android.com/reference/android/text/Layout#computeDrawingBoundingBox()() ` Get an actual bounding box that draws text content. | | ` void` | ` https://developer.android.com/reference/android/text/Layout#draw(android.graphics.Canvas)(https://developer.android.com/reference/android/graphics/Canvas c) ` Draw this Layout on the specified Canvas. | | ` void` | ` https://developer.android.com/reference/android/text/Layout#draw(android.graphics.Canvas,%20android.graphics.Path,%20android.graphics.Paint,%20int)(https://developer.android.com/reference/android/graphics/Canvas canvas, https://developer.android.com/reference/android/graphics/Path selectionHighlight, https://developer.android.com/reference/android/graphics/Paint selectionHighlightPaint, int cursorOffsetVertical) ` Draw this Layout on the specified canvas, with the highlight path drawn between the background and the text. | | ` void` | ` https://developer.android.com/reference/android/text/Layout#draw(android.graphics.Canvas,%20java.util.List<android.graphics.Path>,%20java.util.List<android.graphics.Paint>,%20android.graphics.Path,%20android.graphics.Paint,%20int)(https://developer.android.com/reference/android/graphics/Canvas canvas, https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Path> highlightPaths, https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Paint> highlightPaints, https://developer.android.com/reference/android/graphics/Path selectionPath, https://developer.android.com/reference/android/graphics/Paint selectionPaint, int cursorOffsetVertical) ` Draw this layout on the specified canvas. | | ` void` | ` https://developer.android.com/reference/android/text/Layout#drawBackground(android.graphics.Canvas)(https://developer.android.com/reference/android/graphics/Canvas canvas) ` Draw background of this layout. | | ` void` | ` https://developer.android.com/reference/android/text/Layout#drawText(android.graphics.Canvas)(https://developer.android.com/reference/android/graphics/Canvas canvas) ` Draw text part of this layout. | | ` void` | ` https://developer.android.com/reference/android/text/Layout#fillCharacterBounds(int,%20int,%20float[],%20int)(int start, int end, float[] bounds, int boundsStart) ` Return the characters' bounds in the given range. | | ` final https://developer.android.com/reference/android/text/Layout.Alignment` | ` https://developer.android.com/reference/android/text/Layout#getAlignment()() ` Returns the alignment used for creating this layout in pixels. | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getBottomPadding()() ` Returns the number of extra pixels of descent padding in the bottom line of the Layout. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getBreakStrategy()() ` Return the break strategy used for creating this layout. | | ` void` | ` https://developer.android.com/reference/android/text/Layout#getCursorPath(int,%20android.graphics.Path,%20java.lang.CharSequence)(int point, https://developer.android.com/reference/android/graphics/Path dest, https://developer.android.com/reference/java/lang/CharSequence editingBuffer) ` Fills in the specified Path with a representation of a cursor at the specified offset. | | ` static float` | ` https://developer.android.com/reference/android/text/Layout#getDesiredWidth(java.lang.CharSequence,%20android.text.TextPaint)(https://developer.android.com/reference/java/lang/CharSequence source, https://developer.android.com/reference/android/text/TextPaint paint) ` Return how wide a layout must be in order to display the specified text with one line per paragraph. | | ` static float` | ` https://developer.android.com/reference/android/text/Layout#getDesiredWidth(java.lang.CharSequence,%20int,%20int,%20android.text.TextPaint)(https://developer.android.com/reference/java/lang/CharSequence source, int start, int end, https://developer.android.com/reference/android/text/TextPaint paint) ` Return how wide a layout must be in order to display the specified text slice with one line per paragraph. | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getEllipsisCount(int)(int line) ` Returns the number of characters to be ellipsized away, or 0 if no ellipsis is to take place. | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getEllipsisStart(int)(int line) ` Return the offset of the first character to be ellipsized away, relative to the start of the line. | | ` final https://developer.android.com/reference/android/text/TextUtils.TruncateAt` | ` https://developer.android.com/reference/android/text/Layout#getEllipsize()() ` Return the ellipsize option used for creating this layout. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getEllipsizedWidth()() ` Return the width to which this layout is ellipsized. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getHeight()() ` Return the total height of this layout. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getHyphenationFrequency()() ` Return the hyphenation frequency used for creating this layout. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getJustificationMode()() ` Return the justification mode used for creating this layout. | | ` final int[]` | ` https://developer.android.com/reference/android/text/Layout#getLeftIndents()() ` Return a copy of the left indents used for this layout. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getLineAscent(int)(int line) ` Get the ascent of the text on the specified line. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getLineBaseline(int)(int line) ` Return the vertical position of the baseline of the specified line. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getLineBottom(int,%20boolean)(int line, boolean includeLineSpacing) ` Return the vertical position of the bottom of the specified line. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getLineBottom(int)(int line) ` Return the vertical position of the bottom of the specified line. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getLineBounds(int,%20android.graphics.Rect)(int line, https://developer.android.com/reference/android/graphics/Rect bounds) ` Return the baseline for the specified line (0...getLineCount() - 1) If bounds is not null, return the top, left, right, bottom extents of the specified line in it. | | ` https://developer.android.com/reference/android/graphics/text/LineBreakConfig` | ` https://developer.android.com/reference/android/text/Layout#getLineBreakConfig()() ` Gets the `https://developer.android.com/reference/android/graphics/text/LineBreakConfig` used for creating this layout. | | ` abstract boolean` | ` https://developer.android.com/reference/android/text/Layout#getLineContainsTab(int)(int line) ` Returns whether the specified line contains one or more characters that need to be handled specially, like tabs. | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getLineCount()() ` Return the number of lines of text in this layout. | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getLineDescent(int)(int line) ` Return the descent of the specified line(0...getLineCount() - 1). | | ` abstract https://developer.android.com/reference/android/text/Layout.Directions` | ` https://developer.android.com/reference/android/text/Layout#getLineDirections(int)(int line) ` Returns the directional run information for the specified line. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getLineEnd(int)(int line) ` Return the text offset after the last character on the specified line. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getLineForOffset(int)(int offset) ` Get the line number on which the specified text offset appears. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getLineForVertical(int)(int vertical) ` Get the line number corresponding to the specified vertical position. | | ` float` | ` https://developer.android.com/reference/android/text/Layout#getLineLeft(int)(int line) ` Get the leftmost position that should be exposed for horizontal scrolling on the specified line. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getLineLetterSpacingUnitCount(int,%20boolean)(int line, boolean includeTrailingWhitespace) ` Returns the number of letter spacing unit in the line. | | ` float` | ` https://developer.android.com/reference/android/text/Layout#getLineMax(int)(int line) ` Gets the unsigned horizontal extent of the specified line, including leading margin indent, but excluding trailing whitespace. | | ` float` | ` https://developer.android.com/reference/android/text/Layout#getLineRight(int)(int line) ` Get the rightmost position that should be exposed for horizontal scrolling on the specified line. | | ` final float` | ` https://developer.android.com/reference/android/text/Layout#getLineSpacingAmount()() ` Returns the amount added to the line height. | | ` final float` | ` https://developer.android.com/reference/android/text/Layout#getLineSpacingMultiplier()() ` Returns the multiplier applied to the line height. | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getLineStart(int)(int line) ` Return the text offset of the beginning of the specified line ( 0...getLineCount()). | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getLineTop(int)(int line) ` Return the vertical position of the top of the specified line (0...getLineCount()). | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getLineVisibleEnd(int)(int line) ` Return the text offset after the last visible character (so whitespace is not counted) on the specified line. | | ` float` | ` https://developer.android.com/reference/android/text/Layout#getLineWidth(int)(int line) ` Gets the unsigned horizontal extent of the specified line, including leading margin indent and trailing whitespace. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getMaxLines()() ` Return the maximum lines allowed used for creating this layout. | | ` https://developer.android.com/reference/android/graphics/Paint.FontMetrics` | ` https://developer.android.com/reference/android/text/Layout#getMinimumFontMetrics()() ` Get the minimum font metrics used for line spacing. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getOffsetForHorizontal(int,%20float)(int line, float horiz) ` Get the character offset on the specified line whose position is closest to the specified horizontal position. | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getOffsetToLeftOf(int)(int offset) ` | | ` int` | ` https://developer.android.com/reference/android/text/Layout#getOffsetToRightOf(int)(int offset) ` | | ` final https://developer.android.com/reference/android/text/TextPaint` | ` https://developer.android.com/reference/android/text/Layout#getPaint()() ` Return the paint used for creating this layout. | | ` final https://developer.android.com/reference/android/text/Layout.Alignment` | ` https://developer.android.com/reference/android/text/Layout#getParagraphAlignment(int)(int line) ` Get the alignment of the specified paragraph, taking into account markup attached to it. | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getParagraphDirection(int)(int line) ` Returns the primary directionality of the paragraph containing the specified line, either 1 for left-to-right lines, or -1 for right-to-left lines (see `https://developer.android.com/reference/android/text/Layout#DIR_LEFT_TO_RIGHT`, `https://developer.android.com/reference/android/text/Layout#DIR_RIGHT_TO_LEFT`). | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getParagraphLeft(int)(int line) ` Get the left edge of the specified paragraph, inset by left margins. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getParagraphRight(int)(int line) ` Get the right edge of the specified paragraph, inset by right margins. | | ` float` | ` https://developer.android.com/reference/android/text/Layout#getPrimaryHorizontal(int)(int offset) ` Get the primary horizontal position for the specified text offset. | | ` int[]` | ` https://developer.android.com/reference/android/text/Layout#getRangeForRect(android.graphics.RectF,%20android.text.SegmentFinder,%20android.text.Layout.TextInclusionStrategy)(https://developer.android.com/reference/android/graphics/RectF area, https://developer.android.com/reference/android/text/SegmentFinder segmentFinder, https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy inclusionStrategy) ` Finds the range of text which is inside the specified rectangle area. | | ` final int[]` | ` https://developer.android.com/reference/android/text/Layout#getRightIndents()() ` Return a copy of the right indents used for this layout. | | ` float` | ` https://developer.android.com/reference/android/text/Layout#getSecondaryHorizontal(int)(int offset) ` Get the secondary horizontal position for the specified text offset. | | ` void` | ` https://developer.android.com/reference/android/text/Layout#getSelectionPath(int,%20int,%20android.graphics.Path)(int start, int end, https://developer.android.com/reference/android/graphics/Path dest) ` Fills in the specified Path with a representation of a highlight between the specified offsets. | | ` boolean` | ` https://developer.android.com/reference/android/text/Layout#getShiftDrawingOffsetForStartOverhang()() ` Returns true if shifting drawing offset for start overhang. | | ` final float` | ` https://developer.android.com/reference/android/text/Layout#getSpacingAdd()() ` Returns the amount added to the line height. | | ` final float` | ` https://developer.android.com/reference/android/text/Layout#getSpacingMultiplier()() ` Returns the multiplier applied to the line height. | | ` final https://developer.android.com/reference/java/lang/CharSequence` | ` https://developer.android.com/reference/android/text/Layout#getText()() ` Return the text used for creating this layout. | | ` final https://developer.android.com/reference/android/text/TextDirectionHeuristic` | ` https://developer.android.com/reference/android/text/Layout#getTextDirectionHeuristic()() ` Returns the text direction heuristic used for creating this layout. | | ` abstract int` | ` https://developer.android.com/reference/android/text/Layout#getTopPadding()() ` Returns the (negative) number of extra pixels of ascent padding in the top line of the Layout. | | ` boolean` | ` https://developer.android.com/reference/android/text/Layout#getUseBoundsForWidth()() ` Returns true if using bounding box as a width, false for using advance as a width. | | ` final int` | ` https://developer.android.com/reference/android/text/Layout#getWidth()() ` Return the width used for creating this layout in pixels. | | ` final void` | ` https://developer.android.com/reference/android/text/Layout#increaseWidthTo(int)(int wid) ` Increase the width of this layout to the specified width. | | ` boolean` | ` https://developer.android.com/reference/android/text/Layout#isFallbackLineSpacingEnabled()() ` Return true if the fallback line space is enabled in this Layout. | | ` final boolean` | ` https://developer.android.com/reference/android/text/Layout#isFontPaddingIncluded()() ` Returns true if this layout is created with increased line height. | | ` boolean` | ` https://developer.android.com/reference/android/text/Layout#isRtlCharAt(int)(int offset) ` Returns true if the character at offset is right to left (RTL). | | ` final boolean` | ` https://developer.android.com/reference/android/text/Layout#isSpanned()() ` | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### DynamicLayout

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DynamicLayout (CharSequence base, 
                TextPaint paint, 
                int width, 
                Layout.Alignment align, 
                float spacingmult, 
                float spacingadd, 
                boolean includepad)
```


**This constructor is deprecated.**   

Use `https://developer.android.com/reference/android/text/DynamicLayout.Builder` instead.

<br />

<br />

| Parameters ||
|---|---|
| `base` | `CharSequence`: This value cannot be `null`. <br /> |
| `paint` | `TextPaint`: This value cannot be `null`. <br /> |
| `width` | `int`: Value is 0 or greater <br /> |
| `align` | `Layout.Alignment`: This value cannot be `null`. <br /> |
| `spacingmult` | `float`: Value is 0.0f or greater <br /> |
| `spacingadd` | `float` <br /> |
| `includepad` | `boolean` <br /> |

### DynamicLayout

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DynamicLayout (CharSequence base, 
                CharSequence display, 
                TextPaint paint, 
                int width, 
                Layout.Alignment align, 
                float spacingmult, 
                float spacingadd, 
                boolean includepad)
```


**This constructor is deprecated.**   

Use `https://developer.android.com/reference/android/text/DynamicLayout.Builder` instead.

<br />

<br />

| Parameters ||
|---|---|
| `base` | `CharSequence`: This value cannot be `null`. <br /> |
| `display` | `CharSequence`: This value cannot be `null`. <br /> |
| `paint` | `TextPaint`: This value cannot be `null`. <br /> |
| `width` | `int`: Value is 0 or greater <br /> |
| `align` | `Layout.Alignment`: This value cannot be `null`. <br /> |
| `spacingmult` | `float`: Value is 0.0f or greater <br /> |
| `spacingadd` | `float` <br /> |
| `includepad` | `boolean` <br /> |

### DynamicLayout

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DynamicLayout (CharSequence base, 
                CharSequence display, 
                TextPaint paint, 
                int width, 
                Layout.Alignment align, 
                float spacingmult, 
                float spacingadd, 
                boolean includepad, 
                TextUtils.TruncateAt ellipsize, 
                int ellipsizedWidth)
```


**This constructor is deprecated.**   

Use `https://developer.android.com/reference/android/text/DynamicLayout.Builder` instead.

<br />

<br />

| Parameters ||
|---|---|
| `base` | `CharSequence`: This value cannot be `null`. <br /> |
| `display` | `CharSequence`: This value cannot be `null`. <br /> |
| `paint` | `TextPaint`: This value cannot be `null`. <br /> |
| `width` | `int`: Value is 0 or greater <br /> |
| `align` | `Layout.Alignment`: This value cannot be `null`. <br /> |
| `spacingmult` | `float`: Value is 0.0f or greater <br /> |
| `spacingadd` | `float` <br /> |
| `includepad` | `boolean` <br /> |
| `ellipsize` | `TextUtils.TruncateAt`: This value may be `null`. <br /> |
| `ellipsizedWidth` | `int`: Value is 0 or greater <br /> |

## Public methods

### getBottomPadding

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getBottomPadding ()
```

Returns the number of extra pixels of descent padding in the
bottom line of the Layout.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getEllipsisCount

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getEllipsisCount (int line)
```

Returns the number of characters to be ellipsized away, or 0 if
no ellipsis is to take place.

<br />

| Parameters ||
|---|---|
| `line` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### getEllipsisStart

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getEllipsisStart (int line)
```

Return the offset of the first character to be ellipsized away,
relative to the start of the line. (So 0 if the beginning of the
line is ellipsized, not getLineStart().)

<br />

| Parameters ||
|---|---|
| `line` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### getEllipsizedWidth

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getEllipsizedWidth ()
```

Return the width to which this layout is ellipsized.

If no ellipsize is applied, the same amount of `https://developer.android.com/reference/android/text/Layout#getWidth()` is returned.

<br />

| Returns ||
|---|---|
| `int` | the amount of ellipsized width in pixels. Value is 0 or greater <br /> |

### getLineBreakConfig

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LineBreakConfig getLineBreakConfig ()
```

Gets the `https://developer.android.com/reference/android/graphics/text/LineBreakConfig` used in this DynamicLayout.
Use this only to consult the LineBreakConfig's properties and not
to change them.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/text/LineBreakConfig` | The line break config in this DynamicLayout. This value cannot be `null`. <br /> |

### getLineContainsTab

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean getLineContainsTab (int line)
```

Returns whether the specified line contains one or more
characters that need to be handled specially, like tabs.

<br />

| Parameters ||
|---|---|
| `line` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### getLineCount

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getLineCount ()
```

Return the number of lines of text in this layout.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getLineDescent

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getLineDescent (int line)
```

Return the descent of the specified line(0...getLineCount() - 1).

<br />

| Parameters ||
|---|---|
| `line` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### getLineDirections

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final Layout.Directions getLineDirections (int line)
```

Returns the directional run information for the specified line.
The array alternates counts of characters in left-to-right
and right-to-left segments of the line.

NOTE: this is inadequate to support bidirectional text, and will change.

<br />

| Parameters ||
|---|---|
| `line` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/text/Layout.Directions` | <br /> |

### getLineStart

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getLineStart (int line)
```

Return the text offset of the beginning of the specified line (
0...getLineCount()). If the specified line is equal to the line
count, returns the length of the text.

<br />

| Parameters ||
|---|---|
| `line` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### getLineTop

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getLineTop (int line)
```

Return the vertical position of the top of the specified line
(0...getLineCount()).
If the specified line is equal to the line count, returns the
bottom of the last line.

<br />

| Parameters ||
|---|---|
| `line` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### getParagraphDirection

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getParagraphDirection (int line)
```

Returns the primary directionality of the paragraph containing the
specified line, either 1 for left-to-right lines, or -1 for right-to-left
lines (see `https://developer.android.com/reference/android/text/Layout#DIR_LEFT_TO_RIGHT`, `https://developer.android.com/reference/android/text/Layout#DIR_RIGHT_TO_LEFT`).

<br />

| Parameters ||
|---|---|
| `line` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### getTopPadding

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getTopPadding ()
```

Returns the (negative) number of extra pixels of ascent padding in the
top line of the Layout.

<br />

| Returns ||
|---|---|
| `int` | <br /> |