Partager via


LineBreakConfig.Merge(LineBreakConfig) Method

Definition

Generates a new LineBreakConfig instance merged with given config.

[Android.Runtime.Register("merge", "(Landroid/graphics/text/LineBreakConfig;)Landroid/graphics/text/LineBreakConfig;", "", ApiSince=35)]
public Android.Graphics.Text.LineBreakConfig Merge (Android.Graphics.Text.LineBreakConfig config);
[<Android.Runtime.Register("merge", "(Landroid/graphics/text/LineBreakConfig;)Landroid/graphics/text/LineBreakConfig;", "", ApiSince=35)>]
member this.Merge : Android.Graphics.Text.LineBreakConfig -> Android.Graphics.Text.LineBreakConfig

Parameters

config
LineBreakConfig

an overriding config.

Returns

newly created instance that is current style merged with passed config.

Attributes

Remarks

Generates a new LineBreakConfig instance merged with given config.

If values of passing config are unspecified, the original values are kept. For example, the following code shows how line break config is merged.

val override = LineBreakConfig.Builder()
                     .setLineBreakWordStyle(LineBreakConfig.LINE_BREAK_WORD_STYLE_PHRASE)
                     .build();  // UNSPECIFIED if no setLineBreakStyle is called.
                val config = LineBreakConfig.Builder()
                     .setLineBreakStyle(LineBreakConfig.LINE_BREAK_STYLE_STRICT)
                     .build();

                val newConfig = config.merge(override)
                // newConfig has LINE_BREAK_STYLE_STRICT of line break style and
                LINE_BREAK_WORD_STYLE_PHRASE of line break word style.

Java documentation for android.graphics.text.LineBreakConfig.merge(android.graphics.text.LineBreakConfig).

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.

Applies to