How do you handle image resources in compose? I have a xml vector that has 4 different colors I need to change at runtime.
Using the old xml stuff I'd create a context theme wrapper that wraps a theme and then fetch the drawable. Is there any good solution for compose?
The only "workaround" I've found is to do that inside compositon local provider:
We have an experimental API for AnimatedImageVector which is the equivalent to AnimatedVectorDrawable but in compose. Internally it supports an optional lookup mapping to override the default property for any named path or group. We're still iterating in this space and have not exposed it externally yet so the solution you have currently is probably the easiest way to support this case for now.
1 year ago
Looking forward towards this, it's good the hear that it's being evaluated.