Load local drawable or svg using Coil3 #2767
Unanswered
DawnNguyenAhiho
asked this question in
Q&A
Replies: 1 comment 4 replies
-
I'm currently write this Mapper, not sure does it prevent resource shrinking optimization (which lead to the PR above). Hope some one can correct me
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I'm trying to load local svg drawable using coil in my Jetpack Compose android native porject.
For context, my app has some default image and allow user to upload their own image and I will save the uploaded image to dataDir. I have to save the uri to the image to SQLite database so that I can show it to user. So that, instead of using DrawRes (
R.drawable.
), I use the URI (android.resource://my.package.name/drawable/mydrawable
) to load and show image, then use that uri to save to DB.But after this PR, I'm unable to load SVG drawable using URI anymore. After reading docs, I saw that I can use coil-svg to load svg using coil. The problem is whatever path I pass to AsyncImage, it won't load the svg for me, only the
R.drawable
orR.raw.mysvg
work. Are there anyway to load SVG using path, so that I won't have to change much at my current logicBeta Was this translation helpful? Give feedback.
All reactions