Jeremy
02/15/2021, 4:44 PMvectorResource
was deprecated with recommendation to use painterResource
which creates Painter. How to convert Painter
to ImageVector
?Alex Bieliaiev
02/15/2021, 4:52 PMPainter
to ImageVector
conversion?Jeremy
02/15/2021, 4:53 PMAlex Bieliaiev
02/15/2021, 4:54 PMpainterResource
you're supposed to use Image(painter = painterResource(R.drawable.drawable_id))
Shabinder Singh
02/24/2021, 8:50 PMjaqxues
02/24/2021, 9:02 PMIcons.Default.SomeIcon
still is a Vector Image. I had a list of screens where each screen had an Icon (either a drawable resource, or a built-in compose icon). This no longer works since painterResource returns a Painter, the other one still is a vector Image. So icon would have to be either a Painter or a VectorImage.
A way to convert between those two would indeed be nice, so I dont have
if icon is painter Icon(painterResource = icon) else Icon(imageVector = icon)
Not the way I am doing it, but you get the gist.