QiXi / word-writer

Typewriter animation text in Compose UI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WordWriter Release

Typewriter animation text in Compose UI

Usage

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)
)

Setup

  1. 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' }
    }
} 
  1. Add the dependency
dependencies {
    // WordWriter
    implementation 'com.github.QiXi:word-writer:0.1.0'
}

About

Typewriter animation text in Compose UI

License:MIT License


Languages

Language:Kotlin 100.0%