LayoutElementBuilders.Box.Builder


public final class LayoutElementBuilders.Box.Builder


Builder for Box.

Summary

Public constructors

Creates an instance of Builder.

Public methods

@NonNull LayoutElementBuilders.Box.Builder

Adds one item to the child element(s) to wrap.

@NonNull LayoutElementBuilders.Box

Builds an instance from accumulated values.

@NonNull LayoutElementBuilders.Box.Builder

Sets the height of this Box.

@NonNull LayoutElementBuilders.Box.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setHorizontalAlignment(int horizontalAlignment)

Sets the horizontal alignment of the element inside this Box.

@NonNull LayoutElementBuilders.Box.Builder

Sets the horizontal alignment of the element inside this Box.

@NonNull LayoutElementBuilders.Box.Builder

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

@NonNull LayoutElementBuilders.Box.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setVerticalAlignment(int verticalAlignment)

Sets the vertical alignment of the element inside this Box.

@NonNull LayoutElementBuilders.Box.Builder

Sets the vertical alignment of the element inside this Box.

@NonNull LayoutElementBuilders.Box.Builder

Sets the width of this Box.

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates an instance of Builder.

Public methods

addContent

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Box.Builder addContent(@NonNull LayoutElementBuilders.LayoutElement content)

Adds one item to the child element(s) to wrap.

build

Added in 1.0.0
public @NonNull LayoutElementBuilders.Box build()

Builds an instance from accumulated values.

setHeight

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Box.Builder setHeight(@NonNull DimensionBuilders.ContainerDimension height)

Sets the height of this Box. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).

setHorizontalAlignment

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Box.Builder setHorizontalAlignment(int horizontalAlignment)

Sets the horizontal alignment of the element inside this Box. If not defined, defaults to HORIZONTAL_ALIGN_CENTER.

setHorizontalAlignment

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Box.Builder setHorizontalAlignment(
    @NonNull LayoutElementBuilders.HorizontalAlignmentProp horizontalAlignment
)

Sets the horizontal alignment of the element inside this Box. If not defined, defaults to HORIZONTAL_ALIGN_CENTER.

setVerticalAlignment

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Box.Builder setVerticalAlignment(int verticalAlignment)

Sets the vertical alignment of the element inside this Box. If not defined, defaults to VERTICAL_ALIGN_CENTER.

setVerticalAlignment

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Box.Builder setVerticalAlignment(
    @NonNull LayoutElementBuilders.VerticalAlignmentProp verticalAlignment
)

Sets the vertical alignment of the element inside this Box. If not defined, defaults to VERTICAL_ALIGN_CENTER.

setWidth

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull LayoutElementBuilders.Box.Builder setWidth(@NonNull DimensionBuilders.ContainerDimension width)

Sets the width of this Box. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).