Created
February 27, 2024 14:14
-
-
Save AndreVero/6f58d8e2815172c65f3a6cd4420ad421 to your computer and use it in GitHub Desktop.
Click listener for circles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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