Skip to content

Instantly share code, notes, and snippets.

@zsoltk
Created January 25, 2020 19:31
Show Gist options
  • Save zsoltk/197f34c15c82eae648d40f682b0b3574 to your computer and use it in GitHub Desktop.
Save zsoltk/197f34c15c82eae648d40f682b0b3574 to your computer and use it in GitHub Desktop.
@Preview
@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.translate(-100f, 0f)
drawChildren()
canvas.restore()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment