Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ismai117 authored Jun 3, 2024
1 parent eb6e472 commit 7d6d4f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,15 @@ Enter https://github.com/airbnb/lottie-spm.git
Load the animation composition using rememberKottieComposition function. Choose the appropriate specification for loading the composition (File, Url, or JsonString).

```Kotlin

var animation by remember { mutableStateOf("") }

LaunchedEffect(Unit){
animation = Res.readBytes("files/animation.json").decodeToString()
}

val composition = rememberKottieComposition(
spec = KottieCompositionSpec.File("files/Animation.json") // Or KottieCompositionSpec.Url || KottieCompositionSpec.JsonString
spec = KottieCompositionSpec.File(animation) // Or KottieCompositionSpec.Url || KottieCompositionSpec.JsonString
)
```

Expand Down

0 comments on commit 7d6d4f8

Please sign in to comment.