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

LineBreak.WordBreak.Companion

public static class LineBreak.WordBreak.Companion


Summary

Public methods

static final @NonNull LineBreak.WordBreak

Default word breaking rules for the locale.

static final @NonNull LineBreak.WordBreak

Line breaking is based on phrases.

Public methods

getDefault

public static final @NonNull LineBreak.WordBreak getDefault()

Default word breaking rules for the locale. In latin scripts this means inserting line breaks between words, while in languages that don't use whitespace (e.g. Japanese) the line can break between characters.

+---------+
| This is |
| an      |
| example |
| text.   |
| 今日は自  |
| 由が丘で  |
| 焼き鳥を  |
| 食べま   |
| す。     |
+---------+

getPhrase

public static final @NonNull LineBreak.WordBreak getPhrase()

Line breaking is based on phrases. In languages that don't use whitespace (e.g. Japanese), line breaks are not inserted between characters that are part of the same phrase unit. This is ideal for short text such as titles and UI labels.

+---------+
| This    |
| is an   |
| example |
| text.   |
| 今日は   |
| 自由が丘  |
| で焼き鳥  |
| を食べ   |
| ます。   |
+---------+