setAnimation

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.

This is particularly useful for animations loaded from the network. You can fetch the bodymovin json from the network and pass it directly here.