ResourceBuilders.AndroidLottieResourceByResId.Builder


public final class ResourceBuilders.AndroidLottieResourceByResId.Builder


Builder for AndroidLottieResourceByResId

Summary

Public constructors

@RequiresSchemaVersion(major = 1, minor = 500)
Builder(@RawRes int resourceId)

Creates an instance of Builder.

Public methods

@NonNull ResourceBuilders.AndroidLottieResourceByResId

Builds an instance from accumulated values.

@NonNull ResourceBuilders.AndroidLottieResourceByResId.Builder

Sets a androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat, normally transformed from certain states with the data binding pipeline to control the progress of the animation.

@NonNull ResourceBuilders.AndroidLottieResourceByResId.Builder
@RequiresSchemaVersion(major = 1, minor = 600)
setProperties(@NonNull ResourceBuilders.LottieProperty[] properties)

Adds customizations for Lottie animation, for example to apply a color to a slot with specified ID.

@NonNull ResourceBuilders.AndroidLottieResourceByResId.Builder
@RequiresSchemaVersion(major = 1, minor = 500)
setStartTrigger(@NonNull TriggerBuilders.Trigger startTrigger)

Sets the trigger to start the animation.

Public constructors

Builder

Added in 1.3.0
@RequiresSchemaVersion(major = 1, minor = 500)
public Builder(@RawRes int resourceId)

Creates an instance of Builder.

Parameters
@RawRes int resourceId

the Android resource ID, e.g. R.raw.foo.

Public methods

build

Added in 1.3.0
public @NonNull ResourceBuilders.AndroidLottieResourceByResId build()

Builds an instance from accumulated values.

setProgress

Added in 1.3.0
@RequiresSchemaVersion(major = 1, minor = 500)
public @NonNull ResourceBuilders.AndroidLottieResourceByResId.Builder setProgress(@NonNull DynamicBuilders.DynamicFloat progress)

Sets a androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat, normally transformed from certain states with the data binding pipeline to control the progress of the animation.

Its value is required to fall in the range of [0.0, 1.0]. Any values outside this range would be clamped.

When the first value of the androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat arrives, the animation starts from progress 0 to that value. After that it plays from current progress to the new value on subsequent updates.

If not set, the animation will play on load.

setProperties

@RequiresSchemaVersion(major = 1, minor = 600)
public @NonNull ResourceBuilders.AndroidLottieResourceByResId.Builder setProperties(@NonNull ResourceBuilders.LottieProperty[] properties)

Adds customizations for Lottie animation, for example to apply a color to a slot with specified ID.

Only up to getMaxPropertiesCount properties are allowed to be added for customization of one Lottie animation.

If more than one LottieProperty with the same filter and different value (for example, with the same slot ID and different color in case of colorForSlot) is added, the last filter will be applied.

Throws
java.lang.IllegalArgumentException

if the number of properties added is larger than getMaxPropertiesCount.

setStartTrigger

Added in 1.3.0
@RequiresSchemaVersion(major = 1, minor = 500)
public @NonNull ResourceBuilders.AndroidLottieResourceByResId.Builder setStartTrigger(@NonNull TriggerBuilders.Trigger startTrigger)

Sets the trigger to start the animation.