EdgeContentLayout
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);
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 |
|---|
public final class EdgeContentLayout.Builder implements LayoutElementBuilders.LayoutElement.BuilderBuilder class for |
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 |
@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
public static @Nullable EdgeContentLayoutfromLayoutElement(@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.
public @Nullable LayoutElementBuilders.LayoutElementgetContent()
Returns the inner content from this layout.
public @Nullable LayoutElementBuilders.LayoutElementgetEdgeContent()
Returns the edge content from this layout.
public @Nullable LayoutElementBuilders.LayoutElementgetPrimaryLabelTextContent()
Get the primary label content from this layout.
public @Nullable LayoutElementBuilders.LayoutElementgetSecondaryLabelTextContent()
Get the secondary label content from this layout.