Skip to content

Instantly share code, notes, and snippets.

@IMoHaMeDHaMdYI
Created August 25, 2019 15:24
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 IMoHaMeDHaMdYI/7d579a22f0bbd9dc93758dfb266330f8 to your computer and use it in GitHub Desktop.
Save IMoHaMeDHaMdYI/7d579a22f0bbd9dc93758dfb266330f8 to your computer and use it in GitHub Desktop.
Using Path
val path = Path()
val paint = Paint()
paint.apply {
strokeWidth = 20f
style = Paint.Style.STROKE
}
path.apply {
moveTo(xCenter, yCenter)
rLineTo(10f, 100f)
paint.color = Color.RED
canvas.drawPath(this, paint)
reset()
paint.color = Color.BLUE
moveTo(xCenter, yCenter)
lineTo(10f, 100f)
canvas.drawPath(this, paint)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment