LayoutElementBuilders.Image
@RequiresSchemaVersion(major = 1, minor = 0)
public final class LayoutElementBuilders.Image implements LayoutElementBuilders.LayoutElement
An image.
Images used in this element must exist in the resource bundle that corresponds to this layout. Images must have their dimension specified, and will be rendered at this width and height, regardless of their native dimension.
Summary
Nested types |
|---|
public final class LayoutElementBuilders.Image.BuilderBuilder for |
Public methods |
|
|---|---|
@Nullable LayoutElementBuilders.ColorFilter |
Gets filtering parameters for this image. |
@Nullable LayoutElementBuilders.ContentScaleModeProp |
Gets how to scale the image resource inside the bounds specified by width/height if its size does not match those bounds. |
@Nullable DimensionBuilders.ImageDimension |
Gets the height of this image. |
@Nullable ModifiersBuilders.Modifiers |
Gets |
@Nullable TypeBuilders.StringProp |
Gets the resource_id of the image to render. |
@Nullable DimensionBuilders.ImageDimension |
getWidth()Gets the width of this image. |
@NonNull String |
toString() |
Public methods
getColorFilter
public @Nullable LayoutElementBuilders.ColorFilter getColorFilter()
Gets filtering parameters for this image. If not specified, defaults to no filtering.
getContentScaleMode
public @Nullable LayoutElementBuilders.ContentScaleModeProp getContentScaleMode()
Gets 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.
getHeight
public @Nullable DimensionBuilders.ImageDimension getHeight()
Gets the height of this image. If not defined, the image will not be rendered.
getModifiers
public @Nullable ModifiersBuilders.Modifiers getModifiers()
Gets androidx.wear.protolayout.ModifiersBuilders.Modifiers for this element.
getResourceId
public @Nullable TypeBuilders.StringProp getResourceId()
Gets the resource_id of the image to render. This must exist in the supplied resource bundle.
getWidth
public @Nullable DimensionBuilders.ImageDimension getWidth()
Gets the width of this image. If not defined, the image will not be rendered.