LayoutElementBuilders.Spacer.Builder


class LayoutElementBuilders.Spacer.Builder


Builder for Spacer.

Summary

Public constructors

Creates an instance of Builder.

Public functions

LayoutElementBuilders.Spacer

Builds an instance with values accumulated in this Builder.

LayoutElementBuilders.Spacer.Builder

Sets the height of this spacer.

LayoutElementBuilders.Spacer.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setLayoutConstraintsForDynamicHeight(
    verticalLayoutConstraint: DimensionBuilders.VerticalLayoutConstraint
)

Sets the bounding constraints for the layout affected by the dynamic value from setHeight.

LayoutElementBuilders.Spacer.Builder
@RequiresSchemaVersion(major = 1, minor = 200)
setLayoutConstraintsForDynamicWidth(
    horizontalLayoutConstraint: DimensionBuilders.HorizontalLayoutConstraint
)

Sets the bounding constraints for the layout affected by the dynamic value from setWidth.

LayoutElementBuilders.Spacer.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setModifiers(modifiers: ModifiersBuilders.Modifiers)

Sets androidx.wear.protolayout.ModifiersBuilders.Modifiers for this element.

LayoutElementBuilders.Spacer.Builder

Sets the width of this Spacer.

Public constructors

Builder

Added in 1.0.0
Builder()

Creates an instance of Builder.

Public functions

build

Added in 1.0.0
fun build(): LayoutElementBuilders.Spacer

Builds an instance with values accumulated in this Builder.

setHeight

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setHeight(height: DimensionBuilders.SpacerDimension): LayoutElementBuilders.Spacer.Builder

Sets the height of this spacer. If not defined, defaults to 0.

While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).

When using a dynamic value, make sure to specify the bounding constraints for the affected layout element through setLayoutConstraintsForDynamicWidth(HorizontalLayoutConstraint) otherwise build() fails.

setLayoutConstraintsForDynamicHeight

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setLayoutConstraintsForDynamicHeight(
    verticalLayoutConstraint: DimensionBuilders.VerticalLayoutConstraint
): LayoutElementBuilders.Spacer.Builder

Sets the bounding constraints for the layout affected by the dynamic value from setHeight. If the SpacerDimension does not have a dynamic value, this will be ignored.

setLayoutConstraintsForDynamicWidth

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
fun setLayoutConstraintsForDynamicWidth(
    horizontalLayoutConstraint: DimensionBuilders.HorizontalLayoutConstraint
): LayoutElementBuilders.Spacer.Builder

Sets the bounding constraints for the layout affected by the dynamic value from setWidth. If the SpacerDimension does not have a dynamic value, this will be ignored.

setWidth

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setWidth(width: DimensionBuilders.SpacerDimension): LayoutElementBuilders.Spacer.Builder

Sets the width of this Spacer. When this is added as the direct child of an Arc, this must be specified as an angular dimension, otherwise a linear dimension must be used. If not defined, defaults to 0.

While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).

When using a dynamic value, make sure to specify the bounding constraints for the affected layout element through setLayoutConstraintsForDynamicWidth(HorizontalLayoutConstraint) otherwise build() fails.