EdgeContentLayout

Added in 1.1.0
Deprecated in 1.2.0

public class EdgeContentLayout implements 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

Nested types

Builder class for EdgeContentLayout.

Public methods

static @Nullable 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.

@Nullable LayoutElementBuilders.LayoutElement

Returns the inner content from this layout.

@Nullable LayoutElementBuilders.LayoutElement

Returns the edge content from this layout.

@Nullable LayoutElementBuilders.LayoutElement

Get the primary label content from this layout.

@Nullable LayoutElementBuilders.LayoutElement

Get the secondary label content from this layout.

Public methods

fromLayoutElement

Added in 1.1.0
Deprecated in 1.2.0
public static @Nullable EdgeContentLayout fromLayoutElement(@NonNull LayoutElementBuilders.LayoutElement element)

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
public @Nullable LayoutElementBuilders.LayoutElement getContent()

Returns the inner content from this layout.

getEdgeContent

Added in 1.1.0
Deprecated in 1.2.0
public @Nullable LayoutElementBuilders.LayoutElement getEdgeContent()

Returns the edge content from this layout.

getPrimaryLabelTextContent

Added in 1.1.0
Deprecated in 1.2.0
public @Nullable LayoutElementBuilders.LayoutElement getPrimaryLabelTextContent()

Get the primary label content from this layout.

getSecondaryLabelTextContent

Added in 1.1.0
Deprecated in 1.2.0
public @Nullable LayoutElementBuilders.LayoutElement getSecondaryLabelTextContent()

Get the secondary label content from this layout.