LayoutElementBuilders.Spacer


@RequiresSchemaVersion(major = 1, minor = 0)
public final class LayoutElementBuilders.Spacer implements LayoutElementBuilders.LayoutElement


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

Summary

Nested types

Builder for Spacer.

Public methods

@Nullable DimensionBuilders.SpacerDimension

Gets the height of this spacer.

@Nullable DimensionBuilders.VerticalLayoutConstraint

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

@Nullable DimensionBuilders.HorizontalLayoutConstraint

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

@Nullable ModifiersBuilders.Modifiers

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

@Nullable DimensionBuilders.SpacerDimension

Gets the width of this Spacer.

@NonNull String

Public methods

getHeight

Added in 1.0.0
public @Nullable DimensionBuilders.SpacerDimension getHeight()

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

getLayoutConstraintsForDynamicHeight

Added in 1.0.0
public @Nullable DimensionBuilders.VerticalLayoutConstraint getLayoutConstraintsForDynamicHeight()

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

getLayoutConstraintsForDynamicWidth

Added in 1.0.0
public @Nullable DimensionBuilders.HorizontalLayoutConstraint getLayoutConstraintsForDynamicWidth()

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

getWidth

Added in 1.0.0
public @Nullable DimensionBuilders.SpacerDimension getWidth()

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

toString

public @NonNull String toString()