Skip to content

Instantly share code, notes, and snippets.

@zsoltk
Created January 25, 2020 19:32
Show Gist options
  • Save zsoltk/a435b6bc0b45a6717b658cbcb3da358d to your computer and use it in GitHub Desktop.
Save zsoltk/a435b6bc0b45a6717b658cbcb3da358d to your computer and use it in GitHub Desktop.
@Composable
fun Pokeball() {
Container(width = 200.dp, height = 200.dp) {
val children: @Composable() () -> Unit = {
Opacity(opacity = 0.75f) {
DrawImage(
image = +imageResource(R.drawable.pokeball),
tint = +colorResource(R.color.poke_red)
)
}
}
Draw(children = children) { canvas, parent ->
canvas.save()
canvas.rotate(45f)
drawChildren()
canvas.restore()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment