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 |
|---|
public final class LayoutElementBuilders.Spacer.BuilderBuilder for |
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 |
@Nullable DimensionBuilders.HorizontalLayoutConstraint |
Gets the bounding constraints for the layout affected by the dynamic value from |
@Nullable ModifiersBuilders.Modifiers |
Gets |
@Nullable DimensionBuilders.SpacerDimension |
getWidth()Gets the width of this |
@NonNull String |
toString() |
Public methods
getHeight
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
public @Nullable DimensionBuilders.VerticalLayoutConstraint getLayoutConstraintsForDynamicHeight()
Gets the bounding constraints for the layout affected by the dynamic value from getHeight.
getLayoutConstraintsForDynamicWidth
public @Nullable DimensionBuilders.HorizontalLayoutConstraint getLayoutConstraintsForDynamicWidth()
Gets the bounding constraints for the layout affected by the dynamic value from getWidth.
getModifiers
public @Nullable ModifiersBuilders.Modifiers getModifiers()
Gets androidx.wear.protolayout.ModifiersBuilders.Modifiers for this element.
getWidth
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).