Skip to content

Latest commit

 

History

History
38 lines (34 loc) · 1.23 KB

File metadata and controls

38 lines (34 loc) · 1.23 KB

Animate Text Unit

Maven Central

AnimateTextUnit animates text unit values like sp and em. When the provided targetValue is changed, the animation will run automatically. If there is already an animation in-flight when targetValue changes, the on-going animation will adjust course to animate towards the new target value.

Setup

add maven central repo to your root settings.gradle.kts

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}

add the dependency to your module's build.gradle.kts

dependencies {
    implementation("pro.jayeshseth.madifiers:animateTextUnitAsState:<version>")
}

Sample

val fontSize by animateTextUnitAsState (
        targetValue =  ...,
        animationSpec = tween(...),
        label = "...",
        finishedListener = {}
)

Check Out Working Sample here

Video

animatedText.mp4