AnimatedSVG Composable
Setup
First, add jitpack in your build.gradle at the end of repositories:
repositories {
// ...
maven { url "https://jitpack.io" }
}
Then, add the library dependency:
implementation 'com.github.badoualy:animatedsvg-composable:1.0.0'
Now go do some awesome stuff!
This library is also available as a View
: https://github.com/badoualy/kanji-strokeview/
Usage
(See MainActivity sample)
val state = remember { AnimationState(isRunningInitially = true) }
AnimatedSvg(
strokes = strokes,
box = RectF(0f, 0f, 109f, 109f),
modifier = Modifier
.fillMaxSize()
.clickable(onClick = { state.restart() }),
animationState = state
)