Is there a way to get a Drawable from a ImageVecto...
# compose
s
Is there a way to get a Drawable from a ImageVector? I want to use something like
androidx.compose.material.icons.Icons.Default.ArrowForward
as a placeholder for my Coil AsyncImage, but it only takes in a
@DrawableRes
or a
Drawable
. Looking for if I am missing some way to do ImageVector -> Drawable before I opt to use the SubComposeAsyncImage instead.
👀 1
a
Why not use the placeholder parameter of AsyncImage? It takes a
Painter
so you can use
rememberVectorPainter(imageVector)
.
s
Narrator: Turns out, he was in fact missing something obvious. Yep that should actually do the trick. Thanks a lot! I was fixated looking at the options I get in my
ImageRequest.Builder
and used the wrong AsyncImage import, so I didn’t see this version 🤦‍♂️.
213 Views