Skip to content

Instantly share code, notes, and snippets.

@Mohammed-Alhams
Created December 9, 2024 11:09
Show Gist options
  • Save Mohammed-Alhams/ff2022eef4b1faa85c04652107cb3a41 to your computer and use it in GitHub Desktop.
Save Mohammed-Alhams/ff2022eef4b1faa85c04652107cb3a41 to your computer and use it in GitHub Desktop.
@Composable
fun Arrow() {
Canvas(
modifier = Modifier
.size(400.dp)
.padding(16.dp)
) {
val canvasWidth = size.width //full width of drawing area
val canvasHeight = size.height //full height of drawing area
val path = Path()
path.moveTo(0f, 0f)
path.lineTo(canvasWidth / 2f, canvasHeight)
path.lineTo(canvasWidth, 0f)
path.lineTo(0f, 0f)
path.close()
drawPath(path = path, color = Color.Red)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment