My drawable resources are not displaying in origin...
# compose
r
My drawable resources are not displaying in original color in composable view. Color change to black (maybe due to app theme). How do I retain original view for drawable? Anything related to composition local?
s
If you're using it in an
Icon
, then it might be tinted with
LocalContentColor.current
, perhaps?
2
r
Tried, but not working
Copy code
@Composable
fun VerifiedProfileBadge() {
    Icon(
        modifier = Modifier.size(16.dp),
        bitmap = ImageBitmap.imageResource(id = R.drawable.ic_filled_verified_badge),
        contentDescription = "verified_profile_badge",
        tint = LocalContentColor.current
    )
}
Blue is original one, black is composable preview
s
He wanted to say to disable the tint, replace it with something like
Color. Unspecified
r
sorry my bad. working now. thanks
c
If the goal is to disable the tint, try using
Image
instead of
Icon
. By default,
Image
is untinted, so you shouldn't need to specify anything extra.
👍 2
3
s
Yeah, sorry about the confusing answer, I was a bit in a hurry. Glad to see you made it work. 👍