ResourceBuilders.AndroidLottieResourceByResId.Builder


class ResourceBuilders.AndroidLottieResourceByResId.Builder


Builder for AndroidLottieResourceByResId

Summary

Public constructors

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

Creates an instance of Builder.

Public functions

ResourceBuilders.AndroidLottieResourceByResId

Builds an instance from accumulated values.

ResourceBuilders.AndroidLottieResourceByResId.Builder
@RequiresSchemaVersion(major = 1, minor = 500)
setProgress(progress: DynamicBuilders.DynamicFloat)

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.

ResourceBuilders.AndroidLottieResourceByResId.Builder
@RequiresSchemaVersion(major = 1, minor = 600)
setProperties(properties: Array<ResourceBuilders.LottieProperty!>)

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

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

Sets the trigger to start the animation.

Public constructors

Builder

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

Creates an instance of Builder.

Parameters
@RawRes resourceId: Int

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

Public functions

build

Added in 1.3.0
fun build(): ResourceBuilders.AndroidLottieResourceByResId

Builds an instance from accumulated values.

setProgress

Added in 1.3.0
@RequiresSchemaVersion(major = 1, minor = 500)
fun setProgress(progress: DynamicBuilders.DynamicFloat): 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.

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)
fun setProperties(properties: Array<ResourceBuilders.LottieProperty!>): ResourceBuilders.AndroidLottieResourceByResId.Builder

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)
fun setStartTrigger(startTrigger: TriggerBuilders.Trigger): ResourceBuilders.AndroidLottieResourceByResId.Builder

Sets the trigger to start the animation.