LayoutElementBuilders.Spacer


@RequiresSchemaVersion(major = 1, minor = 0)
class LayoutElementBuilders.Spacer : LayoutElementBuilders.LayoutElement


A simple spacer, typically used to provide padding between adjacent elements.

Summary

Nested types

Builder for Spacer.

Public functions

DimensionBuilders.SpacerDimension?

Gets the height of this spacer.

DimensionBuilders.VerticalLayoutConstraint?

Gets the bounding constraints for the layout affected by the dynamic value from getHeight.

DimensionBuilders.HorizontalLayoutConstraint?

Gets the bounding constraints for the layout affected by the dynamic value from getWidth.

ModifiersBuilders.Modifiers?

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

DimensionBuilders.SpacerDimension?

Gets the width of this Spacer.

String

Public functions

getHeight

Added in 1.0.0
fun getHeight(): DimensionBuilders.SpacerDimension?

Gets 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.

getLayoutConstraintsForDynamicHeight

Added in 1.0.0
fun getLayoutConstraintsForDynamicHeight(): DimensionBuilders.VerticalLayoutConstraint?

Gets the bounding constraints for the layout affected by the dynamic value from getHeight.

getLayoutConstraintsForDynamicWidth

Added in 1.0.0
fun getLayoutConstraintsForDynamicWidth(): DimensionBuilders.HorizontalLayoutConstraint?

Gets the bounding constraints for the layout affected by the dynamic value from getWidth.

getWidth

Added in 1.0.0
fun getWidth(): DimensionBuilders.SpacerDimension?

Gets 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.

toString

fun toString(): String