Skip to content

Instantly share code, notes, and snippets.

@zurche
Created July 17, 2023 14:56
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/6696818792f774c6811a0b7f42162ae3 to your computer and use it in GitHub Desktop.
Save zurche/6696818792f774c6811a0b7f42162ae3 to your computer and use it in GitHub Desktop.
Final Touches
@Composable
@Preview
fun FavouriteButton(isFavourite: Boolean = true) {
Box(contentAlignment = Alignment.Center) {
Canvas(modifier = Modifier.size(35.dp), onDraw = {
drawCircle(color = Color.White)
})
if (isFavourite) {
Icon(
imageVector = Icons.Rounded.Favorite,
contentDescription = "Filled Heart Icon"
)
} else {
Icon(
imageVector = Icons.Rounded.FavoriteBorder,
contentDescription = "Empty Heart Icon"
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment