Skip to content

Instantly share code, notes, and snippets.

@ferPrieto
Created January 4, 2022 12:03
Show Gist options
  • Save ferPrieto/c375505d08a1da3dbf53c73a8bd9854f to your computer and use it in GitHub Desktop.
Save ferPrieto/c375505d08a1da3dbf53c73a8bd9854f to your computer and use it in GitHub Desktop.
This is an example of a Composable function to define an Icon with a Content description
@Composable
private fun FilterIcon(modifier: Modifier, onClick: () -> Unit) {
Box(modifier) {
IconButton(
onClick = onClick
) {
Image(
painter = painterResource(R.drawable.ic_filter),
contentDescription = "Filter Button"
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment