Skip to content

Instantly share code, notes, and snippets.

@zsoltk
Created January 25, 2020 19:27
Show Gist options
  • Save zsoltk/ae2ec28c60dc49ec80a2182d54760771 to your computer and use it in GitHub Desktop.
Save zsoltk/ae2ec28c60dc49ec80a2182d54760771 to your computer and use it in GitHub Desktop.
@Composable
fun DrawSample() {
val paint = +memo { Paint() }
Container(width = 200.dp, height = 200.dp) {
Draw { canvas, parentSize ->
paint.color = Color.Black
canvas.drawRect(parentSize.toRect(), paint)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment