-
- 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 LottieCompositionawait()Suspend until the composition has finished parsing. abstract LottieCompositiongetValue()The composition or null if it hasn't yet loaded or failed to load. abstract ThrowablegetError()The exception that was thrown while trying to load and parse the composition. abstract BooleangetIsLoading()Whether or not the composition is still being loaded and parsed. abstract BooleangetIsComplete()Whether or not the composition is in the process of being loaded or parsed. abstract BooleangetIsFailure()Whether or not the composition failed to load. abstract BooleangetIsSuccess()Whether or not the composition has succeeded yet. -
-
Method Detail
-
await
abstract LottieComposition await()
Suspend until the composition has finished parsing.
This can throw if the LottieComposition fails to load.
These animations should never fail given a valid input:
These animations may fail:
-
getValue
abstract LottieComposition getValue()
The composition or null if it hasn't yet loaded or failed to load.
-
getError
abstract Throwable getError()
The exception that was thrown while trying to load and parse the composition.
-
getIsLoading
abstract Boolean getIsLoading()
Whether or not the composition is still being loaded and parsed.
-
getIsComplete
abstract Boolean getIsComplete()
Whether or not the composition is in the process of being loaded or parsed.
-
getIsFailure
abstract Boolean getIsFailure()
Whether or not the composition failed to load. This is terminal. It only occurs after returning false from rememberLottieComposition's onRetry lambda.
-
getIsSuccess
abstract Boolean getIsSuccess()
Whether or not the composition has succeeded yet.
-
-
-
-