LayoutElementBuilders.Box

public static final class LayoutElementBuilders.Box
extends Object implements LayoutElementBuilders.LayoutElement

java.lang.Object
   ↳ androidx.wear.tiles.LayoutElementBuilders.Box


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 classes

class LayoutElementBuilders.Box.Builder

Builder for LayoutElementBuilders.Box

Public methods

static LayoutElementBuilders.Box.Builder builder()

Returns a new LayoutElementBuilders.Box.Builder.

List<LayoutElementBuilders.LayoutElement> getContents()

Gets the child element(s) to wrap.

DimensionBuilders.ContainerDimension getHeight()

Gets the height of this LayoutElementBuilders.Box.

LayoutElementBuilders.HorizontalAlignmentProp getHorizontalAlignment()

Gets the horizontal alignment of the element inside this LayoutElementBuilders.Box.

ModifiersBuilders.Modifiers getModifiers()

Gets ModifiersBuilders.Modifiers for this element.

LayoutElementBuilders.VerticalAlignmentProp getVerticalAlignment()

Gets the vertical alignment of the element inside this LayoutElementBuilders.Box.

DimensionBuilders.ContainerDimension getWidth()

Gets the width of this LayoutElementBuilders.Box.

Inherited methods

Public methods

getContents

public List<LayoutElementBuilders.LayoutElement> getContents ()

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

Returns
List<LayoutElementBuilders.LayoutElement>

getHeight

public DimensionBuilders.ContainerDimension getHeight ()

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

Returns
DimensionBuilders.ContainerDimension

getHorizontalAlignment

public LayoutElementBuilders.HorizontalAlignmentProp getHorizontalAlignment ()

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

Returns
LayoutElementBuilders.HorizontalAlignmentProp

getModifiers

public ModifiersBuilders.Modifiers getModifiers ()

Gets ModifiersBuilders.Modifiers for this element. Intended for testing purposes only.

Returns
ModifiersBuilders.Modifiers

getVerticalAlignment

public LayoutElementBuilders.VerticalAlignmentProp getVerticalAlignment ()

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

Returns
LayoutElementBuilders.VerticalAlignmentProp

getWidth

public DimensionBuilders.ContainerDimension getWidth ()

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

Returns
DimensionBuilders.ContainerDimension