Skip to content

Instantly share code, notes, and snippets.

@Kpeved
Created February 23, 2023 22:19
Show Gist options
  • Select an option

  • Save Kpeved/1e87413e8a3ac02558eb2ec4364ec781 to your computer and use it in GitHub Desktop.

Select an option

Save Kpeved/1e87413e8a3ac02558eb2ec4364ec781 to your computer and use it in GitHub Desktop.
Spacer(
...
.drawBehind {
...
hours.forEach {
if (!dotsVisibility[it]) return@forEach
val degree = it * 30f
rotate(degree) {
// Based on the hour value, the travel distance will be longer.
val positionY = halfStroke +
stepHeight * it * (1 - disassembleAnimations[it].value)
val start = Offset(size.width / 2, positionY - halfStroke)
val end = Offset(size.width / 2, positionY + halfStroke)
drawLine(
color = Color.White,
start = start,
end = end,
strokeWidth = strokeWidth,
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment