Releases: almosr/android-svg-code-render
More compatibility
After two years of silence this release is about improving the compatibility of the rendered code.
- Recent version of androidsvg (v1.3) was integrated.
- New option for minimum supported Android API version was introduced to produce more streamlined output.
- Fixed compatibility issues with Android 9 (Pie).
- Added warning about hardware accelerated rendering based on the specified Android API version.
Better text handling and fixes
This release is long over due, majority of the changes were done some time ago already.
Apart from some fixes the most important improvement is better text handling:
- texts can be aligned inside the bounding box using "text-align" SVG property; and
- a font set can be provided for rendering as a parameter to the render method.
Minor fixes and improvements
Some minor fixes and improvements since the last release.
Missing methods and cleanup
This release contains the long overdue missing methods for various simulated Android drawing classes. Thanks to Bartosz Wesołowski for pointing to the shortcomings.
Some code clean-up and minor bug fixes are also included, improves the overall usefulness of the tool.
Embedded and external bitmaps will also be handled, although this feature is not tested too deeply.
No more over-inflated allocations
This release resolves one of the most annoying problems: over-inflated allocations while rendering.
The original library allocates lots of Android class instances (for example Matrix
and Paint
objects) while rendering vectors to the bitmap. This could not be (easily) avoided in that library, due to the dynamic nature of the SVG file interpretation.
In the previous versions of this tool similarly to the original library each Android class instance was re-allocated every time when the rendering method was called, causing over-inflated memory allocations which eventually triggered garbage collection. This is a typical problem with Java graphics: indeterministic garbage collection can stop the code execution for rather long period of time. If you are rendering an animation then you don't want to let garbage collection kick in, unless it cannot be avoided.
The fix to this issue in this release is: pre-allocating all Android class instances and store them in fields in the vector render class, then reuse them every time when the rendering is called. This will increase the memory consumption a bit because the instances are never released, but won't trigger any garbage collection anymore and won't waste memory on re-allocation.
Dynamic text and color rendering in v1.1.0
Apart from some minor bug fixing and optimizations an important new feature was introduced in this release:
the possibility of replacing text and color items by dynamic variables.
Please refer to the Readme.md file for the new parameters for specifying text and color in the SVG input file which will be substituted by a variable, so the values of these items can be changed at runtime.
First stable public release: v1.0.0
First stable public release of the tool.
Changes since the pre-release (v0.9.0):
Improved:
- Implemented splitting up large rendering code into smaller daisy-chain called methods to workaround the 64k bytecode limit in Java. Some rendering-related methods were also fixed.
- Canvas.save/restore pairs are optimized away when canvas was not changed in-between the two calls.
- Original size of the SVG file is added to the output as WIDTH and HEIGHT constants inside the rendering class. Pre-scaling of the SVG file is removed, scaling is done using the original width and height inside the templates.
Fixed:
- Added saving/restoring of Canvas instance into the built-in template.
- Workaround for duplicated Paint instance argument for daisy-chained methods.