setAnimation

fun setAnimation(@RawRes rawRes: Int)

Loads an animation from an Android raw resource.


fun setAnimation(assetName: String)

Loads an animation from the application assets using the supplied asset name.


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

Loads a JSON animation from an input stream.

Parameters

stream

The JSON input stream passed to the Lottie loader.

cacheKey

The composition cache key, or null to load without a cache key.


fun setAnimation(stream: ZipInputStream?, cacheKey: String? = null)

Loads an animation and its assets from a ZIP stream.

Parameters

stream

The ZIP input stream passed to the Lottie loader.

cacheKey

The composition cache key, or null to load without a cache key.