Skip to content

Instantly share code, notes, and snippets.

@zsoltk
Created July 28, 2021 07:48
Show Gist options
  • Save zsoltk/d87c21ec6c648d040b72f8880300916a to your computer and use it in GitHub Desktop.
Save zsoltk/d87c21ec6c648d040b72f8880300916a to your computer and use it in GitHub Desktop.
val offset = remember { Animatable(currentOffset ?: targetOffset, Offset.VectorConverter) }
LaunchedEffect(targetOffset) {
offset.animateTo(targetOffset, tween(100, easing = LinearEasing))
}
Piece(
piece = piece,
modifier = offset.value.toModifier()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment