Skip to content

Latest commit

 

History

History

animateTextUnitAsState

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

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