Support loading vector drawables in ImageView#45354
Closed
Abbondanzo wants to merge 1 commit intofacebook:mainfrom
Closed
Support loading vector drawables in ImageView#45354Abbondanzo wants to merge 1 commit intofacebook:mainfrom
Abbondanzo wants to merge 1 commit intofacebook:mainfrom
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D59530172 |
Base commit: 3603a22 |
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D59530172 |
429c657 to
2d01b5c
Compare
This was
linked to
issues
Jul 10, 2024
Contributor
Author
|
Requires #45394 |
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D59530172 |
2d01b5c to
a5e0b8b
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D59530172 |
a5e0b8b to
c9b3a62
Compare
Summary: Pull Request resolved: facebook#45354 Fresco has indicated that they have no plans to support loading vector assets and similar drawable types in Drawee-backed views ([issue](facebook/fresco#329), [issue](facebook/fresco#1463), [issue](facebook/fresco#2463)). 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](facebook#16651), [issue](facebook#27502)). 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 provided to `Image` Reviewed By: javache Differential Revision: D59530172
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D59530172 |
c9b3a62 to
3aac1c5
Compare
Contributor
|
This pull request has been merged in aad9240. |
|
This pull request was successfully merged by Peter Abbondanzo in aad9240 When will my fix make it into a release? | How to file a pick request? |
Abbondanzo
added a commit
to Abbondanzo/react-native
that referenced
this pull request
Dec 19, 2024
Summary: Vector drawable support was added behind a feature flag in facebook#45354 and is ready to release more widely. This change is effectively the same as removing the feature flag but allows our holdout to continue until mid-January. Changelog: [Internal] Differential Revision: D67482531
facebook-github-bot
pushed a commit
that referenced
this pull request
Dec 30, 2024
Summary: Pull Request resolved: #48347 Vector drawable support was added behind a feature flag in #45354 and is ready to release more widely. This change is effectively the same as removing the feature flag but allows our holdout to continue until mid-January. Changelog: [Internal] Reviewed By: rshest Differential Revision: D67482531 fbshipit-source-id: 1733c4748f79fd4df72f531a24efcbd8a7822611
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
getDrawableIfUnsupportedfunction.Changelog
[Android] [Added] - Added support for rendering XML assets provide to
ImageDifferential Revision: D59530172