Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize AVD to fix long vector paths Lint warning #785

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

SimonMarquis
Copy link
Contributor

... with SVGOM, but you'll have to check on Android Studio the AVD diff.

https://googlesamples.github.io/android-custom-lint-rules/checks/VectorPath.md.html

@SimonMarquis
Copy link
Contributor Author

🔔 @alexvanyo (sorry for the ping, you were the last to update these files)

@lihenggui
Copy link
Contributor

Hi @SimonMarquis Could you please share how to reduce the 'long path' in the source file? I often struggle with reducing the length of SVG paths as it's not very intuitive.

@SimonMarquis
Copy link
Contributor Author

SimonMarquis commented Nov 7, 2023

@lihenggui good question! I don't exactly remembered what I did back in June 🙈, but I think for these kind of AVD files, when you don't have access to the source SVG paths, I "simply" recreated an SVG file with the same paths and run them through SVGOMG and compress them until there was noticable changes at the expected zoom level and finally backported the compressed paths to the AVD files. Does that makes sense?

@lihenggui
Copy link
Contributor

@lihenggui good question! I don't exactly remembered what I did back in June 🙈, but I think for these kind of AVD files, when you don't have access to the source SVG paths, I "simply" recreated an SVG file with the same paths and run them through SVGOMG and compress them until there was noticable changes at the expected zoom level and finally backported the compressed paths to the AVD files. Does that makes sense?

Thank you! I will attempt to eliminate warnings in my projects.

@dturner
Copy link
Collaborator

dturner commented Dec 22, 2023

Before:

image

After:

image

@dturner dturner merged commit 691bf2a into android:main Dec 22, 2023
4 checks passed
@SimonMarquis SimonMarquis deleted the optimize-avd branch April 16, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants