Skip to content

Instantly share code, notes, and snippets.

@AndreVero
Created February 27, 2024 14:14
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/6f58d8e2815172c65f3a6cd4420ad421 to your computer and use it in GitHub Desktop.
Save AndreVero/6f58d8e2815172c65f3a6cd4420ad421 to your computer and use it in GitHub Desktop.
Click listener for circles
Canvas(modifier = modifier.pointerInput(true) {
detectTapGestures { clickOffset ->
glovoUiItems.forEach { item ->
val rect = Rect(item.key, innerCircleRadius.toPx())
if (rect.contains(clickOffset)) {
onGoalClick(item.value)
}
}
}}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment