LayoutElementBuilders.Box
@RequiresSchemaVersion(major = 1, minor = 0)
class LayoutElementBuilders.Box : 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 |
|---|
|
Builder for |
Public functions |
|
|---|---|
(Mutable)List<LayoutElementBuilders.LayoutElement!> |
Gets the child element(s) to wrap. |
DimensionBuilders.ContainerDimension? |
Gets the height of this |
LayoutElementBuilders.HorizontalAlignmentProp? |
Gets the horizontal alignment of the element inside this |
ModifiersBuilders.Modifiers? |
Gets |
LayoutElementBuilders.VerticalAlignmentProp? |
Gets the vertical alignment of the element inside this |
DimensionBuilders.ContainerDimension? |
getWidth()Gets the width of this |
String |
toString() |
Public functions
getContents
fun getContents(): (Mutable)List<LayoutElementBuilders.LayoutElement!>
Gets the child element(s) to wrap.
getHeight
fun getHeight(): DimensionBuilders.ContainerDimension?
Gets the height of this Box. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).
getHorizontalAlignment
fun getHorizontalAlignment(): LayoutElementBuilders.HorizontalAlignmentProp?
Gets the horizontal alignment of the element inside this Box. If not defined, defaults to HORIZONTAL_ALIGN_CENTER.
getModifiers
fun getModifiers(): ModifiersBuilders.Modifiers?
Gets androidx.wear.protolayout.ModifiersBuilders.Modifiers for this element.
getVerticalAlignment
fun getVerticalAlignment(): LayoutElementBuilders.VerticalAlignmentProp?
Gets the vertical alignment of the element inside this Box. If not defined, defaults to VERTICAL_ALIGN_CENTER.
getWidth
fun getWidth(): DimensionBuilders.ContainerDimension?
Gets the width of this Box. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).