Package 

Interface LottieCompositionSpec


  • 
    public interface LottieCompositionSpec
    
                        

    Specification for a com.airbnb.lottie.LottieComposition. Each subclass represents a different source. A com.airbnb.lottie.LottieComposition is the stateless parsed version of a Lottie json file and is passed into rememberLottieComposition or LottieAnimation.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public final class LottieCompositionSpec.RawRes

      Load an animation from res/raw.

      public final class LottieCompositionSpec.Url

      Load an animation from the internet. Lottie has a default network stack that will use standard Android networking APIs to attempt to load your animation. You may want to integrate your own networking stack instead for consistency, to add your own headers, or implement retries. To do that, call com.airbnb.lottie.Lottie.initialize and set a com.airbnb.lottie.network.LottieNetworkFetcher on the com.airbnb.lottie.LottieConfig.

      If you are using this spec, you may want to use rememberLottieComposition instead of passing this spec directly into LottieAnimation because it can fail and you want to make sure that you properly handle the failures and/or retries.

      public final class LottieCompositionSpec.File

      Load an animation from an arbitrary file. Make sure that your app has permissions to read it or else this may fail.

      public final class LottieCompositionSpec.Asset

      Load an animation from the assets directory of your app. This isn't type safe like RawRes so make sure that the path to your animation is correct this will fail.

      public final class LottieCompositionSpec.JsonString

      Load an animation from its json string.

      public final class LottieCompositionSpec.ContentProvider

      Load an animation from a content provider URI.