Language

LineBreakHyphenation Enum

Definition

Specifies a line-break configuration's hyphenation preference.

public enum LineBreakHyphenation
type LineBreakHyphenation = 
Inheritance
LineBreakHyphenation

Fields

Name Value Description
Unspecified -1

No hyphenation preference is specified.

When Merge(LineBreakConfig) merges a configuration with an unspecified hyphenation preference, it keeps the builder's existing preference.

LineBreakConfig override = new LineBreakConfig.Builder()
     .setLineBreakWordStyle(LineBreakConfig.LINE_BREAK_WORD_STYLE_PHRASE)
     .build();  // UNSPECIFIED if no setHyphenation is called.
LineBreakConfig config = new LineBreakConfig.Builder()
     .setHyphenation(LineBreakConfig.HYPHENATION_DISABLED)
     .merge(override)
     .build();
// Here, config has HYPHENATION_DISABLED for line break config and
// LINE_BREAK_WORD_STYLE_PHRASE for line break word style.

For text layout, this value resolves to Enabled.

Android reference for android.graphics.text.LineBreakConfig.HYPHENATION_UNSPECIFIED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Disabled 0

The hyphenation is disabled.

Android reference for android.graphics.text.LineBreakConfig.HYPHENATION_DISABLED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Enabled 1

Hyphenation is enabled. With the Simple strategy, hyphenation is not performed unless a single word cannot meet the width constraints.

Android reference for android.graphics.text.LineBreakConfig.HYPHENATION_ENABLED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Remarks

Unspecified preserves the existing preference when configurations are merged. It resolves to enabled when used for text layout. An enabled preference does not override a line breaker's None setting.

This enum exposes the HYPHENATION_* constants from LineBreakConfig.

Applies to