# BoringLayout

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/BoringLayout#nestedclasses)\|[Inherited Constants](https://developer.android.com/reference/android/text/BoringLayout#inhconstants)\|[Inherited Fields](https://developer.android.com/reference/android/text/BoringLayout#inhfields)\|[Ctors](https://developer.android.com/reference/android/text/BoringLayout#pubctors)\|[Methods](https://developer.android.com/reference/android/text/BoringLayout#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/text/BoringLayout#inhmethods)  

# BoringLayout

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/text/BoringLayout "View this page in Kotlin")\|Java

`
public


class
BoringLayout
`  
`


``

extends `[Layout](https://developer.android.com/reference/android/text/Layout)`


``


implements

`[TextUtils.EllipsizeCallback](https://developer.android.com/reference/android/text/TextUtils.EllipsizeCallback)`


`

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

<br />

*** ** * ** ***

A BoringLayout is a very simple Layout implementation for text that fits on a single line and is all left-to-right characters. You will probably never want to make one of these yourself; if you do, be sure to call[isBoring(CharSequence, TextPaint)](https://developer.android.com/reference/android/text/BoringLayout#isBoring(java.lang.CharSequence,%20android.text.TextPaint))first to make sure the text meets the criteria.

This class 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, in which case you are encouraged to use a Layout instead of calling[Canvas.drawText()](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` | [BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics) <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[android.text.Layout](https://developer.android.com/reference/android/text/Layout) |---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int`   | [BREAK_STRATEGY_BALANCED](https://developer.android.com/reference/android/text/Layout#BREAK_STRATEGY_BALANCED) Value for break strategy indicating balanced line breaking.                                                                                                    | | `int`   | [BREAK_STRATEGY_HIGH_QUALITY](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`   | [BREAK_STRATEGY_SIMPLE](https://developer.android.com/reference/android/text/Layout#BREAK_STRATEGY_SIMPLE) Value for break strategy indicating simple line breaking.                                                                                                          | | `float` | [DEFAULT_LINESPACING_ADDITION](https://developer.android.com/reference/android/text/Layout#DEFAULT_LINESPACING_ADDITION) <br />                                                                                                                                               | | `float` | [DEFAULT_LINESPACING_MULTIPLIER](https://developer.android.com/reference/android/text/Layout#DEFAULT_LINESPACING_MULTIPLIER) <br />                                                                                                                                           | | `int`   | [DIR_LEFT_TO_RIGHT](https://developer.android.com/reference/android/text/Layout#DIR_LEFT_TO_RIGHT) <br />                                                                                                                                                                     | | `int`   | [DIR_RIGHT_TO_LEFT](https://developer.android.com/reference/android/text/Layout#DIR_RIGHT_TO_LEFT) <br />                                                                                                                                                                     | | `int`   | [HYPHENATION_FREQUENCY_FULL](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`   | [HYPHENATION_FREQUENCY_FULL_FAST](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`   | [HYPHENATION_FREQUENCY_NONE](https://developer.android.com/reference/android/text/Layout#HYPHENATION_FREQUENCY_NONE) Value for hyphenation frequency indicating no automatic hyphenation.                                                                                     | | `int`   | [HYPHENATION_FREQUENCY_NORMAL](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`   | [HYPHENATION_FREQUENCY_NORMAL_FAST](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`   | [JUSTIFICATION_MODE_INTER_CHARACTER](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`   | [JUSTIFICATION_MODE_INTER_WORD](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`   | [JUSTIFICATION_MODE_NONE](https://developer.android.com/reference/android/text/Layout#JUSTIFICATION_MODE_NONE) Value for justification mode indicating no justification.                                                                                                      | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Inherited fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[android.text.Layout](https://developer.android.com/reference/android/text/Layout) |------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` public static final `[Layout.TextInclusionStrategy](https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy) | [INCLUSION_STRATEGY_ANY_OVERLAP](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 `[Layout.TextInclusionStrategy](https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy) | [INCLUSION_STRATEGY_CONTAINS_ALL](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 `[Layout.TextInclusionStrategy](https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy) | [INCLUSION_STRATEGY_CONTAINS_CENTER](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                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout#BoringLayout(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20android.text.BoringLayout.Metrics,%20boolean))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerwidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, float spacingMult, float spacingAdd, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad) `                                                                                                                                                                                                                            |
| ` `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout#BoringLayout(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20android.text.BoringLayout.Metrics,%20boolean,%20android.text.TextUtils.TruncateAt,%20int))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerWidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, float spacingMult, float spacingAdd, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad, `[TextUtils.TruncateAt](https://developer.android.com/reference/android/text/TextUtils.TruncateAt)` ellipsize, int ellipsizedWidth) `                                            |
| ` `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout#BoringLayout(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20android.text.BoringLayout.Metrics,%20boolean,%20android.text.TextUtils.TruncateAt,%20int,%20boolean))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerWidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, float spacingMult, float spacingAdd, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad, `[TextUtils.TruncateAt](https://developer.android.com/reference/android/text/TextUtils.TruncateAt)` ellipsize, int ellipsizedWidth, boolean useFallbackLineSpacing) ` |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[RectF](https://developer.android.com/reference/android/graphics/RectF)                                  | ` `[computeDrawingBoundingBox](https://developer.android.com/reference/android/text/BoringLayout#computeDrawingBoundingBox())`() ` Get an actual bounding box that draws text content.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                                     | ` `[draw](https://developer.android.com/reference/android/text/BoringLayout#draw(android.graphics.Canvas,%20android.graphics.Path,%20android.graphics.Paint,%20int))`(`[Canvas](https://developer.android.com/reference/android/graphics/Canvas)` c, `[Path](https://developer.android.com/reference/android/graphics/Path)` highlight, `[Paint](https://developer.android.com/reference/android/graphics/Paint)` highlightpaint, int cursorOffset) ` Draw this Layout on the specified canvas, with the highlight path drawn between the background and the text.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` void`                                                                                                     | ` `[ellipsized](https://developer.android.com/reference/android/text/BoringLayout#ellipsized(int,%20int))`(int start, int end) ` Callback for the ellipsizer to report what region it ellipsized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` int`                                                                                                      | ` `[getBottomPadding](https://developer.android.com/reference/android/text/BoringLayout#getBottomPadding())`() ` Returns the number of extra pixels of descent padding in the bottom line of the Layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` int`                                                                                                      | ` `[getEllipsisCount](https://developer.android.com/reference/android/text/BoringLayout#getEllipsisCount(int))`(int line) ` Returns the number of characters to be ellipsized away, or 0 if no ellipsis is to take place.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` int`                                                                                                      | ` `[getEllipsisStart](https://developer.android.com/reference/android/text/BoringLayout#getEllipsisStart(int))`(int line) ` Return the offset of the first character to be ellipsized away, relative to the start of the line.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` int`                                                                                                      | ` `[getEllipsizedWidth](https://developer.android.com/reference/android/text/BoringLayout#getEllipsizedWidth())`() ` Return the width to which this layout is ellipsized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` int`                                                                                                      | ` `[getHeight](https://developer.android.com/reference/android/text/BoringLayout#getHeight())`() ` Return the total height of this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` boolean`                                                                                                  | ` `[getLineContainsTab](https://developer.android.com/reference/android/text/BoringLayout#getLineContainsTab(int))`(int line) ` Returns whether the specified line contains one or more characters that need to be handled specially, like tabs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` int`                                                                                                      | ` `[getLineCount](https://developer.android.com/reference/android/text/BoringLayout#getLineCount())`() ` Return the number of lines of text in this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` int`                                                                                                      | ` `[getLineDescent](https://developer.android.com/reference/android/text/BoringLayout#getLineDescent(int))`(int line) ` Return the descent of the specified line(0...getLineCount() - 1).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` final `[Layout.Directions](https://developer.android.com/reference/android/text/Layout.Directions)        | ` `[getLineDirections](https://developer.android.com/reference/android/text/BoringLayout#getLineDirections(int))`(int line) ` Returns the directional run information for the specified line.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` float`                                                                                                    | ` `[getLineMax](https://developer.android.com/reference/android/text/BoringLayout#getLineMax(int))`(int line) ` Gets the unsigned horizontal extent of the specified line, including leading margin indent, but excluding trailing whitespace.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` int`                                                                                                      | ` `[getLineStart](https://developer.android.com/reference/android/text/BoringLayout#getLineStart(int))`(int line) ` Return the text offset of the beginning of the specified line ( 0...getLineCount()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` int`                                                                                                      | ` `[getLineTop](https://developer.android.com/reference/android/text/BoringLayout#getLineTop(int))`(int line) ` Return the vertical position of the top of the specified line (0...getLineCount()).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` float`                                                                                                    | ` `[getLineWidth](https://developer.android.com/reference/android/text/BoringLayout#getLineWidth(int))`(int line) ` Gets the unsigned horizontal extent of the specified line, including leading margin indent and trailing whitespace.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` int`                                                                                                      | ` `[getParagraphDirection](https://developer.android.com/reference/android/text/BoringLayout#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[DIR_LEFT_TO_RIGHT](https://developer.android.com/reference/android/text/Layout#DIR_LEFT_TO_RIGHT),[DIR_RIGHT_TO_LEFT](https://developer.android.com/reference/android/text/Layout#DIR_RIGHT_TO_LEFT)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` int`                                                                                                      | ` `[getTopPadding](https://developer.android.com/reference/android/text/BoringLayout#getTopPadding())`() ` Returns the (negative) number of extra pixels of ascent padding in the top line of the Layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` static `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics) | ` `[isBoring](https://developer.android.com/reference/android/text/BoringLayout#isBoring(java.lang.CharSequence,%20android.text.TextPaint,%20android.text.BoringLayout.Metrics))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics) ` Determine and compute metrics if given text can be handled by BoringLayout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` static `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics) | ` `[isBoring](https://developer.android.com/reference/android/text/BoringLayout#isBoring(java.lang.CharSequence,%20android.text.TextPaint))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint) ` Determine and compute metrics if given text can be handled by BoringLayout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` static `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics) | ` `[isBoring](https://developer.android.com/reference/android/text/BoringLayout#isBoring(java.lang.CharSequence,%20android.text.TextPaint,%20android.text.TextDirectionHeuristic,%20boolean,%20android.text.BoringLayout.Metrics))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, `[TextDirectionHeuristic](https://developer.android.com/reference/android/text/TextDirectionHeuristic)` textDir, boolean useFallbackLineSpacing, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics) ` Returns null if not boring; the width, ascent, and descent in the provided Metrics object (or a new one if the provided one was null) if boring.                                                                                                                                                                                                 |
| ` boolean`                                                                                                  | ` `[isFallbackLineSpacingEnabled](https://developer.android.com/reference/android/text/BoringLayout#isFallbackLineSpacingEnabled())`() ` Return true if the fallback line space is enabled in this Layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` static `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout)                 | ` `[make](https://developer.android.com/reference/android/text/BoringLayout#make(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20android.text.BoringLayout.Metrics,%20boolean,%20android.text.TextUtils.TruncateAt,%20int,%20boolean))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerWidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad, `[TextUtils.TruncateAt](https://developer.android.com/reference/android/text/TextUtils.TruncateAt)` ellipsize, int ellipsizedWidth, boolean useFallbackLineSpacing) ` Utility function to construct a BoringLayout instance.                                                                               |
| ` static `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout)                 | ` `[make](https://developer.android.com/reference/android/text/BoringLayout#make(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20android.text.BoringLayout.Metrics,%20boolean,%20android.text.TextUtils.TruncateAt,%20int))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerWidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, float spacingmult, float spacingadd, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad, `[TextUtils.TruncateAt](https://developer.android.com/reference/android/text/TextUtils.TruncateAt)` ellipsize, int ellipsizedWidth) ` Utility function to construct a BoringLayout instance.                                                                   |
| ` static `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout)                 | ` `[make](https://developer.android.com/reference/android/text/BoringLayout#make(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20android.text.BoringLayout.Metrics,%20boolean))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerWidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, float spacingMult, float spacingAdd, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad) ` Utility function to construct a BoringLayout instance.                                                                                                                                                                                                                                                   |
| ` `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout)                        | ` `[replaceOrMake](https://developer.android.com/reference/android/text/BoringLayout#replaceOrMake(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20android.text.BoringLayout.Metrics,%20boolean,%20android.text.TextUtils.TruncateAt,%20int,%20boolean))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerWidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad, `[TextUtils.TruncateAt](https://developer.android.com/reference/android/text/TextUtils.TruncateAt)` ellipsize, int ellipsizedWidth, boolean useFallbackLineSpacing) ` Returns a BoringLayout for the specified text, potentially reusing this one if it is already suitable.             |
| ` `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout)                        | ` `[replaceOrMake](https://developer.android.com/reference/android/text/BoringLayout#replaceOrMake(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20android.text.BoringLayout.Metrics,%20boolean,%20android.text.TextUtils.TruncateAt,%20int))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerWidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, float spacingMult, float spacingAdd, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad, `[TextUtils.TruncateAt](https://developer.android.com/reference/android/text/TextUtils.TruncateAt)` ellipsize, int ellipsizedWidth) ` Returns a BoringLayout for the specified text, potentially reusing this one if it is already suitable. |
| ` `[BoringLayout](https://developer.android.com/reference/android/text/BoringLayout)                        | ` `[replaceOrMake](https://developer.android.com/reference/android/text/BoringLayout#replaceOrMake(java.lang.CharSequence,%20android.text.TextPaint,%20int,%20android.text.Layout.Alignment,%20float,%20float,%20android.text.BoringLayout.Metrics,%20boolean))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint, int outerwidth, `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)` align, float spacingMult, float spacingAdd, `[BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics)` metrics, boolean includePad) ` Returns a BoringLayout for the specified text, potentially reusing this one if it is already suitable.                                                                                                                                                                                 |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.text.Layout](https://developer.android.com/reference/android/text/Layout)` ` |----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[RectF](https://developer.android.com/reference/android/graphics/RectF)                                     | ` `[computeDrawingBoundingBox](https://developer.android.com/reference/android/text/Layout#computeDrawingBoundingBox())`() ` Get an actual bounding box that draws text content.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` void`                                                                                                        | ` `[draw](https://developer.android.com/reference/android/text/Layout#draw(android.graphics.Canvas))`(`[Canvas](https://developer.android.com/reference/android/graphics/Canvas)` c) ` Draw this Layout on the specified Canvas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` void`                                                                                                        | ` `[draw](https://developer.android.com/reference/android/text/Layout#draw(android.graphics.Canvas,%20android.graphics.Path,%20android.graphics.Paint,%20int))`(`[Canvas](https://developer.android.com/reference/android/graphics/Canvas)` canvas, `[Path](https://developer.android.com/reference/android/graphics/Path)` selectionHighlight, `[Paint](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`                                                                                                        | ` `[draw](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))`(`[Canvas](https://developer.android.com/reference/android/graphics/Canvas)` canvas, `[List](https://developer.android.com/reference/java/util/List)`<`[Path](https://developer.android.com/reference/android/graphics/Path)`> highlightPaths, `[List](https://developer.android.com/reference/java/util/List)`<`[Paint](https://developer.android.com/reference/android/graphics/Paint)`> highlightPaints, `[Path](https://developer.android.com/reference/android/graphics/Path)` selectionPath, `[Paint](https://developer.android.com/reference/android/graphics/Paint)` selectionPaint, int cursorOffsetVertical) ` Draw this layout on the specified canvas. | | ` void`                                                                                                        | ` `[drawBackground](https://developer.android.com/reference/android/text/Layout#drawBackground(android.graphics.Canvas))`(`[Canvas](https://developer.android.com/reference/android/graphics/Canvas)` canvas) ` Draw background of this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` void`                                                                                                        | ` `[drawText](https://developer.android.com/reference/android/text/Layout#drawText(android.graphics.Canvas))`(`[Canvas](https://developer.android.com/reference/android/graphics/Canvas)` canvas) ` Draw text part of this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` void`                                                                                                        | ` `[fillCharacterBounds](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 `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)             | ` `[getAlignment](https://developer.android.com/reference/android/text/Layout#getAlignment())`() ` Returns the alignment used for creating this layout in pixels.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` abstract int`                                                                                                | ` `[getBottomPadding](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`                                                                                                   | ` `[getBreakStrategy](https://developer.android.com/reference/android/text/Layout#getBreakStrategy())`() ` Return the break strategy used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` void`                                                                                                        | ` `[getCursorPath](https://developer.android.com/reference/android/text/Layout#getCursorPath(int,%20android.graphics.Path,%20java.lang.CharSequence))`(int point, `[Path](https://developer.android.com/reference/android/graphics/Path)` dest, `[CharSequence](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`                                                                                                | ` `[getDesiredWidth](https://developer.android.com/reference/android/text/Layout#getDesiredWidth(java.lang.CharSequence,%20android.text.TextPaint))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, `[TextPaint](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`                                                                                                | ` `[getDesiredWidth](https://developer.android.com/reference/android/text/Layout#getDesiredWidth(java.lang.CharSequence,%20int,%20int,%20android.text.TextPaint))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` source, int start, int end, `[TextPaint](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`                                                                                                | ` `[getEllipsisCount](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`                                                                                                | ` `[getEllipsisStart](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 `[TextUtils.TruncateAt](https://developer.android.com/reference/android/text/TextUtils.TruncateAt)     | ` `[getEllipsize](https://developer.android.com/reference/android/text/Layout#getEllipsize())`() ` Return the ellipsize option used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` int`                                                                                                         | ` `[getEllipsizedWidth](https://developer.android.com/reference/android/text/Layout#getEllipsizedWidth())`() ` Return the width to which this layout is ellipsized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` int`                                                                                                         | ` `[getHeight](https://developer.android.com/reference/android/text/Layout#getHeight())`() ` Return the total height of this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` final int`                                                                                                   | ` `[getHyphenationFrequency](https://developer.android.com/reference/android/text/Layout#getHyphenationFrequency())`() ` Return the hyphenation frequency used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` final int`                                                                                                   | ` `[getJustificationMode](https://developer.android.com/reference/android/text/Layout#getJustificationMode())`() ` Return the justification mode used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` final int[]`                                                                                                 | ` `[getLeftIndents](https://developer.android.com/reference/android/text/Layout#getLeftIndents())`() ` Return a copy of the left indents used for this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` final int`                                                                                                   | ` `[getLineAscent](https://developer.android.com/reference/android/text/Layout#getLineAscent(int))`(int line) ` Get the ascent of the text on the specified line.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` final int`                                                                                                   | ` `[getLineBaseline](https://developer.android.com/reference/android/text/Layout#getLineBaseline(int))`(int line) ` Return the vertical position of the baseline of the specified line.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` int`                                                                                                         | ` `[getLineBottom](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`                                                                                                   | ` `[getLineBottom](https://developer.android.com/reference/android/text/Layout#getLineBottom(int))`(int line) ` Return the vertical position of the bottom of the specified line.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` int`                                                                                                         | ` `[getLineBounds](https://developer.android.com/reference/android/text/Layout#getLineBounds(int,%20android.graphics.Rect))`(int line, `[Rect](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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | ` `[LineBreakConfig](https://developer.android.com/reference/android/graphics/text/LineBreakConfig)            | ` `[getLineBreakConfig](https://developer.android.com/reference/android/text/Layout#getLineBreakConfig())`() ` Gets the[LineBreakConfig](https://developer.android.com/reference/android/graphics/text/LineBreakConfig)used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` abstract boolean`                                                                                            | ` `[getLineContainsTab](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`                                                                                                | ` `[getLineCount](https://developer.android.com/reference/android/text/Layout#getLineCount())`() ` Return the number of lines of text in this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` abstract int`                                                                                                | ` `[getLineDescent](https://developer.android.com/reference/android/text/Layout#getLineDescent(int))`(int line) ` Return the descent of the specified line(0...getLineCount() - 1).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` abstract `[Layout.Directions](https://developer.android.com/reference/android/text/Layout.Directions)        | ` `[getLineDirections](https://developer.android.com/reference/android/text/Layout#getLineDirections(int))`(int line) ` Returns the directional run information for the specified line.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` final int`                                                                                                   | ` `[getLineEnd](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`                                                                                                         | ` `[getLineForOffset](https://developer.android.com/reference/android/text/Layout#getLineForOffset(int))`(int offset) ` Get the line number on which the specified text offset appears.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` int`                                                                                                         | ` `[getLineForVertical](https://developer.android.com/reference/android/text/Layout#getLineForVertical(int))`(int vertical) ` Get the line number corresponding to the specified vertical position.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` float`                                                                                                       | ` `[getLineLeft](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`                                                                                                         | ` `[getLineLetterSpacingUnitCount](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`                                                                                                       | ` `[getLineMax](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`                                                                                                       | ` `[getLineRight](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`                                                                                                 | ` `[getLineSpacingAmount](https://developer.android.com/reference/android/text/Layout#getLineSpacingAmount())`() ` Returns the amount added to the line height.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` final float`                                                                                                 | ` `[getLineSpacingMultiplier](https://developer.android.com/reference/android/text/Layout#getLineSpacingMultiplier())`() ` Returns the multiplier applied to the line height.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` abstract int`                                                                                                | ` `[getLineStart](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`                                                                                                | ` `[getLineTop](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`                                                                                                         | ` `[getLineVisibleEnd](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`                                                                                                       | ` `[getLineWidth](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`                                                                                                   | ` `[getMaxLines](https://developer.android.com/reference/android/text/Layout#getMaxLines())`() ` Return the maximum lines allowed used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` `[Paint.FontMetrics](https://developer.android.com/reference/android/graphics/Paint.FontMetrics)             | ` `[getMinimumFontMetrics](https://developer.android.com/reference/android/text/Layout#getMinimumFontMetrics())`() ` Get the minimum font metrics used for line spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` int`                                                                                                         | ` `[getOffsetForHorizontal](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`                                                                                                         | ` `[getOffsetToLeftOf](https://developer.android.com/reference/android/text/Layout#getOffsetToLeftOf(int))`(int offset) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | | ` int`                                                                                                         | ` `[getOffsetToRightOf](https://developer.android.com/reference/android/text/Layout#getOffsetToRightOf(int))`(int offset) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | ` final `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)                           | ` `[getPaint](https://developer.android.com/reference/android/text/Layout#getPaint())`() ` Return the paint used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` final `[Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment)             | ` `[getParagraphAlignment](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`                                                                                                | ` `[getParagraphDirection](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[DIR_LEFT_TO_RIGHT](https://developer.android.com/reference/android/text/Layout#DIR_LEFT_TO_RIGHT),[DIR_RIGHT_TO_LEFT](https://developer.android.com/reference/android/text/Layout#DIR_RIGHT_TO_LEFT)).                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` final int`                                                                                                   | ` `[getParagraphLeft](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`                                                                                                   | ` `[getParagraphRight](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`                                                                                                       | ` `[getPrimaryHorizontal](https://developer.android.com/reference/android/text/Layout#getPrimaryHorizontal(int))`(int offset) ` Get the primary horizontal position for the specified text offset.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` int[]`                                                                                                       | ` `[getRangeForRect](https://developer.android.com/reference/android/text/Layout#getRangeForRect(android.graphics.RectF,%20android.text.SegmentFinder,%20android.text.Layout.TextInclusionStrategy))`(`[RectF](https://developer.android.com/reference/android/graphics/RectF)` area, `[SegmentFinder](https://developer.android.com/reference/android/text/SegmentFinder)` segmentFinder, `[Layout.TextInclusionStrategy](https://developer.android.com/reference/android/text/Layout.TextInclusionStrategy)` inclusionStrategy) ` Finds the range of text which is inside the specified rectangle area.                                                                                                                                                                                                                                                                                                            | | ` final int[]`                                                                                                 | ` `[getRightIndents](https://developer.android.com/reference/android/text/Layout#getRightIndents())`() ` Return a copy of the right indents used for this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` float`                                                                                                       | ` `[getSecondaryHorizontal](https://developer.android.com/reference/android/text/Layout#getSecondaryHorizontal(int))`(int offset) ` Get the secondary horizontal position for the specified text offset.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | | ` void`                                                                                                        | ` `[getSelectionPath](https://developer.android.com/reference/android/text/Layout#getSelectionPath(int,%20int,%20android.graphics.Path))`(int start, int end, `[Path](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`                                                                                                     | ` `[getShiftDrawingOffsetForStartOverhang](https://developer.android.com/reference/android/text/Layout#getShiftDrawingOffsetForStartOverhang())`() ` Returns true if shifting drawing offset for start overhang.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` final float`                                                                                                 | ` `[getSpacingAdd](https://developer.android.com/reference/android/text/Layout#getSpacingAdd())`() ` Returns the amount added to the line height.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` final float`                                                                                                 | ` `[getSpacingMultiplier](https://developer.android.com/reference/android/text/Layout#getSpacingMultiplier())`() ` Returns the multiplier applied to the line height.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` final `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)                        | ` `[getText](https://developer.android.com/reference/android/text/Layout#getText())`() ` Return the text used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` final `[TextDirectionHeuristic](https://developer.android.com/reference/android/text/TextDirectionHeuristic) | ` `[getTextDirectionHeuristic](https://developer.android.com/reference/android/text/Layout#getTextDirectionHeuristic())`() ` Returns the text direction heuristic used for creating this layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` abstract int`                                                                                                | ` `[getTopPadding](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`                                                                                                     | ` `[getUseBoundsForWidth](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`                                                                                                   | ` `[getWidth](https://developer.android.com/reference/android/text/Layout#getWidth())`() ` Return the width used for creating this layout in pixels.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` final void`                                                                                                  | ` `[increaseWidthTo](https://developer.android.com/reference/android/text/Layout#increaseWidthTo(int))`(int wid) ` Increase the width of this layout to the specified width.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | | ` boolean`                                                                                                     | ` `[isFallbackLineSpacingEnabled](https://developer.android.com/reference/android/text/Layout#isFallbackLineSpacingEnabled())`() ` Return true if the fallback line space is enabled in this Layout.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | | ` final boolean`                                                                                               | ` `[isFontPaddingIncluded](https://developer.android.com/reference/android/text/Layout#isFontPaddingIncluded())`() ` Returns true if this layout is created with increased line height.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` boolean`                                                                                                     | ` `[isRtlCharAt](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`                                                                                               | ` `[isSpanned](https://developer.android.com/reference/android/text/Layout#isSpanned())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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*.                                                                                             | ||
| From interface` `[android.text.TextUtils.EllipsizeCallback](https://developer.android.com/reference/android/text/TextUtils.EllipsizeCallback)` ` |------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[ellipsized](https://developer.android.com/reference/android/text/TextUtils.EllipsizeCallback#ellipsized(int,%20int))`(int start, int end) ` This method is called to report that the specified region of text was ellipsized away by a call to[TextUtils.ellipsize(CharSequence, TextPaint, float, TruncateAt)](https://developer.android.com/reference/android/text/TextUtils#ellipsize(java.lang.CharSequence,%20android.text.TextPaint,%20float,%20android.text.TextUtils.TruncateAt)). | ||

## Public constructors

### BoringLayout

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

```
public BoringLayout (CharSequence source, 
                TextPaint paint, 
                int outerwidth, 
                Layout.Alignment align, 
                float spacingMult, 
                float spacingAdd, 
                BoringLayout.Metrics metrics, 
                boolean includePad)
```

<br />

<br />

|                                                                      Parameters                                                                      ||
|---------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `source`      | `CharSequence`: the text to render <br />                                                                                             |
| `paint`       | `TextPaint`: the default paint for the layout <br />                                                                                  |
| `outerwidth`  | `int`: the wrapping width for the text <br />                                                                                         |
| `align`       | `Layout.Alignment`: whether to left, right, or center the text <br />                                                                 |
| `spacingMult` | `float`: this value is no longer used by BoringLayout <br />                                                                          |
| `spacingAdd`  | `float`: this value is no longer used by BoringLayout <br />                                                                          |
| `metrics`     | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width <br />                           |
| `includePad`  | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br /> |

### BoringLayout

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

```
public BoringLayout (CharSequence source, 
                TextPaint paint, 
                int outerWidth, 
                Layout.Alignment align, 
                float spacingMult, 
                float spacingAdd, 
                BoringLayout.Metrics metrics, 
                boolean includePad, 
                TextUtils.TruncateAt ellipsize, 
                int ellipsizedWidth)
```

<br />

<br />

|                                                                                                                                   Parameters                                                                                                                                    ||
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source`          | `CharSequence`: the text to render <br />                                                                                                                                                                                                                    |
| `paint`           | `TextPaint`: the default paint for the layout <br />                                                                                                                                                                                                         |
| `outerWidth`      | `int`: the wrapping width for the text <br />                                                                                                                                                                                                                |
| `align`           | `Layout.Alignment`: whether to left, right, or center the text <br />                                                                                                                                                                                        |
| `spacingMult`     | `float`: this value is no longer used by BoringLayout <br />                                                                                                                                                                                                 |
| `spacingAdd`      | `float`: this value is no longer used by BoringLayout <br />                                                                                                                                                                                                 |
| `metrics`         | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width <br />                                                                                                                                                  |
| `includePad`      | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br />                                                                                                                        |
| `ellipsize`       | `TextUtils.TruncateAt`: whether to ellipsize the text if width of the text is longer than the requested`outerWidth` <br />                                                                                                                                   |
| `ellipsizedWidth` | `int`: the width to which this Layout is ellipsizing. If`ellipsize`is`null`, or is[TextUtils.TruncateAt.MARQUEE](https://developer.android.com/reference/android/text/TextUtils.TruncateAt#MARQUEE)this value is not used,`outerWidth`is used instead <br /> |

### BoringLayout

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

```
public BoringLayout (CharSequence source, 
                TextPaint paint, 
                int outerWidth, 
                Layout.Alignment align, 
                float spacingMult, 
                float spacingAdd, 
                BoringLayout.Metrics metrics, 
                boolean includePad, 
                TextUtils.TruncateAt ellipsize, 
                int ellipsizedWidth, 
                boolean useFallbackLineSpacing)
```

<br />

<br />

|                                                                                                                                                  Parameters                                                                                                                                                  ||
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source`                 | `CharSequence`: the text to render This value cannot be`null`. <br />                                                                                                                                                                                                              |
| `paint`                  | `TextPaint`: the default paint for the layout This value cannot be`null`. <br />                                                                                                                                                                                                   |
| `outerWidth`             | `int`: the wrapping width for the text Value is 0 or greater <br />                                                                                                                                                                                                                |
| `align`                  | `Layout.Alignment`: whether to left, right, or center the text This value cannot be`null`. <br />                                                                                                                                                                                  |
| `spacingMult`            | `float`: this value is no longer used by BoringLayout <br />                                                                                                                                                                                                                       |
| `spacingAdd`             | `float`: this value is no longer used by BoringLayout <br />                                                                                                                                                                                                                       |
| `metrics`                | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width This value cannot be`null`. <br />                                                                                                                                            |
| `includePad`             | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br />                                                                                                                                              |
| `ellipsize`              | `TextUtils.TruncateAt`: whether to ellipsize the text if width of the text is longer than the requested`outerWidth`. null if ellipsis is not applied. <br />                                                                                                                       |
| `ellipsizedWidth`        | `int`: the width to which this Layout is ellipsizing. If`ellipsize`is`null`, or is[TextUtils.TruncateAt.MARQUEE](https://developer.android.com/reference/android/text/TextUtils.TruncateAt#MARQUEE)this value is not used,`outerWidth`is used instead Value is 0 or greater <br /> |
| `useFallbackLineSpacing` | `boolean`: True for adjusting the line spacing based on fallback fonts. False for keeping the first font's line height. If some glyphs requires larger vertical spaces, by passing true to this argument, the layout increase the line height to fit all glyphs. <br />            |

## Public methods

### computeDrawingBoundingBox

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

```
public RectF computeDrawingBoundingBox ()
```

Get an actual bounding box that draws text content. Note that the[RectF.top](https://developer.android.com/reference/android/graphics/RectF#top)and[RectF.bottom](https://developer.android.com/reference/android/graphics/RectF#bottom)may be different from the[Layout.getLineTop(int)](https://developer.android.com/reference/android/text/Layout#getLineTop(int))of the first line and[Layout.getLineBottom(int)](https://developer.android.com/reference/android/text/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.

<br />

|                                                   Returns                                                   ||
|-------------------------------------------------------------------------|------------------------------------|
| [RectF](https://developer.android.com/reference/android/graphics/RectF) | This value cannot be`null`. <br /> |

### draw

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

```
public void draw (Canvas c, 
                Path highlight, 
                Paint highlightpaint, 
                int cursorOffset)
```

Draw this Layout on the specified canvas, with the highlight path drawn between the background and the text.

<br />

|                                                  Parameters                                                  ||
|------------------|--------------------------------------------------------------------------------------------|
| `c`              | `Canvas`: the canvas <br />                                                                |
| `highlight`      | `Path`: the path of the selection highlight or cursor; can be null <br />                  |
| `highlightpaint` | `Paint`: the paint for the selection highlight <br />                                      |
| `cursorOffset`   | `int`: the amount to temporarily translate the canvas while rendering the highlight <br /> |

### ellipsized

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

```
public void ellipsized (int start, 
                int end)
```

Callback for the ellipsizer to report what region it ellipsized.

<br />

|      Parameters       ||
|---------|--------------|
| `start` | `int` <br /> |
| `end`   | `int` <br /> |

### 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[getWidth()](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 /> |

### getHeight

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

```
public int getHeight ()
```

Return the total height of this layout.

<br />

|    Returns    ||
|-------|--------|
| `int` | <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                                               ||
|---------------------------------------------------------------------------------------------|--------|
| [Layout.Directions](https://developer.android.com/reference/android/text/Layout.Directions) | <br /> |

### getLineMax

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

```
public float getLineMax (int line)
```

Gets the unsigned horizontal extent of the specified line, including leading margin indent, but excluding trailing whitespace.

<br />

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

|     Returns     ||
|---------|--------|
| `float` | <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 /> |

### getLineWidth

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

```
public float getLineWidth (int line)
```

Gets the unsigned horizontal extent of the specified line, including leading margin indent and trailing whitespace.

<br />

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

|     Returns     ||
|---------|--------|
| `float` | <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[DIR_LEFT_TO_RIGHT](https://developer.android.com/reference/android/text/Layout#DIR_LEFT_TO_RIGHT),[DIR_RIGHT_TO_LEFT](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 /> |

### isBoring

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

```
public static BoringLayout.Metrics isBoring (CharSequence text, 
                TextPaint paint, 
                BoringLayout.Metrics metrics)
```

Determine and compute metrics if given text can be handled by BoringLayout.

<br />

|                                                          Parameters                                                           ||
|-----------|--------------------------------------------------------------------------------------------------------------------|
| `text`    | `CharSequence`: a text <br />                                                                                      |
| `paint`   | `TextPaint`: a paint <br />                                                                                        |
| `metrics` | `BoringLayout.Metrics`: a metrics object to be recycled. If null is passed, this function creat new object. <br /> |

|                                                                                                                                                          Returns                                                                                                                                                           ||
|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics) | layout metric for the given text. If metrics is not null, this method fills values to given metrics object instead of allocating new metrics object. null if given text is unable to be handled by BoringLayout. <br /> |

### isBoring

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

```
public static BoringLayout.Metrics isBoring (CharSequence text, 
                TextPaint paint)
```

Determine and compute metrics if given text can be handled by BoringLayout.

<br />

|               Parameters               ||
|---------|-------------------------------|
| `text`  | `CharSequence`: a text <br /> |
| `paint` | `TextPaint`: a paint <br />   |

|                                                                                                 Returns                                                                                                 ||
|---------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics) | layout metric for the given text. null if given text is unable to be handled by BoringLayout. <br /> |

### isBoring

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

```
public static BoringLayout.Metrics isBoring (CharSequence text, 
                TextPaint paint, 
                TextDirectionHeuristic textDir, 
                boolean useFallbackLineSpacing, 
                BoringLayout.Metrics metrics)
```

Returns null if not boring; the width, ascent, and descent in the provided Metrics object (or a new one if the provided one was null) if boring.

<br />

|                                                                                                                                            Parameters                                                                                                                                             ||
|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `text`                   | `CharSequence`: a text to be calculated text layout. This value cannot be`null`. <br />                                                                                                                                                                                 |
| `paint`                  | `TextPaint`: a paint object used for styling. This value cannot be`null`. <br />                                                                                                                                                                                        |
| `textDir`                | `TextDirectionHeuristic`: a text direction. This value cannot be`null`. <br />                                                                                                                                                                                          |
| `useFallbackLineSpacing` | `boolean`: True for adjusting the line spacing based on fallback fonts. False for keeping the first font's line height. If some glyphs requires larger vertical spaces, by passing true to this argument, the layout increase the line height to fit all glyphs. <br /> |
| `metrics`                | `BoringLayout.Metrics`: the out metrics. This value may be`null`. <br />                                                                                                                                                                                                |

|                                                                                    Returns                                                                                     ||
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| [BoringLayout.Metrics](https://developer.android.com/reference/android/text/BoringLayout.Metrics) | metrics on success. null if text cannot be rendered by BoringLayout. <br /> |

### isFallbackLineSpacingEnabled

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

```
public boolean isFallbackLineSpacingEnabled ()
```

Return true if the fallback line space is enabled in this Layout.

<br />

|                                         Returns                                         ||
|-----------|------------------------------------------------------------------------------|
| `boolean` | true if the fallback line space is enabled. Otherwise, returns false. <br /> |

### make

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

```
public static BoringLayout make (CharSequence source, 
                TextPaint paint, 
                int outerWidth, 
                Layout.Alignment align, 
                BoringLayout.Metrics metrics, 
                boolean includePad, 
                TextUtils.TruncateAt ellipsize, 
                int ellipsizedWidth, 
                boolean useFallbackLineSpacing)
```

Utility function to construct a BoringLayout instance. The spacing multiplier and additional amount spacing are not used by BoringLayout.[Layout.getSpacingMultiplier()](https://developer.android.com/reference/android/text/Layout#getSpacingMultiplier())will return 1.0 and[Layout.getSpacingAdd()](https://developer.android.com/reference/android/text/Layout#getSpacingAdd())will return 0.0.

<br />

|                                                                                                                                                  Parameters                                                                                                                                                  ||
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source`                 | `CharSequence`: the text to render This value cannot be`null`. <br />                                                                                                                                                                                                              |
| `paint`                  | `TextPaint`: the default paint for the layout This value cannot be`null`. <br />                                                                                                                                                                                                   |
| `outerWidth`             | `int`: the wrapping width for the text Value is 0 or greater <br />                                                                                                                                                                                                                |
| `align`                  | `Layout.Alignment`: whether to left, right, or center the text This value cannot be`null`. <br />                                                                                                                                                                                  |
| `metrics`                | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width This value cannot be`null`. <br />                                                                                                                                            |
| `includePad`             | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br />                                                                                                                                              |
| `ellipsize`              | `TextUtils.TruncateAt`: whether to ellipsize the text if width of the text is longer than the requested width. null if ellipsis is not applied. <br />                                                                                                                             |
| `ellipsizedWidth`        | `int`: the width to which this Layout is ellipsizing. If`ellipsize`is`null`, or is[TextUtils.TruncateAt.MARQUEE](https://developer.android.com/reference/android/text/TextUtils.TruncateAt#MARQUEE)this value is not used,`outerWidth`is used instead Value is 0 or greater <br /> |
| `useFallbackLineSpacing` | `boolean`: True for adjusting the line spacing based on fallback fonts. False for keeping the first font's line height. If some glyphs requires larger vertical spaces, by passing true to this argument, the layout increase the line height to fit all glyphs. <br />            |

|                                                        Returns                                                        ||
|-----------------------------------------------------------------------------------|------------------------------------|
| [BoringLayout](https://developer.android.com/reference/android/text/BoringLayout) | This value cannot be`null`. <br /> |

### make

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

```
public static BoringLayout make (CharSequence source, 
                TextPaint paint, 
                int outerWidth, 
                Layout.Alignment align, 
                float spacingmult, 
                float spacingadd, 
                BoringLayout.Metrics metrics, 
                boolean includePad, 
                TextUtils.TruncateAt ellipsize, 
                int ellipsizedWidth)
```

Utility function to construct a BoringLayout instance.

<br />

|                                                                                                                                   Parameters                                                                                                                                    ||
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source`          | `CharSequence`: the text to render <br />                                                                                                                                                                                                                    |
| `paint`           | `TextPaint`: the default paint for the layout <br />                                                                                                                                                                                                         |
| `outerWidth`      | `int`: the wrapping width for the text <br />                                                                                                                                                                                                                |
| `align`           | `Layout.Alignment`: whether to left, right, or center the text <br />                                                                                                                                                                                        |
| `spacingmult`     | `float`: this value is no longer used by BoringLayout <br />                                                                                                                                                                                                 |
| `spacingadd`      | `float`: this value is no longer used by BoringLayout <br />                                                                                                                                                                                                 |
| `metrics`         | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width <br />                                                                                                                                                  |
| `includePad`      | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br />                                                                                                                        |
| `ellipsize`       | `TextUtils.TruncateAt`: whether to ellipsize the text if width of the text is longer than the requested width <br />                                                                                                                                         |
| `ellipsizedWidth` | `int`: the width to which this Layout is ellipsizing. If`ellipsize`is`null`, or is[TextUtils.TruncateAt.MARQUEE](https://developer.android.com/reference/android/text/TextUtils.TruncateAt#MARQUEE)this value is not used,`outerWidth`is used instead <br /> |

|                                          Returns                                          ||
|-----------------------------------------------------------------------------------|--------|
| [BoringLayout](https://developer.android.com/reference/android/text/BoringLayout) | <br /> |

### make

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

```
public static BoringLayout make (CharSequence source, 
                TextPaint paint, 
                int outerWidth, 
                Layout.Alignment align, 
                float spacingMult, 
                float spacingAdd, 
                BoringLayout.Metrics metrics, 
                boolean includePad)
```

Utility function to construct a BoringLayout instance.

<br />

|                                                                      Parameters                                                                      ||
|---------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `source`      | `CharSequence`: the text to render <br />                                                                                             |
| `paint`       | `TextPaint`: the default paint for the layout <br />                                                                                  |
| `outerWidth`  | `int`: the wrapping width for the text <br />                                                                                         |
| `align`       | `Layout.Alignment`: whether to left, right, or center the text <br />                                                                 |
| `spacingMult` | `float`: this value is no longer used by BoringLayout <br />                                                                          |
| `spacingAdd`  | `float`: this value is no longer used by BoringLayout <br />                                                                          |
| `metrics`     | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width <br />                           |
| `includePad`  | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br /> |

|                                          Returns                                          ||
|-----------------------------------------------------------------------------------|--------|
| [BoringLayout](https://developer.android.com/reference/android/text/BoringLayout) | <br /> |

### replaceOrMake

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

```
public BoringLayout replaceOrMake (CharSequence source, 
                TextPaint paint, 
                int outerWidth, 
                Layout.Alignment align, 
                BoringLayout.Metrics metrics, 
                boolean includePad, 
                TextUtils.TruncateAt ellipsize, 
                int ellipsizedWidth, 
                boolean useFallbackLineSpacing)
```

Returns a BoringLayout for the specified text, potentially reusing this one if it is already suitable. The caller must make sure that no one is still using this Layout. The spacing multiplier and additional amount spacing are not used by BoringLayout.[Layout.getSpacingMultiplier()](https://developer.android.com/reference/android/text/Layout#getSpacingMultiplier())will return 1.0 and[Layout.getSpacingAdd()](https://developer.android.com/reference/android/text/Layout#getSpacingAdd())will return 0.0.

<br />

|                                                                                                                                                  Parameters                                                                                                                                                  ||
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source`                 | `CharSequence`: the text to render This value cannot be`null`. <br />                                                                                                                                                                                                              |
| `paint`                  | `TextPaint`: the default paint for the layout This value cannot be`null`. <br />                                                                                                                                                                                                   |
| `outerWidth`             | `int`: the wrapping width for the text Value is 0 or greater <br />                                                                                                                                                                                                                |
| `align`                  | `Layout.Alignment`: whether to left, right, or center the text This value cannot be`null`. <br />                                                                                                                                                                                  |
| `metrics`                | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width This value cannot be`null`. <br />                                                                                                                                            |
| `includePad`             | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br />                                                                                                                                              |
| `ellipsize`              | `TextUtils.TruncateAt`: whether to ellipsize the text if width of the text is longer than the requested width. null if ellipsis not applied. <br />                                                                                                                                |
| `ellipsizedWidth`        | `int`: the width to which this Layout is ellipsizing. If`ellipsize`is`null`, or is[TextUtils.TruncateAt.MARQUEE](https://developer.android.com/reference/android/text/TextUtils.TruncateAt#MARQUEE)this value is not used,`outerWidth`is used instead Value is 0 or greater <br /> |
| `useFallbackLineSpacing` | `boolean`: True for adjusting the line spacing based on fallback fonts. False for keeping the first font's line height. If some glyphs requires larger vertical spaces, by passing true to this argument, the layout increase the line height to fit all glyphs. <br />            |

|                                                        Returns                                                        ||
|-----------------------------------------------------------------------------------|------------------------------------|
| [BoringLayout](https://developer.android.com/reference/android/text/BoringLayout) | This value cannot be`null`. <br /> |

### replaceOrMake

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

```
public BoringLayout replaceOrMake (CharSequence source, 
                TextPaint paint, 
                int outerWidth, 
                Layout.Alignment align, 
                float spacingMult, 
                float spacingAdd, 
                BoringLayout.Metrics metrics, 
                boolean includePad, 
                TextUtils.TruncateAt ellipsize, 
                int ellipsizedWidth)
```

Returns a BoringLayout for the specified text, potentially reusing this one if it is already suitable. The caller must make sure that no one is still using this Layout.

<br />

|                                                                                                                                   Parameters                                                                                                                                    ||
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source`          | `CharSequence`: the text to render <br />                                                                                                                                                                                                                    |
| `paint`           | `TextPaint`: the default paint for the layout <br />                                                                                                                                                                                                         |
| `outerWidth`      | `int`: the wrapping width for the text <br />                                                                                                                                                                                                                |
| `align`           | `Layout.Alignment`: whether to left, right, or center the text <br />                                                                                                                                                                                        |
| `spacingMult`     | `float`: this value is no longer used by BoringLayout <br />                                                                                                                                                                                                 |
| `spacingAdd`      | `float`: this value is no longer used by BoringLayout <br />                                                                                                                                                                                                 |
| `metrics`         | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width <br />                                                                                                                                                  |
| `includePad`      | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br />                                                                                                                        |
| `ellipsize`       | `TextUtils.TruncateAt`: whether to ellipsize the text if width of the text is longer than the requested width <br />                                                                                                                                         |
| `ellipsizedWidth` | `int`: the width to which this Layout is ellipsizing. If`ellipsize`is`null`, or is[TextUtils.TruncateAt.MARQUEE](https://developer.android.com/reference/android/text/TextUtils.TruncateAt#MARQUEE)this value is not used,`outerWidth`is used instead <br /> |

|                                          Returns                                          ||
|-----------------------------------------------------------------------------------|--------|
| [BoringLayout](https://developer.android.com/reference/android/text/BoringLayout) | <br /> |

### replaceOrMake

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

```
public BoringLayout replaceOrMake (CharSequence source, 
                TextPaint paint, 
                int outerwidth, 
                Layout.Alignment align, 
                float spacingMult, 
                float spacingAdd, 
                BoringLayout.Metrics metrics, 
                boolean includePad)
```

Returns a BoringLayout for the specified text, potentially reusing this one if it is already suitable. The caller must make sure that no one is still using this Layout.

<br />

|                                                                      Parameters                                                                      ||
|---------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `source`      | `CharSequence`: the text to render <br />                                                                                             |
| `paint`       | `TextPaint`: the default paint for the layout <br />                                                                                  |
| `outerwidth`  | `int`: the wrapping width for the text <br />                                                                                         |
| `align`       | `Layout.Alignment`: whether to left, right, or center the text <br />                                                                 |
| `spacingMult` | `float`: this value is no longer used by BoringLayout <br />                                                                          |
| `spacingAdd`  | `float`: this value is no longer used by BoringLayout <br />                                                                          |
| `metrics`     | `BoringLayout.Metrics`:`#Metrics`instance that contains information about FontMetrics and line width <br />                           |
| `includePad`  | `boolean`: set whether to include extra space beyond font ascent and descent which is needed to avoid clipping in some scripts <br /> |

|                                          Returns                                          ||
|-----------------------------------------------------------------------------------|--------|
| [BoringLayout](https://developer.android.com/reference/android/text/BoringLayout) | <br /> |