LayoutElementBuilders.Image

public static final class LayoutElementBuilders.Image
extends Object implements LayoutElementBuilders.LayoutElement

java.lang.Object
   ↳ androidx.wear.tiles.LayoutElementBuilders.Image


An image.

Images used in this element must exist in the resource bundle that corresponds to this layout. Images must have their dimension specified, and will be rendered at this width and height, regardless of their native dimension.

Summary

Nested classes

class LayoutElementBuilders.Image.Builder

Builder for LayoutElementBuilders.Image

Public methods

static LayoutElementBuilders.Image.Builder builder()

Returns a new LayoutElementBuilders.Image.Builder.

LayoutElementBuilders.ContentScaleModeProp getContentScaleMode()

Gets how to scale the image resource inside the bounds specified by width/height if its size does not match those bounds.

LayoutElementBuilders.ColorFilter getFilter()

Gets filtering parameters for this image.

DimensionBuilders.ImageDimension getHeight()

Gets the height of this image.

ModifiersBuilders.Modifiers getModifiers()

Gets ModifiersBuilders.Modifiers for this element.

TypeBuilders.StringProp getResourceId()

Gets the resource_id of the image to render.

DimensionBuilders.ImageDimension getWidth()

Gets the width of this image.

Inherited methods

Public methods

getContentScaleMode

public LayoutElementBuilders.ContentScaleModeProp getContentScaleMode ()

Gets how to scale the image resource inside the bounds specified by width/height if its size does not match those bounds. Defaults to CONTENT_SCALE_MODE_FIT. Intended for testing purposes only.

Returns
LayoutElementBuilders.ContentScaleModeProp

getFilter

public LayoutElementBuilders.ColorFilter getFilter ()

Gets filtering parameters for this image. If not specified, defaults to no filtering. Intended for testing purposes only.

Returns
LayoutElementBuilders.ColorFilter

getHeight

public DimensionBuilders.ImageDimension getHeight ()

Gets the height of this image. If not defined, the image will not be rendered. Intended for testing purposes only.

Returns
DimensionBuilders.ImageDimension

getModifiers

public ModifiersBuilders.Modifiers getModifiers ()

Gets ModifiersBuilders.Modifiers for this element. Intended for testing purposes only.

Returns
ModifiersBuilders.Modifiers

getResourceId

public TypeBuilders.StringProp getResourceId ()

Gets the resource_id of the image to render. This must exist in the supplied resource bundle. Intended for testing purposes only.

Returns
TypeBuilders.StringProp

getWidth

public DimensionBuilders.ImageDimension getWidth ()

Gets the width of this image. If not defined, the image will not be rendered. Intended for testing purposes only.

Returns
DimensionBuilders.ImageDimension