{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

LineBreak.Strategy.Companion

public static class LineBreak.Strategy.Companion


Summary

Public methods

static final @NonNull LineBreak.Strategy

Attempts to balance the line lengths of the text, also applying automatic hyphenation if enabled.

static final @NonNull LineBreak.Strategy

Does whole paragraph optimization for more readable text, including hyphenation if enabled.

static final @NonNull LineBreak.Strategy

Basic, fast break strategy.

Public methods

getBalanced

public static final @NonNull LineBreak.Strategy getBalanced()

Attempts to balance the line lengths of the text, also applying automatic hyphenation if enabled. Suitable for small screens.

+-----------------------+
| This is an            |
| example text.         |
+-----------------------+

getHighQuality

public static final @NonNull LineBreak.Strategy getHighQuality()

Does whole paragraph optimization for more readable text, including hyphenation if enabled.

+---------+
| This    |
| is an   |
| example |
| text.   |
+---------+

getSimple

public static final @NonNull LineBreak.Strategy getSimple()

Basic, fast break strategy. Hyphenation, if enabled, is done only for words that don't fit on an entire line by themselves.

+---------+
| This is |
| an      |
| example |
| text.   |
+---------+