LottieAnimationRequest

class LottieAnimationRequest

Wrapper class of the LottieAnimationView class methods to offer basic functionality.

See also

Types

Link copied to clipboard
object Companion
Link copied to clipboard
annotation class RepeatMode

Functions

Link copied to clipboard
fun setAnimation(@RawRes rawRes: Int)

Sets the animation from a file in the raw directory. This will load and deserialize the file asynchronously.

fun setAnimation(assetName: String)

Sets the animation from the name of a file in the raw directory. This will load and deserialize the file asynchronously.

fun setAnimation(stream: InputStream?, cacheKey: String?)

Sets the animation from an arbitrary InputStream. This will load and deserialize the file asynchronously.

Link copied to clipboard
fun setAnimationFromJson(jsonString: String, cacheKey: String?)

Sets the animation from json string. This is the ideal API to use when loading an animation over the network because you can use the raw response body here and a conversion to a JSONObject never has to be done.

Link copied to clipboard
fun setAnimationFromUrl(url: String?)
fun setAnimationFromUrl(url: String?, cacheKey: String?)

Load a lottie animation from a url. The url can be a json file or a zip file. Use a zip file if you have images. Simply zip them together and lottie will unzip and link the images automatically.

Link copied to clipboard
fun setFallbackResource(@DrawableRes fallbackResource: Int)

Set a drawable that will be rendered if the LottieComposition fails to load for any reason. Unless you are using {@link #setAnimationFromUrl(String)}, this is an unexpected error and you should handle it with {@link #setFailureListener(LottieListener)}.

Link copied to clipboard
fun setMaxFrame(endFrame: Int)

Sets the maximum frame that the animation will end at when playing or looping.

fun setMaxFrame(markerName: String?)

Sets the maximum frame to the start time + duration of the specified marker.

Link copied to clipboard
fun setMaxProgress(@FloatRange(from = 0.0, to = 1.0) endProgress: Float)

Sets the maximum progress that the animation will end at when playing or looping.

Link copied to clipboard
fun setMinAndMaxFrame(markerName: String?)

Sets the minimum and maximum frame to the start time and start time + duration of the specified marker.

fun setMinAndMaxFrame(minFrame: Int, maxFrame: Int)
Link copied to clipboard
fun setMinFrame(startFrame: Int)

Sets the minimum frame that the animation will start from when playing or looping.

fun setMinFrame(markerName: String?)

Sets the minimum frame to the start time of the specified marker.

Link copied to clipboard
fun setMinProgress(startProgress: Float)

Sets the minimum progress that the animation will start from when playing or looping.

Link copied to clipboard
fun setRepeatCount(count: Int)

Sets how many times the animation should be repeated. If the repeat count is 0, the animation is never repeated. If the repeat count is greater than 0 or INFINITE, the repeat mode will be taken into account. The repeat count is 0 by default.

Link copied to clipboard
fun setRepeatMode(mode: Int)

Defines what this animation should do when it reaches the end. This setting is applied only when the repeat count is either greater than 0 or INFINITE. Defaults to RESTART.

Link copied to clipboard
fun setSpeed(speed: Float)