Typewriter animation text in Compose UI
val textTypewriter = remember {
mutableStateOf("use Typewriter")
}
Text(
modifier = Modifier.fillMaxSize(),
text = Typewriter(
writer = TypewriterData(),
text = textTypewriter
) {
textTypewriter.value = "finish!"
},
style = TextStyle(color = Color.Transparent)
)
or
val textTypewriter = remember {
mutableStateOf("use Wordwriter")
}
Text(
modifier = Modifier.fillMaxSize(),
text = Typewriter(
writer = WordwriterData(),
text = textWordwriter
),
style = TextStyle(color = Color.Transparent)
)
- Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency
dependencies {
// WordWriter
implementation 'com.github.QiXi:word-writer:0.1.0'
}