diff --git a/README.md b/README.md index 870c00b4..172e3925 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,10 @@ ![badge-macOS](https://img.shields.io/badge/Platform-macOS-purple) ![badge-web](https://img.shields.io/badge/Platform-Web-blue) -Compose Multiplatform lottie animations. Library have similar APIs to [airbnb/lottie-compose](https://github.com/airbnb/lottie/blob/master/android-compose.md) -including play/stop, delayed finish, repeat mode, iterations +Compose Multiplatform lottie animations. + +Small wrapper over [airbnb/lottie-compose](https://github.com/airbnb/lottie/blob/master/android-compose.md) and skottie with features like +play/stop, delayed finish, repeat/reverse, iterations. # Installation [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.alexzhirkevich/compottie/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.alexzhirkevich/compottie) @@ -22,6 +24,8 @@ dependencies { # Usage +Basic usage: + ```kotlin val lottieData : String = // ... your lottie JSON @@ -33,3 +37,19 @@ LottieAnimation( modifier = Modifier.size(300.dp) ) ``` + +With manual progress control: +```kotlin +val composition = rememberLottieComposition(lottieData) + +val progress = animateLottieCompositionAsState(composition) + +LottieAnimation( + composition = composition, + progress = { progress.value }, + modifier = Modifier.size(300.dp) +) +``` + + +