Skip to content

Instantly share code, notes, and snippets.

@EmmanuelGuther
Created June 15, 2022 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EmmanuelGuther/0d7d4b153bb68df6a814d4fe338f9c78 to your computer and use it in GitHub Desktop.
Save EmmanuelGuther/0d7d4b153bb68df6a814d4fe338f9c78 to your computer and use it in GitHub Desktop.
@Composable
fun AnimatedText(text: String, modifier: Modifier, tween: Int = 1000, color: Color, textStyle: TextStyle) {
val textScale by rememberInfiniteTransition().animateFloat(
initialValue = 0.9f, targetValue = 1f, animationSpec = infiniteRepeatable(
animation = tween(tween), repeatMode = RepeatMode.Reverse
)
)
Text(
modifier = modifier.scale(textScale), text = text, color = color, style = textStyle
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment