Created
December 23, 2014 07:43
-
-
Save muratcanbur/ab29e420c0cceb4da043 to your computer and use it in GitHub Desktop.
Drawable from .svg resource.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void setDrawableFromSVG(ImageView imageView, int resource) { | |
SVG svg = new SVGBuilder() | |
.readFromResource(mContext.getResources(), resource) | |
.build(); | |
imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); | |
imageView.setImageDrawable(new PictureDrawable(svg.getPicture())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment