feat(cli): Generate icons for Android when building APK #4063
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.
When building an APK, if an icon is specified in the configuration, it will generate
*dpi
variants to override the default Android icon. For simple SVG files, it additionally generates Android VectorDrawable XML foranydpi
. Refs #3685The icon file is specified in the following configuration:
However, there are two issues:
First, I'm not sure why the icon is defined as
Vec<String>
. I couldn't find any usage of this field in the project as a reference, so I default to using the first element as the icon.Second, Android appears to apply some scaling to the foreground of Android VectorDrawable XML, causing the actual icon to be enlarged and cropped. This requires adding some margin when creating the SVG. Additionally, currently the same icon file is used for both foreground and background, and only SVGs composed of simple paths are supported.