LayoutElementBuilders.Row

public final class LayoutElementBuilders.Row implements LayoutElementBuilders.LayoutElement


A row of elements. Each child will be laid out horizontally, one after another (i.e. stacking to the right). This element will size itself to the smallest size required to hold all of its children (e.g. if it contains three elements sized 10x10, 20x20 and 30x30, the resulting row will be 60x30).

If specified, vertical_alignment can be used to control the gravity inside the container, affecting the vertical placement of children whose width are smaller than the resulting row height.

Summary

Nested types

LayoutElementBuilders.Row.Builder

Builder for Row.

Public methods

static @NonNull LayoutElementBuilders.Row.Builder

Returns a new Builder.

@NonNull List<@NonNull LayoutElementBuilders.LayoutElement>

Gets the list of child elements to place inside this Row.

@Nullable DimensionBuilders.ContainerDimension

Gets the height of this row.

@Nullable ModifiersBuilders.Modifiers

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

@Nullable LayoutElementBuilders.VerticalAlignmentProp

Gets the vertical alignment of elements inside this row, if they are narrower than the resulting height of the row.

@Nullable DimensionBuilders.ContainerDimension

Gets the width of this row.

Public methods

builder

@NonNull
public static LayoutElementBuilders.Row.Builder builder()

Returns a new Builder.

getContents

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

Gets the list of child elements to place inside this Row. Intended for testing purposes only.

getHeight

@Nullable
@NonNull
public DimensionBuilders.ContainerDimension getHeight()

Gets the height of this row. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension). 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 elements inside this row, if they are narrower than the resulting height of the row. 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 row. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension). Intended for testing purposes only.