LayoutElementBuilders.Column
@RequiresSchemaVersion(major = 1, minor = 0)
public final class LayoutElementBuilders.Column implements LayoutElementBuilders.LayoutElement
A column of elements. Each child element will be laid out vertically, one after another (i.e. stacking down). 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 column will be 30x60).
If specified, horizontal_alignment can be used to control the gravity inside the container, affecting the horizontal placement of children whose width are smaller than the resulting column width.
Summary
Nested types |
|---|
public final class LayoutElementBuilders.Column.BuilderBuilder for |
Public methods |
|
|---|---|
@NonNull List<LayoutElementBuilders.LayoutElement> |
Gets the list of child elements to place inside this |
@Nullable DimensionBuilders.ContainerDimension |
Gets the height of this column. |
@Nullable LayoutElementBuilders.HorizontalAlignmentProp |
Gets the horizontal alignment of elements inside this column, if they are narrower than the resulting width of the column. |
@Nullable ModifiersBuilders.Modifiers |
Gets |
@Nullable DimensionBuilders.ContainerDimension |
getWidth()Gets the width of this column. |
@NonNull String |
toString() |
Public methods
getContents
public @NonNull List<LayoutElementBuilders.LayoutElement> getContents()
Gets the list of child elements to place inside this Column.
getHeight
public @Nullable DimensionBuilders.ContainerDimension getHeight()
Gets the height of this column. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).
getHorizontalAlignment
public @Nullable LayoutElementBuilders.HorizontalAlignmentProp getHorizontalAlignment()
Gets the horizontal alignment of elements inside this column, if they are narrower than the resulting width of the column. If not defined, defaults to HORIZONTAL_ALIGN_CENTER.
getModifiers
public @Nullable ModifiersBuilders.Modifiers getModifiers()
Gets androidx.wear.protolayout.ModifiersBuilders.Modifiers for this element.
getWidth
public @Nullable DimensionBuilders.ContainerDimension getWidth()
Gets the width of this column. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).