LayoutElementBuilders.Spacer.Builder
class LayoutElementBuilders.Spacer.Builder
Builder for Spacer
.
Summary
Public functions
build
fun build(): LayoutElementBuilders.Spacer
Builds an instance with values accumulated in this Builder.
setHeight
@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
@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
@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.
setModifiers
@RequiresSchemaVersion(major = 1, minor = 0)
fun setModifiers(modifiers: ModifiersBuilders.Modifiers): LayoutElementBuilders.Spacer.Builder
Sets androidx.wear.protolayout.ModifiersBuilders.Modifiers
for this element.
setWidth
@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.