LayoutElementBuilders.Image.Builder

public final class LayoutElementBuilders.Image.Builder implements LayoutElementBuilders.LayoutElement.Builder


Builder for Image.

Summary

Public constructors

Public methods

@Override @NonNull LayoutElementBuilders.Image

Builds an instance with values accumulated in this Builder.

@NonNull 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.

@NonNull 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.

@TilesExperimental @NonNull LayoutElementBuilders.Image.Builder

Sets filtering parameters for this image.

@NonNull LayoutElementBuilders.Image.Builder

Sets the height of this image.

@NonNull LayoutElementBuilders.Image.Builder

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

@NonNull LayoutElementBuilders.Image.Builder

Sets the resource_id of the image to render.

@NonNull LayoutElementBuilders.Image.Builder

Sets the resource_id of the image to render.

@NonNull LayoutElementBuilders.Image.Builder

Sets the width of this image.

Public constructors

Builder

public Builder()

Public methods

build

@Override
@NonNull
public @Override LayoutElementBuilders.Image build()

Builds an instance with values accumulated in this Builder.

setContentScaleMode

@NonNull
public LayoutElementBuilders.Image.Builder setContentScaleMode(
    @NonNull LayoutElementBuilders.ContentScaleModeProp contentScaleMode
)

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

@NonNull
public LayoutElementBuilders.Image.Builder setContentScaleMode(
    @LayoutElementBuilders.ContentScaleMode @NonNull int contentScaleMode
)

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.

setFilter

@TilesExperimental
@NonNull
public @TilesExperimental LayoutElementBuilders.Image.Builder setFilter(@NonNull LayoutElementBuilders.ColorFilter filter)

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

setHeight

@NonNull
public LayoutElementBuilders.Image.Builder setHeight(@NonNull DimensionBuilders.ImageDimension height)

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

setResourceId

@NonNull
public LayoutElementBuilders.Image.Builder setResourceId(@NonNull TypeBuilders.StringProp resourceId)

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

setResourceId

@NonNull
public LayoutElementBuilders.Image.Builder setResourceId(@NonNull String resourceId)

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

setWidth

@NonNull
public LayoutElementBuilders.Image.Builder setWidth(@NonNull DimensionBuilders.ImageDimension width)

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