Skip to content

Instantly share code, notes, and snippets.

@Ahmed-Sellami
Created Aug 24, 2021
Embed
What would you like to do?
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