ResourceBuilders.ImageResource


@RequiresSchemaVersion(major = 1, minor = 0)
class ResourceBuilders.ImageResource


An image resource, which can be used by layouts. This holds multiple underlying resource types, which the underlying runtime will pick according to what it thinks is appropriate.

Summary

Nested types

Builder for ImageResource

Public functions

ResourceBuilders.AndroidAnimatedImageResourceByResId?

Gets a non-seekable animated image resource that maps to an Android drawable by resource ID.

ResourceBuilders.AndroidLottieResourceByResId?

Gets a Lottie resource that is read from a raw Android resource ID.

ResourceBuilders.AndroidImageResourceByResId?

Gets an image resource that maps to an Android drawable by resource ID.

ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId?

Gets a seekable animated image resource that maps to an Android drawable by resource ID.

ResourceBuilders.InlineImageResource?

Gets an image resource that contains the image data inline.

String

Public functions

getAndroidAnimatedResourceByResId

Added in 1.0.0
@ProtoLayoutExperimental
fun getAndroidAnimatedResourceByResId(): ResourceBuilders.AndroidAnimatedImageResourceByResId?

Gets a non-seekable animated image resource that maps to an Android drawable by resource ID. The animation is started with given trigger, fire and forget.

getAndroidLottieResourceByResId

Added in 1.3.0-alpha05
fun getAndroidLottieResourceByResId(): ResourceBuilders.AndroidLottieResourceByResId?

Gets a Lottie resource that is read from a raw Android resource ID.

getAndroidResourceByResId

Added in 1.0.0
fun getAndroidResourceByResId(): ResourceBuilders.AndroidImageResourceByResId?

Gets an image resource that maps to an Android drawable by resource ID.

getAndroidSeekableAnimatedResourceByResId

Added in 1.0.0
@ProtoLayoutExperimental
fun getAndroidSeekableAnimatedResourceByResId(): ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId?

Gets a seekable animated image resource that maps to an Android drawable by resource ID. The animation progress is bound to the provided dynamic float.

getInlineResource

Added in 1.0.0
fun getInlineResource(): ResourceBuilders.InlineImageResource?

Gets an image resource that contains the image data inline.

toString

fun toString(): String