LayoutElementBuilders.Box

public final class LayoutElementBuilders.Box implements LayoutElementBuilders.LayoutElement


A container which stacks all of its children on top of one another. This also allows to add a background color, or to have a border around them with some padding.

Summary

Nested types

LayoutElementBuilders.Box.Builder

Builder for Box.

Public methods

@NonNull List<@NonNull LayoutElementBuilders.LayoutElement>

Gets the child element(s) to wrap.

@Nullable DimensionBuilders.ContainerDimension

Gets the height of this Box.

@Nullable LayoutElementBuilders.HorizontalAlignmentProp

Gets the horizontal alignment of the element inside this Box.

@Nullable ModifiersBuilders.Modifiers

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

@Nullable LayoutElementBuilders.VerticalAlignmentProp

Gets the vertical alignment of the element inside this Box.

@Nullable DimensionBuilders.ContainerDimension

Gets the width of this Box.

Public methods

getContents

@NonNull
public List<@NonNull LayoutElementBuilders.LayoutElementgetContents()

Gets the child element(s) to wrap. Intended for testing purposes only.

getHeight

@Nullable
@NonNull
public DimensionBuilders.ContainerDimension getHeight()

Gets the height of this Box. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension). Intended for testing purposes only.

getHorizontalAlignment

@Nullable
@NonNull
public LayoutElementBuilders.HorizontalAlignmentProp getHorizontalAlignment()

Gets the horizontal alignment of the element inside this Box. If not defined, defaults to HORIZONTAL_ALIGN_CENTER. Intended for testing purposes only.

getModifiers

@Nullable
@NonNull
public ModifiersBuilders.Modifiers getModifiers()

Gets androidx.wear.tiles.ModifiersBuilders.Modifiers for this element. Intended for testing purposes only.

getVerticalAlignment

@Nullable
@NonNull
public LayoutElementBuilders.VerticalAlignmentProp getVerticalAlignment()

Gets the vertical alignment of the element inside this Box. If not defined, defaults to VERTICAL_ALIGN_CENTER. Intended for testing purposes only.

getWidth

@Nullable
@NonNull
public DimensionBuilders.ContainerDimension getWidth()

Gets the width of this Box. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension). Intended for testing purposes only.