# LayoutElementBuilders.Box

Artifact: [androidx.wear.tiles:tiles](https://developer.android.com/jetpack/androidx/releases/wear-tiles) [View Source](https://cs.android.com/search?q=file:androidx/wear/tiles/LayoutElementBuilders.java+class:androidx.wear.tiles.LayoutElementBuilders.Box) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

*** ** * ** ***


```
public final class LayoutElementBuilders.Box implements LayoutElementBuilders.LayoutElement
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Deprecated in Java

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 |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box.Builder implements https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.LayoutElement.Builder` **This class is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.LayoutElement>` | `[getContents](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getContents())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/DimensionBuilders.ContainerDimension` | `[getHeight](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getHeight())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.HorizontalAlignmentProp` | `[getHorizontalAlignment](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getHorizontalAlignment())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/ModifiersBuilders.Modifiers` | `[getModifiers](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getModifiers())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.VerticalAlignmentProp` | `[getVerticalAlignment](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getVerticalAlignment())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/DimensionBuilders.ContainerDimension` | `[getWidth](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getWidth())()` **This method is deprecated.** Deprecated in Java |

## Public methods

### getContents

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @NonNull List<LayoutElementBuilders.LayoutElement> [getContents](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getContents())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

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

### getHeight

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable DimensionBuilders.ContainerDimension [getHeight](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getHeight())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the height of this `https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box`. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension). Intended for testing purposes only.

### getHorizontalAlignment

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable LayoutElementBuilders.HorizontalAlignmentProp [getHorizontalAlignment](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getHorizontalAlignment())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the horizontal alignment of the element inside this `https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box`. If not defined, defaults to HORIZONTAL_ALIGN_CENTER. Intended for testing purposes only.

### getModifiers

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable ModifiersBuilders.Modifiers [getModifiers](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getModifiers())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets `https://developer.android.com/reference/androidx/wear/tiles/ModifiersBuilders.Modifiers` for this element. Intended for testing purposes only.

### getVerticalAlignment

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable LayoutElementBuilders.VerticalAlignmentProp [getVerticalAlignment](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getVerticalAlignment())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the vertical alignment of the element inside this `https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box`. If not defined, defaults to VERTICAL_ALIGN_CENTER. Intended for testing purposes only.

### getWidth

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable DimensionBuilders.ContainerDimension [getWidth](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box#getWidth())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the width of this `https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.Box`. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension). Intended for testing purposes only.