Convert multiple .svg files to vector drawables for Android.
This forks servers as minimal enchantment of the original repository. The Google algorithm leaves the default width and height of the served .svg. This could lead to compilation problems where the compiler throws an OutOfMemory exception. Also, for some reason it adds 'pt' to some measures, which also leads to compilation problems. That is why I created a Python script (cleaner.py) that would optimize the files to the minimum required width (200dp) and height and remove the unnecessary 'pt'.
Install and configure Kotlin in your favorite IDE if you have not.
- Clone the repository.
- Open in on your favorite IDE.
- Configure the program arguments (Eg: Edit configurations -> Program arguments in IntelliJ). The arguments are separated by spaces.
- Run
You can also change the code in Runner.main to a custom instance of SvgFilesProcessor
-
Install Python3 on your system if you have not.
-
After running the SvgFilesProcessor, copy the cleaner.py to the directory with the processed files (source/ProcessedSVG by default).
-
Execute the following command while in the directory:
$ python3 cleaner.py
- The Kotlin project needs to be executed two times because in the first one throws a IllegalArgumentException caused by a null value that in fact is not null in any moment.
- Fix issues.
- Migrate Python3 code to Kotlin.
- Create .jar .
- Create UI for the process.