Created
January 25, 2020 19:31
-
-
Save zsoltk/197f34c15c82eae648d40f682b0b3574 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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