ResourceBuilders.ImageResource.Builder


class ResourceBuilders.ImageResource.Builder


Builder for ImageResource

Summary

Public constructors

Creates an instance of Builder.

Public functions

ResourceBuilders.ImageResource

Builds an instance from accumulated values.

ResourceBuilders.ImageResource.Builder

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

ResourceBuilders.ImageResource.Builder
@RequiresSchemaVersion(major = 1, minor = 500)
setAndroidLottieResourceByResId(
    androidLottieResourceByResId: ResourceBuilders.AndroidLottieResourceByResId
)

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

ResourceBuilders.ImageResource.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setAndroidResourceByResId(
    androidResourceByResId: ResourceBuilders.AndroidImageResourceByResId
)

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

ResourceBuilders.ImageResource.Builder

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

ResourceBuilders.ImageResource.Builder

Sets an image resource that contains the image data inline.

Public constructors

Builder

Added in 1.0.0
Builder()

Creates an instance of Builder.

Public functions

build

Added in 1.0.0
fun build(): ResourceBuilders.ImageResource

Builds an instance from accumulated values.

setAndroidAnimatedResourceByResId

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
@ProtoLayoutExperimental
fun setAndroidAnimatedResourceByResId(
    androidAnimatedResourceByResId: ResourceBuilders.AndroidAnimatedImageResourceByResId
): ResourceBuilders.ImageResource.Builder

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

setAndroidLottieResourceByResId

Added in 1.3.0-alpha03
@RequiresSchemaVersion(major = 1, minor = 500)
fun setAndroidLottieResourceByResId(
    androidLottieResourceByResId: ResourceBuilders.AndroidLottieResourceByResId
): ResourceBuilders.ImageResource.Builder

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

setAndroidResourceByResId

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setAndroidResourceByResId(
    androidResourceByResId: ResourceBuilders.AndroidImageResourceByResId
): ResourceBuilders.ImageResource.Builder

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

setAndroidSeekableAnimatedResourceByResId

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
@ProtoLayoutExperimental
fun setAndroidSeekableAnimatedResourceByResId(
    androidSeekableAnimatedResourceByResId: ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId
): ResourceBuilders.ImageResource.Builder

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

setInlineResource

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setInlineResource(inlineResource: ResourceBuilders.InlineImageResource): ResourceBuilders.ImageResource.Builder

Sets an image resource that contains the image data inline.