Package 

Class RememberLottieCompositionKt

    • Method Detail

      • rememberLottieComposition

        @Composable()@JvmOverloads() final static LottieCompositionResult rememberLottieComposition(LottieCompositionSpec spec, String imageAssetsFolder, String fontAssetsFolder, String fontFileExtension, String cacheKey, SuspendFunction2<Integer, Throwable, Boolean> onRetry)

        Takes a LottieCompositionSpec, attempts to load and parse the animation, and returns a LottieCompositionResult.

        LottieCompositionResult allows you to explicitly check for loading, failures, call LottieCompositionResult.await, or invoke it like a function to get the nullable composition.

        LottieCompositionResult implements State<LottieComposition?> so if you don't need the full result class, you can use this function like:

        val compositionResult: LottieCompositionResult = lottieComposition(spec)
        // or...
        val composition: State<LottieComposition?> by lottieComposition(spec)

        The loaded composition will automatically load and set images that are embedded in the json as a base64 string or will load them from assets if an imageAssetsFolder is supplied.

        Parameters:
        spec - The LottieCompositionSpec that defines which LottieComposition should be loaded.
        imageAssetsFolder - A subfolder in src/main/assets that contains the exported images that this composition uses.
        fontAssetsFolder - The default folder Lottie will look in to find font files.
        fontFileExtension - The default file extension for font files specified in the fontAssetsFolder or fontRemapping.
        cacheKey - Set a cache key for this composition.
        onRetry - An optional callback that will be called if loading the animation fails.
      • rememberLottieComposition

        @Composable()@JvmOverloads() final static LottieCompositionResult rememberLottieComposition(LottieCompositionSpec spec, String imageAssetsFolder, String fontAssetsFolder, String fontFileExtension, String cacheKey)

        Takes a LottieCompositionSpec, attempts to load and parse the animation, and returns a LottieCompositionResult.

        LottieCompositionResult allows you to explicitly check for loading, failures, call LottieCompositionResult.await, or invoke it like a function to get the nullable composition.

        LottieCompositionResult implements State<LottieComposition?> so if you don't need the full result class, you can use this function like:

        val compositionResult: LottieCompositionResult = lottieComposition(spec)
        // or...
        val composition: State<LottieComposition?> by lottieComposition(spec)

        The loaded composition will automatically load and set images that are embedded in the json as a base64 string or will load them from assets if an imageAssetsFolder is supplied.

        Parameters:
        spec - The LottieCompositionSpec that defines which LottieComposition should be loaded.
        imageAssetsFolder - A subfolder in src/main/assets that contains the exported images that this composition uses.
        fontAssetsFolder - The default folder Lottie will look in to find font files.
        fontFileExtension - The default file extension for font files specified in the fontAssetsFolder or fontRemapping.
        cacheKey - Set a cache key for this composition.
      • rememberLottieComposition

        @Composable()@JvmOverloads() final static LottieCompositionResult rememberLottieComposition(LottieCompositionSpec spec, String imageAssetsFolder, String fontAssetsFolder, String fontFileExtension)

        Takes a LottieCompositionSpec, attempts to load and parse the animation, and returns a LottieCompositionResult.

        LottieCompositionResult allows you to explicitly check for loading, failures, call LottieCompositionResult.await, or invoke it like a function to get the nullable composition.

        LottieCompositionResult implements State<LottieComposition?> so if you don't need the full result class, you can use this function like:

        val compositionResult: LottieCompositionResult = lottieComposition(spec)
        // or...
        val composition: State<LottieComposition?> by lottieComposition(spec)

        The loaded composition will automatically load and set images that are embedded in the json as a base64 string or will load them from assets if an imageAssetsFolder is supplied.

        Parameters:
        spec - The LottieCompositionSpec that defines which LottieComposition should be loaded.
        imageAssetsFolder - A subfolder in src/main/assets that contains the exported images that this composition uses.
        fontAssetsFolder - The default folder Lottie will look in to find font files.
        fontFileExtension - The default file extension for font files specified in the fontAssetsFolder or fontRemapping.
      • rememberLottieComposition

        @Composable()@JvmOverloads() final static LottieCompositionResult rememberLottieComposition(LottieCompositionSpec spec, String imageAssetsFolder, String fontAssetsFolder)

        Takes a LottieCompositionSpec, attempts to load and parse the animation, and returns a LottieCompositionResult.

        LottieCompositionResult allows you to explicitly check for loading, failures, call LottieCompositionResult.await, or invoke it like a function to get the nullable composition.

        LottieCompositionResult implements State<LottieComposition?> so if you don't need the full result class, you can use this function like:

        val compositionResult: LottieCompositionResult = lottieComposition(spec)
        // or...
        val composition: State<LottieComposition?> by lottieComposition(spec)

        The loaded composition will automatically load and set images that are embedded in the json as a base64 string or will load them from assets if an imageAssetsFolder is supplied.

        Parameters:
        spec - The LottieCompositionSpec that defines which LottieComposition should be loaded.
        imageAssetsFolder - A subfolder in src/main/assets that contains the exported images that this composition uses.
        fontAssetsFolder - The default folder Lottie will look in to find font files.
      • rememberLottieComposition

        @Composable()@JvmOverloads() final static LottieCompositionResult rememberLottieComposition(LottieCompositionSpec spec, String imageAssetsFolder)

        Takes a LottieCompositionSpec, attempts to load and parse the animation, and returns a LottieCompositionResult.

        LottieCompositionResult allows you to explicitly check for loading, failures, call LottieCompositionResult.await, or invoke it like a function to get the nullable composition.

        LottieCompositionResult implements State<LottieComposition?> so if you don't need the full result class, you can use this function like:

        val compositionResult: LottieCompositionResult = lottieComposition(spec)
        // or...
        val composition: State<LottieComposition?> by lottieComposition(spec)

        The loaded composition will automatically load and set images that are embedded in the json as a base64 string or will load them from assets if an imageAssetsFolder is supplied.

        Parameters:
        spec - The LottieCompositionSpec that defines which LottieComposition should be loaded.
        imageAssetsFolder - A subfolder in src/main/assets that contains the exported images that this composition uses.