LayoutElementBuilders.Image.Builder

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

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


Builder for LayoutElementBuilders.Image.

Summary

Public methods

LayoutElementBuilders.Image build()

Builds an instance with values accumulated in this Builder.

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.

LayoutElementBuilders.Image.Builder setHeight(DimensionBuilders.ImageDimension.Builder heightBuilder)

Sets the height of this image.

LayoutElementBuilders.Image.Builder setHeight(DimensionBuilders.ImageDimension height)

Sets the height of this image.

LayoutElementBuilders.Image.Builder setModifiers(ModifiersBuilders.Modifiers modifiers)

Sets ModifiersBuilders.Modifiers for this element.

LayoutElementBuilders.Image.Builder setModifiers(ModifiersBuilders.Modifiers.Builder modifiersBuilder)

Sets ModifiersBuilders.Modifiers for this element.

LayoutElementBuilders.Image.Builder setResourceId(String resourceId)

Sets the resource_id of the image to render.

LayoutElementBuilders.Image.Builder setWidth(DimensionBuilders.ImageDimension.Builder widthBuilder)

Sets the width of this image.

LayoutElementBuilders.Image.Builder setWidth(DimensionBuilders.ImageDimension width)

Sets the width of this image.

Inherited methods

Public methods

build

public LayoutElementBuilders.Image build ()

Builds an instance with values accumulated in this Builder.

Returns
LayoutElementBuilders.Image

setContentScaleMode

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

Parameters
contentScaleMode int

Returns
LayoutElementBuilders.Image.Builder

setHeight

public LayoutElementBuilders.Image.Builder setHeight (DimensionBuilders.ImageDimension.Builder heightBuilder)

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

Parameters
heightBuilder DimensionBuilders.ImageDimension.Builder

Returns
LayoutElementBuilders.Image.Builder

setHeight

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

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

Parameters
height DimensionBuilders.ImageDimension

Returns
LayoutElementBuilders.Image.Builder

setModifiers

public LayoutElementBuilders.Image.Builder setModifiers (ModifiersBuilders.Modifiers modifiers)

Sets ModifiersBuilders.Modifiers for this element.

Parameters
modifiers ModifiersBuilders.Modifiers

Returns
LayoutElementBuilders.Image.Builder

setModifiers

public LayoutElementBuilders.Image.Builder setModifiers (ModifiersBuilders.Modifiers.Builder modifiersBuilder)

Sets ModifiersBuilders.Modifiers for this element.

Parameters
modifiersBuilder ModifiersBuilders.Modifiers.Builder

Returns
LayoutElementBuilders.Image.Builder

setResourceId

public LayoutElementBuilders.Image.Builder setResourceId (String resourceId)

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

Parameters
resourceId String

Returns
LayoutElementBuilders.Image.Builder

setWidth

public LayoutElementBuilders.Image.Builder setWidth (DimensionBuilders.ImageDimension.Builder widthBuilder)

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

Parameters
widthBuilder DimensionBuilders.ImageDimension.Builder

Returns
LayoutElementBuilders.Image.Builder

setWidth

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

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

Parameters
width DimensionBuilders.ImageDimension

Returns
LayoutElementBuilders.Image.Builder