# PrecomputedTextCompat.Params.Builder

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/text/PrecomputedTextCompat.java+class:androidx.core.text.PrecomputedTextCompat.Params.Builder)  
Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/core/text/PrecomputedTextCompat.Params.Builder "View this page in Java")


```
class PrecomputedTextCompat.Params.Builder
```

<br />

*** ** * ** ***

A builder for creating [Params](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params).

## Summary

| ### Public constructors |
|---|
| [Builder](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder#Builder(android.text.TextPaint))`(paint: `[TextPaint](https://developer.android.com/reference/android/text/TextPaint.html)`)` Builder constructor. |

| ### Public functions |
|---|---|
| [PrecomputedTextCompat.Params](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params) | [build](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder#build())`()` Build the [Params](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params). |
| [PrecomputedTextCompat.Params.Builder](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder)`!` | [setBreakStrategy](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder#setBreakStrategy(int))`(strategy: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Set the line break strategy. |
| [PrecomputedTextCompat.Params.Builder](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder)`!` | [setHyphenationFrequency](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder#setHyphenationFrequency(int))`(frequency: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Set the hyphenation frequency. |
| [PrecomputedTextCompat.Params.Builder](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder)`!` | [setTextDirection](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder#setTextDirection(android.text.TextDirectionHeuristic))`(textDir: `[TextDirectionHeuristic](https://developer.android.com/reference/android/text/TextDirectionHeuristic.html)`)` Set the text direction heuristic. |

## Public constructors

### Builder

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
Builder(paint: TextPaint)
```

Builder constructor.  

| Parameters |
|---|---|
| `paint: `[TextPaint](https://developer.android.com/reference/android/text/TextPaint.html) | the paint to be used for drawing |

## Public functions

### build

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun build(): PrecomputedTextCompat.Params
```

Build the [Params](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params).  

| Returns |
|---|---|
| [PrecomputedTextCompat.Params](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params) | the layout parameter |

### setBreakStrategy

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setBreakStrategy(strategy: Int): PrecomputedTextCompat.Params.Builder!
```

Set the line break strategy. The default value is [BREAK_STRATEGY_HIGH_QUALITY](https://developer.android.com/reference/android/text/Layout.html#BREAK_STRATEGY_HIGH_QUALITY()).  

| Parameters |
|---|---|
| `strategy: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the break strategy |

| Returns |
|---|---|
| [PrecomputedTextCompat.Params.Builder](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder)`!` | PrecomputedTextCompat.Builder instance |

| See also |
|---|---|
| [setBreakStrategy](https://developer.android.com/reference/android/text/StaticLayout.Builder.html#setBreakStrategy(int)) |   |
| [setBreakStrategy](https://developer.android.com/reference/android/widget/TextView.html#setBreakStrategy(int)) |   |

### setHyphenationFrequency

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setHyphenationFrequency(frequency: Int): PrecomputedTextCompat.Params.Builder!
```

Set the hyphenation frequency. The default value is [HYPHENATION_FREQUENCY_NORMAL](https://developer.android.com/reference/android/text/Layout.html#HYPHENATION_FREQUENCY_NORMAL()).  

| Parameters |
|---|---|
| `frequency: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the hyphenation frequency |

| Returns |
|---|---|
| [PrecomputedTextCompat.Params.Builder](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder)`!` | PrecomputedTextCompat.Builder instance |

| See also |
|---|---|
| [setHyphenationFrequency](https://developer.android.com/reference/android/text/StaticLayout.Builder.html#setHyphenationFrequency(int)) |   |
| [setHyphenationFrequency](https://developer.android.com/reference/android/widget/TextView.html#setHyphenationFrequency(int)) |   |

### setTextDirection

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setTextDirection(textDir: TextDirectionHeuristic): PrecomputedTextCompat.Params.Builder!
```

Set the text direction heuristic. The default value is [FIRSTSTRONG_LTR](https://developer.android.com/reference/android/text/TextDirectionHeuristics.html#FIRSTSTRONG_LTR()).  

| Parameters |
|---|---|
| `textDir: `[TextDirectionHeuristic](https://developer.android.com/reference/android/text/TextDirectionHeuristic.html) | the text direction heuristic for resolving bidi behavior |

| Returns |
|---|---|
| [PrecomputedTextCompat.Params.Builder](https://developer.android.com/reference/kotlin/androidx/core/text/PrecomputedTextCompat.Params.Builder)`!` | PrecomputedTextCompat.Builder instance |

| See also |
|---|---|
| [setTextDirection](https://developer.android.com/reference/android/text/StaticLayout.Builder.html#setTextDirection(android.text.TextDirectionHeuristic)) |   |