almosr / android-svg-code-render

Convert SVG files into Java source and use it in your Android app
Apache License 2.0
24 stars 3 forks source link

Fix compatibility issues with Android API v28 #76

Closed almosr closed 5 years ago

almosr commented 5 years ago

Compiling the vector render Java output with Android API 28 throws these errors:

  1. When creating a type face, e.g.: Typeface.create(Typeface.SANS_SERIF, 0) style must be explicitly specified using the constants in Typeface class, e.g.: Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL)

  2. Canvas.save() method does not take any parameters anymore.

Also Canvas.saveLayerAlpha() needs no flags on API v21 and up, or only ALL_SAVE_FLAGS can be specified.