LayoutElementBuilders.Image.Builder

Added in 1.0.0
Deprecated in 1.2.0

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


Builder for Image.

Summary

Public constructors

Public methods

@NonNull LayoutElementBuilders.Image

Builds an instance with values accumulated in this Builder.

@NonNull LayoutElementBuilders.Image.Builder

Sets filtering parameters for this image.

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

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.

@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

Added in 1.0.0
Deprecated in 1.2.0
public Builder()

Public methods

build

Added in 1.4.0-alpha01
Deprecated in 1.4.0-alpha01
public @NonNull LayoutElementBuilders.Image build()

Builds an instance with values accumulated in this Builder.

setColorFilter

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull LayoutElementBuilders.Image.Builder setColorFilter(@NonNull LayoutElementBuilders.ColorFilter colorFilter)

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

setContentScaleMode

Added in 1.0.0
Deprecated in 1.2.0
public @NonNull LayoutElementBuilders.Image.Builder setContentScaleMode(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.

setContentScaleMode

Added in 1.0.0
Deprecated in 1.2.0
public @NonNull 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.

setHeight

Added in 1.0.0
Deprecated in 1.2.0
public @NonNull LayoutElementBuilders.Image.Builder setHeight(@NonNull DimensionBuilders.ImageDimension height)

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

setResourceId

Added in 1.0.0
Deprecated in 1.2.0
public @NonNull LayoutElementBuilders.Image.Builder setResourceId(@NonNull String resourceId)

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

setResourceId

Added in 1.0.0
Deprecated in 1.2.0
public @NonNull 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.

setWidth

Added in 1.0.0
Deprecated in 1.2.0
public @NonNull LayoutElementBuilders.Image.Builder setWidth(@NonNull DimensionBuilders.ImageDimension width)

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