any way to load a non-vector drawable xml into an ...
# compose
a
any way to load a non-vector drawable xml into an ImageAsset?
trying to load but imageResource returns me null exception
v
Copy code
Image(
    asset = vectorResource(R.drawable.ripple),
    colorFilter = ColorFilter.tint(MaterialTheme.colors.primary)
)
a
same version as you, I get:
Copy code
Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2<VectorGraphic> tag requires viewportWidth > 0
and that should fail anyway, since this is not a vector; so it’s strange that it works for you 🤔 this is a runtime error btw
v
You are right.
t
Maybe better use a Modifier.ripple(..)?
🤔 1
a
I see. Although my main motivation is to have a custom circular shape drawable to act as a camera button
t
I know is not really a solution for all things. But many of the drawble shapes are available as modifieres
a
I see, interesting. Let me have a look at these
t
For me one of the best things of Compose is to get rid of XML config files 😄
a
Agree. Then they’re probably working to get rid of these XMLs that’s why the api for it doesn’t exist