Skip to content

Instantly share code, notes, and snippets.

@zurche
Created August 19, 2023 19:54
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 zurche/3c80202e61a4177631d297dbf6d058e9 to your computer and use it in GitHub Desktop.
Save zurche/3c80202e61a4177631d297dbf6d058e9 to your computer and use it in GitHub Desktop.
@Composable
private fun AssetIcon(iconDrawable: Int = R.drawable.apple) {
Box(modifier = Modifier.size(50.dp), contentAlignment = Alignment.Center) {
Canvas(modifier = Modifier, onDraw = {
val radius = 65f
drawCircle(
color = Color.White,
radius = radius
)
})
Icon(
painter = painterResource(id = iconDrawable),
contentDescription = "Asset Icon",
tint = Color.Black,
modifier = Modifier
.size(25.dp)
.padding(bottom = 3.dp)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment