ResourceBuilders.ImageResource.Builder


public final class ResourceBuilders.ImageResource.Builder


Builder for ImageResource

Summary

Public constructors

Creates an instance of Builder.

Public methods

@NonNull ResourceBuilders.ImageResource

Builds an instance from accumulated values.

@NonNull ResourceBuilders.ImageResource.Builder

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

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

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

@NonNull ResourceBuilders.ImageResource.Builder

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

@NonNull ResourceBuilders.ImageResource.Builder

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

@NonNull ResourceBuilders.ImageResource.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setInlineResource(
    @NonNull ResourceBuilders.InlineImageResource inlineResource
)

Sets an image resource that contains the image data inline.

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates an instance of Builder.

Public methods

build

Added in 1.0.0
public @NonNull ResourceBuilders.ImageResource build()

Builds an instance from accumulated values.

setAndroidAnimatedResourceByResId

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

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)
public @NonNull ResourceBuilders.ImageResource.Builder setAndroidLottieResourceByResId(
    @NonNull ResourceBuilders.AndroidLottieResourceByResId androidLottieResourceByResId
)

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

setAndroidResourceByResId

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

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
public @NonNull ResourceBuilders.ImageResource.Builder setAndroidSeekableAnimatedResourceByResId(
    @NonNull ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId androidSeekableAnimatedResourceByResId
)

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)
public @NonNull ResourceBuilders.ImageResource.Builder setInlineResource(
    @NonNull ResourceBuilders.InlineImageResource inlineResource
)

Sets an image resource that contains the image data inline.