Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ILottieView

interface ILottieView
Extends IView ILottieView interface defines methods for configuring lottie animations.

Methods

setSource()

void setSource(LottieSourceType sourceType, string source)
Sets the source of the lottie animation to be played. Starts playing lottie animation after setting source if autoPlay is true.

Parameters

sourceType
LottieSourceType — Required LottieSourceType The type of the source to be played.
source
string — Required The string source of the lottie animation, which can be a JSON string or a JSON file path.

Throws


setAssetsDir()

void setAssetsDir(string assetDirectory)
Sets the directory path where the lottie animation assets are stored.

Parameters

assetDirectory
string — Required The string directory path where the lottie animation assets are stored.

getProgress()

float getProgress()
Returns the current progress of the lottie animation, which is in the range 0.0 to 1.0.

Returns

float float value representing the progress of the lottie animation.

setProgress()

void setProgress(float progress)
Sets the playback progress of the lottie animation, which determines the current frame to be displayed. The value of progress should be in the range {0.0, 1.0}. If not explicitly set, the default value is set to 0.0.

Parameters

progress
float — Required A float value representing the progress of the lottie animation, where 0.0 is the start and 1.0 is the end.

Throws

  • OutOfBoundsError — if the provided progress value is outside the valid range {0.0, 1.0}.

setDuration()

void setDuration(com.amazon.apmf.MonotonicDuration duration)
Sets the duration of the lottie animation. When called, the speed set earlier is updated according to duration set here.

Parameters

duration
com.amazon.apmf.MonotonicDuration — Required {MonotonicDuration} value representing duration of the lottie animation.

setSpeed()

void setSpeed(float speed)
Sets the playback speed of the lottie animation relative to the normal speed. When called, the duration set earlier is updated according to speed set here. Recommended to keep the precision upto 6 decimal places. For negative values of speed, the lottie animation plays in reverse (endFrame to startFrame). If not explicitly set, the default value is 1.0.

Parameters

speed
float — Required A float value representing the playback speed of the lottie animation relative to normal speed.

setLoop()

void setLoop(bool isLoop)
Sets whether the lottie animation should loop. If not explicitly set, the default value is set to true.

Parameters

isLoop
bool — Required A boolean value indicating whether the lottie animation should loop.

setResizeMode()

void setResizeMode(LottieResizeMode resizeMode)
Sets the resize mode of the lottie animation. If not explicitly set, the default ResizeMode is set to CONTAIN. This method allows you to specify how the lottie animation should be resized within the View. If called while lottie animation is playing, it updates the resize mode immediately.

Parameters

resizeMode
LottieResizeMode — Required LottieResizeMode representing the resize mode to be applied to the animation.

setAutoPlay()

void setAutoPlay(bool isAutoPlay)
Sets whether the lottie animation should autoplay. If not explicitly set, the default value is set to false.

Parameters

isAutoPlay
bool — Required A boolean value indicating whether the lottie animation should autoplay.

setLottieAnimationListener()

com.amazon.apmf.ISubscription* setLottieAnimationListener(ILottieAnimationListener* animationListener)
Registers a listener to receive notifications when events such as animation begin and end occur.

Parameters

animationListener
ILottieAnimationListener* — Required Pointer to an instance of the ILottieAnimationListener to be added as a Lottie animation listener.

Returns

com.amazon.apmf.ISubscription* An ID specific to the registered listener, which can be used to identify or manage the listener.

setStartFrame()

void setStartFrame(u32 frame)
Sets the start frame of the lottie animation. startFrame ranges from 0 to the last frame of lottie animation. If not explicitly set, the start frame will be first frame by default. If value provided is greater than last frame of animation, startFrame is set to last frame of animation.

Parameters

frame
u32 — Required Integer value representing the starting frame of the lottie animation.

Throws


setEndFrame()

void setEndFrame(u32 frame)
Sets the end frame of the lottie animation. endFrame ranges from 0 to last frame of lottie animation. If not explicitly set, the end frame would be the last frame by default. If value provided is greater than last frame of animation, endFrame is set to last frame of animation.

Parameters

frame
u32 — Required Integer value representing the ending frame of the lottie animation.

Throws


play()

void play()
Starts playing the lottie animation. Calling this api will not have any effect if the lottie animation is already playing.

pause()

void pause()
Pauses the lottie animation at its current frame.

resume()

void resume()
Resumes the lottie animation from its current paused state.

reset()

void reset()
Resets the lottie animation to its initial state. To play again after calling this api, play() needs to be explicitly called even if autoPlay was set.
Last modified on October 29, 2026