TypeBuilders.StringLayoutConstraint.Builder


public final class TypeBuilders.StringLayoutConstraint.Builder


Builder for StringLayoutConstraint.

Summary

Public constructors

@RequiresSchemaVersion(major = 1, minor = 200)
Builder(@NonNull String patternForLayout)

Creates a new builder for StringLayoutConstraint.

Public methods

@NonNull TypeBuilders.StringLayoutConstraint

Builds an instance of StringLayoutConstraint.

@NonNull TypeBuilders.StringLayoutConstraint.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setAlignment(int alignment)

Sets alignment of the actual text within the space reserved by patternForLayout.

Public constructors

Builder

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
public Builder(@NonNull String patternForLayout)

Creates a new builder for StringLayoutConstraint.

Parameters
@NonNull String patternForLayout

Sets the text string to use as the pattern for the largest text that can be laid out. Used to ensure that the layout is of a known size during the layout pass.

Public methods

build

Added in 1.0.0
public @NonNull TypeBuilders.StringLayoutConstraint build()

Builds an instance of StringLayoutConstraint.

setAlignment

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull TypeBuilders.StringLayoutConstraint.Builder setAlignment(int alignment)

Sets alignment of the actual text within the space reserved by patternForLayout. If not specified, defaults to center alignment.