ResourceBuilders.InlineImageResource.Builder

public static final class ResourceBuilders.InlineImageResource.Builder
extends Object

java.lang.Object
   ↳ androidx.wear.tiles.builders.ResourceBuilders.InlineImageResource.Builder


Builder for ResourceBuilders.InlineImageResource

Summary

Public methods

ResourceBuilders.InlineImageResource build()

Builds an instance from accumulated values.

ResourceBuilders.InlineImageResource.Builder setData(byte[] data)

Sets the byte array representing the image.

ResourceBuilders.InlineImageResource.Builder setFormat(int format)

Sets the format of the byte array data representing the image.

ResourceBuilders.InlineImageResource.Builder setHeightPx(int heightPx)

Sets the native height of the image, in pixels.

ResourceBuilders.InlineImageResource.Builder setWidthPx(int widthPx)

Sets the native width of the image, in pixels.

Inherited methods

Public methods

build

public ResourceBuilders.InlineImageResource build ()

Builds an instance from accumulated values.

Returns
ResourceBuilders.InlineImageResource

setData

public ResourceBuilders.InlineImageResource.Builder setData (byte[] data)

Sets the byte array representing the image.

Parameters
data byte

Returns
ResourceBuilders.InlineImageResource.Builder

setFormat

public ResourceBuilders.InlineImageResource.Builder setFormat (int format)

Sets the format of the byte array data representing the image. May be left unspecified or set to IMAGE_FORMAT_UNDEFINED in which case the platform will attempt to extract this from the raw image data. If the platform does not support the format, the image will not be decoded or displayed.

Parameters
format int

Returns
ResourceBuilders.InlineImageResource.Builder

setHeightPx

public ResourceBuilders.InlineImageResource.Builder setHeightPx (int heightPx)

Sets the native height of the image, in pixels. Only required for formats (e.g. IMAGE_FORMAT_RGB_565) where the image data does not include size.

Parameters
heightPx int

Returns
ResourceBuilders.InlineImageResource.Builder

setWidthPx

public ResourceBuilders.InlineImageResource.Builder setWidthPx (int widthPx)

Sets the native width of the image, in pixels. Only required for formats (e.g. IMAGE_FORMAT_RGB_565) where the image data does not include size.

Parameters
widthPx int

Returns
ResourceBuilders.InlineImageResource.Builder