react-native
react-native copied to clipboard
Support loading vector drawables in ImageView
Summary: Fresco has indicated that they have no plans to support loading vector assets and similar drawable types in Drawee-backed views (issue, issue, issue). Guidance has been to instead load the vector drawable onto the backing image view ourselves. On the React Native side, having the ability to load vector drawables has been requested many times (issue, issue).
I went this route over using a custom Fresco decoder for XML assets because vector drawables are compiled down into binary XML and I couldn't find a trivial, performant way to parse those files in a context-aware manner. This change only accounts for vector drawables, not any of the other XML-based drawable types (layer lists, level lists, state lists, 9-patch, etc.). Support could be added easily in the future by expanding the getDrawableIfUnsupported function.
Changelog
[Android] [Added] - Added support for rendering XML assets provide to Image
Differential Revision: D59530172
This pull request was exported from Phabricator. Differential Revision: D59530172
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 21,368,199 | +946 |
| android | hermes | armeabi-v7a | n/a | -- |
| android | hermes | x86 | n/a | -- |
| android | hermes | x86_64 | n/a | -- |
| android | jsc | arm64-v8a | 24,565,003 | +833 |
| android | jsc | armeabi-v7a | n/a | -- |
| android | jsc | x86 | n/a | -- |
| android | jsc | x86_64 | n/a | -- |
Base commit: 3603a226520cf38a693615a0a87fdb6b21b32d55 Branch: main
This pull request was exported from Phabricator. Differential Revision: D59530172
Requires #45394
This pull request was exported from Phabricator. Differential Revision: D59530172
This pull request was exported from Phabricator. Differential Revision: D59530172
This pull request was exported from Phabricator. Differential Revision: D59530172
This pull request has been merged in facebook/react-native@aad9240fd435d549812b5075767c5ea39a8fbb4f.
This pull request was successfully merged by Peter Abbondanzo in aad9240fd435d549812b5075767c5ea39a8fbb4f
When will my fix make it into a release? | How to file a pick request?