LayoutElementBuilders.Image.Builder


class LayoutElementBuilders.Image.Builder


Builder for Image.

Summary

Public constructors

Creates an instance of Builder.

Public functions

LayoutElementBuilders.Image

Builds an instance with values accumulated in this Builder.

LayoutElementBuilders.Image.Builder

Sets filtering parameters for this image.

LayoutElementBuilders.Image.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setContentScaleMode(contentScaleMode: Int)

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

LayoutElementBuilders.Image.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setContentScaleMode(
    contentScaleMode: LayoutElementBuilders.ContentScaleModeProp
)

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

LayoutElementBuilders.Image.Builder

Sets the height of this image.

LayoutElementBuilders.Image.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setModifiers(modifiers: ModifiersBuilders.Modifiers)

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

LayoutElementBuilders.Image.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setResourceId(resourceId: String)

Sets the resource_id of the image to render.

LayoutElementBuilders.Image.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setResourceId(resourceId: TypeBuilders.StringProp)

Sets the resource_id of the image to render.

LayoutElementBuilders.Image.Builder

Sets the width of this image.

Public constructors

Builder

Added in 1.0.0
Builder()

Creates an instance of Builder.

Public functions

build

Added in 1.0.0
fun build(): LayoutElementBuilders.Image

Builds an instance with values accumulated in this Builder.

setColorFilter

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setColorFilter(colorFilter: LayoutElementBuilders.ColorFilter): LayoutElementBuilders.Image.Builder

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

setContentScaleMode

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setContentScaleMode(contentScaleMode: Int): LayoutElementBuilders.Image.Builder

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

setContentScaleMode

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setContentScaleMode(
    contentScaleMode: LayoutElementBuilders.ContentScaleModeProp
): LayoutElementBuilders.Image.Builder

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

setHeight

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setHeight(height: DimensionBuilders.ImageDimension): LayoutElementBuilders.Image.Builder

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

setResourceId

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setResourceId(resourceId: String): LayoutElementBuilders.Image.Builder

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

setResourceId

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setResourceId(resourceId: TypeBuilders.StringProp): LayoutElementBuilders.Image.Builder

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

Note that this field only supports static values.

setWidth

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setWidth(width: DimensionBuilders.ImageDimension): LayoutElementBuilders.Image.Builder

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