LayoutElementBuilders.Image


@RequiresSchemaVersion(major = 1, minor = 0)
class LayoutElementBuilders.Image : LayoutElementBuilders.LayoutElement


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 types

Builder for Image.

Public functions

LayoutElementBuilders.ColorFilter?

Gets filtering parameters for this image.

LayoutElementBuilders.ContentScaleModeProp?

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

DimensionBuilders.ImageDimension?

Gets the height of this image.

ModifiersBuilders.Modifiers?

Gets androidx.wear.protolayout.ModifiersBuilders.Modifiers for this element.

TypeBuilders.StringProp?

Gets the resource_id of the image to render.

DimensionBuilders.ImageDimension?

Gets the width of this image.

String

Public functions

getColorFilter

Added in 1.0.0
fun getColorFilter(): LayoutElementBuilders.ColorFilter?

Gets filtering parameters for this image. If not specified, defaults to no filtering.

getContentScaleMode

Added in 1.0.0
fun getContentScaleMode(): LayoutElementBuilders.ContentScaleModeProp?

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.

getHeight

Added in 1.0.0
fun getHeight(): DimensionBuilders.ImageDimension?

Gets the height of this image. If not defined, the image will not be rendered.

getResourceId

Added in 1.0.0
fun getResourceId(): TypeBuilders.StringProp?

Gets the resource_id of the image to render. This must exist in the supplied resource bundle.

getWidth

Added in 1.0.0
fun getWidth(): DimensionBuilders.ImageDimension?

Gets the width of this image. If not defined, the image will not be rendered.

toString

fun toString(): String