Package 

Interface LottieCompositionResult

  • All Implemented Interfaces:
    androidx.compose.runtime.State

    @Stable() 
    public interface LottieCompositionResult
     implements State<LottieComposition>
                        

    A LottieCompositionResult subclass is returned from rememberLottieComposition. It can be completed with a result or exception only one time.

    This class implements State<LottieComposition> so you either use it like:

    val compositionResult = rememberLottieComposition(...)
    // Or
    val composition by rememberLottieComposition(...)

    Use the former if you need to explicitly differentiate between loading and error states or if you need to call await or awaitOrNull in a coroutine such as androidx.compose.runtime.LaunchedEffect.

    • Method Summary

      Modifier and Type Method Description
      abstract LottieComposition await() Suspend until the composition has finished parsing.
      abstract LottieComposition getValue() The composition or null if it hasn't yet loaded or failed to load.
      abstract Throwable getError() The exception that was thrown while trying to load and parse the composition.
      abstract Boolean getIsLoading() Whether or not the composition is still being loaded and parsed.
      abstract Boolean getIsComplete() Whether or not the composition is in the process of being loaded or parsed.
      abstract Boolean getIsFailure() Whether or not the composition failed to load.
      abstract Boolean getIsSuccess() Whether or not the composition has succeeded yet.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait