Skip to content

Instantly share code, notes, and snippets.

@AndreVero
Created April 10, 2024 10:11
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 AndreVero/f5164f49f341c84ea0d3e05ffcafd473 to your computer and use it in GitHub Desktop.
Save AndreVero/f5164f49f341c84ea0d3e05ffcafd473 to your computer and use it in GitHub Desktop.
Sun and moon component rotation
val defaultSpringSpec = remember {
FloatSpringSpec(
dampingRatio = Spring.DampingRatioNoBouncy,
stiffness = Spring.StiffnessVeryLow,
)
}
val rotationAnimation = remember {
Animatable(180f)
}
val scope = rememberCoroutineScope()
SunMoonComponent(
rotation = rotationAnimation.value,
modifier = Modifier
.size(height = 150.dp, width = 100.dp)
.offset(y = 165.dp)
.align(Alignment.Center)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment