Skip to content

Instantly share code, notes, and snippets.

@Kpeved
Created February 23, 2023 20:59
Show Gist options
  • Save Kpeved/2b75918d2f2b901c1ae6e66b1ba9e761 to your computer and use it in GitHub Desktop.
Save Kpeved/2b75918d2f2b901c1ae6e66b1ba9e761 to your computer and use it in GitHub Desktop.
Spacer(
...
.drawBehind {
// A rotation section of a clock hand
rotate(animationAngle, pivot = center){
// Drawing a clock hand itself
drawLine(
color = Color.White,
start = center,
end = endOffset,
strokeWidth = strokeWidth,
)
// Drawing a clock hand
if (assembleValue != -1f) {
val positionY = halfStroke +
calculateAssembleDistance(stepHeight, currentHour) *
assembleValue
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