Having a look at Androids VectorDrawable

 

With Android Lollipop some nifty features were added. Among those VectorDrawable‘s and AnimatedVectorDrawable‘s. Let’s have a look at them.

VectorDrawables lets you declare and use vector images on Android and even run nice animations on them. As usual you would declare vector resources in XML. The notation is the same as for Scalable Vector Graphics (SVG). Although as of now, only a subset of SVG is supported.

For demonstration purposes we’ll declare a star shaped vector image, add some rotation, scaling and path morphing animations. We’ll be morphing into a pentagon shape. The shapes are not that hard to construct. You might just need a vector graphics tool that is able to export to SVG. If the shapes are not too complex that is, since not all of SVGs features are supported. I created the star and the pentagon using Inkscape with some manual tweaking. If you are creating by hand using RaphaelJS on jsfiddle is pretty convenient. The shapes I created look like this:

Read more