Skip to content

smartface/smartface-androidsvg

 
 

Repository files navigation

AndroidSVG

Differences with the original repo

  • Add scale option for rendering. The dpi value of the device can be passed as a parameter while rendering.

Example:

SVG svg = SVG.getFromInputStream(source);
svg.setDocumentWidth((int)(svg.getDocumentWidth() * AndroidUnitConverterUtil.density));
svg.setDocumentHeight((int) (svg.getDocumentHeight() * AndroidUnitConverterUtil.density));
var renderOptions = new RenderOptions();
renderOptions.scale(AndroidUnitConverterUtil.density);
Picture picture = svg.renderToPicture(renderOptions);
PictureDrawable drawable = new PictureDrawable(picture);

AndroidSVG is a SVG parser and renderer for Android. It has almost complete support for the static visual elements of the SVG 1.1 and SVG 1.2 Tiny specifications (except for filters).

AndroidSVG is licensed under the Apache License v2.0.

More information, including downloads and documentation, is available at the main AndroidSVG site.

Find a bug?

Please file a bug report and include as much detail as you can. If possible, please include a sample SVG file showing the error.

If you wish to contact the author with feedback on this project, you can email me at [email protected].

Using AndroidSVG in your app?

If you have found AndroidSVG useful and are using it in your project, please let me know. I'd love to hear about it!

Releases

No releases published

Packages

No packages published

Languages

  • HTML 57.2%
  • Java 34.4%
  • CSS 4.5%
  • JavaScript 3.9%