Skip to content

Instantly share code, notes, and snippets.

@shkcodes
Last active May 3, 2020 11:22
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 shkcodes/d8b505b8fc8d8005008e4e63936346db to your computer and use it in GitHub Desktop.
Save shkcodes/d8b505b8fc8d8005008e4e63936346db to your computer and use it in GitHub Desktop.
draw_circle
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
canvas.drawCircle(centerX, centerCircleY, radius, circlePaint)
val textCenterY = centerY - ((textPaint.descent() + textPaint.ascent()) / 2)
canvas.drawText(label, centerX, textCenterY, textPaint)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment