EdgeContentLayout

Added in 1.1.0
Deprecated in 1.2.0

class EdgeContentLayout : LayoutElementBuilders.LayoutElement


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.

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.:

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 EdgeContentLayout object from any layout element, fromLayoutElement method should be used, i.e.:

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

Summary

Public functions

java-static EdgeContentLayout?

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.

LayoutElementBuilders.LayoutElement?

Returns the inner content from this layout.

LayoutElementBuilders.LayoutElement?

Returns the edge content from this layout.

LayoutElementBuilders.LayoutElement?

Get the primary label content from this layout.

LayoutElementBuilders.LayoutElement?

Get the secondary label content from this layout.

Public functions

fromLayoutElement

Added in 1.1.0
Deprecated in 1.2.0
java-static fun fromLayoutElement(element: LayoutElementBuilders.LayoutElement): EdgeContentLayout?

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
Deprecated in 1.2.0
fun getContent(): LayoutElementBuilders.LayoutElement?

Returns the inner content from this layout.

getEdgeContent

Added in 1.1.0
Deprecated in 1.2.0
fun getEdgeContent(): LayoutElementBuilders.LayoutElement?

Returns the edge content from this layout.

getPrimaryLabelTextContent

Added in 1.1.0
Deprecated in 1.2.0
fun getPrimaryLabelTextContent(): LayoutElementBuilders.LayoutElement?

Get the primary label content from this layout.

getSecondaryLabelTextContent

Added in 1.1.0
Deprecated in 1.2.0
fun getSecondaryLabelTextContent(): LayoutElementBuilders.LayoutElement?

Get the secondary label content from this layout.