Skip to content

Instantly share code, notes, and snippets.

@Ahmed-Sellami
Created August 24, 2021 14:02
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 Ahmed-Sellami/9089488c2df4ae5b20dcbd8ba477272c to your computer and use it in GitHub Desktop.
Save Ahmed-Sellami/9089488c2df4ae5b20dcbd8ba477272c to your computer and use it in GitHub Desktop.
val animatedTopTranslation = remember { Animatable(0f) }
LaunchedEffect(isFired) {
if (isFired) {
animatedTopTranslation.animateTo(
targetValue = radius + topPadding + itemHeight / 2,
animationSpec = spring(
stiffness = Spring.StiffnessLow
)
) {
topTranslation = value
}
animatedTopTranslation.snapTo(0f)
topTranslation = 0f
onCompleteAnim()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment