Język

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.

This is a special value of hyphenation preference indicating no hyphenation preference is specified. When overriding a LineBreakConfig with another LineBreakConfig with Builder.merge(LineBreakConfig) function, the hyphenation preference of overridden config will be kept if the hyphenation preference of overriding config is HYPHENATION_UNSPECIFIED.

val override = LineBreakConfig.Builder()
     .setLineBreakWordStyle(LineBreakConfig.LINE_BREAK_WORD_STYLE_PHRASE)
     .build();  // UNSPECIFIED if no setHyphenation is called.
val config = 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.

This value is resolved to HYPHENATION_ENABLED if this value is used for text layout/rendering.

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

The hyphenation is enabled. Note: Even if the hyphenation is enabled with a line break strategy LineBreaker.BREAK_STRATEGY_SIMPLE, the hyphenation will not be performed unless a single word cannot meet 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 Android 16 LineBreakConfig.

Applies to