# EdgeContentLayout

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

*** ** * ** ***


```
class EdgeContentLayout : LayoutElementBuilders.LayoutElement
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use the new class `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/layouts/EdgeContentLayout` which provides the same API and functionality.

Tiles layout that represents the suggested layout style for Material Tiles, which has content around the edge of the screen (e.g. a ProgressIndicator) and the given content inside of it with the recommended margin and padding applied. Optional primary or secondary label can be added above and below the main content, respectively.

For additional examples and suggested layouts see [Tiles Design System](https://developer.android.com/training/wearables/design/tiles-design-system).

When accessing the contents of a container for testing, note that this element can't be simply casted back to the original type, i.e.:

```kotlin
EdgeContentLayout ecl = new EdgeContentLayout...
Box box = new Box.Builder().addContent(ecl).build();

EdgeContentLayout myEcl = (EdgeContentLayout) box.getContents().get(0);
```
will fail.

To be able to get `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout` object from any layout element, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement)` method should be used, i.e.:

```kotlin
EdgeContentLayout myEcl =
  EdgeContentLayout.fromLayoutElement(box.getContents().get(0));
```

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout.Builder : https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement.Builder` **This class is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout?` | `[fromLayoutElement](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(element: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement?` | `[getContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#getContent())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement?` | `[getEdgeContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#getEdgeContent())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement?` | `[getPrimaryLabelTextContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#getPrimaryLabelTextContent())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement?` | `[getSecondaryLabelTextContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#getSecondaryLabelTextContent())()` **This function is deprecated.** Deprecated in Java |

## Public functions

### fromLayoutElement

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

```
java-static fun [fromLayoutElement](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(element: LayoutElementBuilders.LayoutElement): EdgeContentLayout?
```

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

Returns EdgeContentLayout object from the given androidx.wear.tiles.LayoutElementBuilders.LayoutElement (e.g. one retrieved from a container's content with `container.getContents().get(index)`) if that element can be converted to EdgeContentLayout. Otherwise, it will return null.

### getContent

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

```
fun [getContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#getContent())(): LayoutElementBuilders.LayoutElement?
```

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

Returns the inner content from this layout.

### getEdgeContent

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

```
fun [getEdgeContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#getEdgeContent())(): LayoutElementBuilders.LayoutElement?
```

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

Returns the edge content from this layout.

### getPrimaryLabelTextContent

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

```
fun [getPrimaryLabelTextContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#getPrimaryLabelTextContent())(): LayoutElementBuilders.LayoutElement?
```

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

Get the primary label content from this layout.

### getSecondaryLabelTextContent

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

```
fun [getSecondaryLabelTextContent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/layouts/EdgeContentLayout#getSecondaryLabelTextContent())(): LayoutElementBuilders.LayoutElement?
```

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

Get the secondary label content from this layout.