Skip to content

Instantly share code, notes, and snippets.

@Kpeved
Created February 23, 2023 20:55
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 Kpeved/b5a1566edd00191e4fff0e95e20b1268 to your computer and use it in GitHub Desktop.
Save Kpeved/b5a1566edd00191e4fff0e95e20b1268 to your computer and use it in GitHub Desktop.
// Start calculation each time the animationAngle changes.
val assembleValue = remember(animationAngle) {
// We only need this animation for second rotation
if (animationAngle >= 360) {
// Reversed linear interpolation between 0..30 degrees, transformed into 0..1
(animationAngle % 30) / 30
} else -1f
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment