TypeBuilders.StringLayoutConstraint.Builder


class TypeBuilders.StringLayoutConstraint.Builder


Builder for StringLayoutConstraint.

Summary

Public constructors

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

Creates a new builder for StringLayoutConstraint.

Public functions

TypeBuilders.StringLayoutConstraint

Builds an instance of StringLayoutConstraint.

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

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)
Builder(patternForLayout: String)

Creates a new builder for StringLayoutConstraint.

Parameters
patternForLayout: String

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 functions

build

Added in 1.0.0
fun build(): TypeBuilders.StringLayoutConstraint

Builds an instance of StringLayoutConstraint.

setAlignment

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setAlignment(alignment: Int): TypeBuilders.StringLayoutConstraint.Builder

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