Questions tagged [androidsvg]

AndroidSVG is a free library for parsing and rendering SVG files on Android.

38 questions
248
votes
10 answers

What is the easiest way to use SVG images in Android?

I have found a myriad of libraries in order to use SVG images in Android and avoid the frustrating creation of different resolutions and dropping files for each resolution. This becomes very annoying when the app has many icons or images. What would…
CommonSenseCode
  • 23,522
  • 33
  • 131
  • 186
69
votes
6 answers

How to use SVG image in ImageView

Good Day, I have a SVG image. How can I add it to ImageView background? I tried to use this library. But I have problem: 01-25 12:19:02.669 27719-27719/com.dvor.androidapp E/AndroidRuntime: FATAL EXCEPTION: main android.view.InflateException:…
VLeonovs
  • 2,193
  • 5
  • 24
  • 44
55
votes
11 answers

Why is my SVG failing to load in Vector Asset Studio

The SVG below is failing to open in Android Studio's Vector Asset Studio in resulting in the error: "Empty preview image! EXCEPTION in parsing TareSymbol.svg: For input string: "8.7337904mm"Exception while parsing XML file: Premature end of file."…
Luke Allison
  • 3,118
  • 3
  • 24
  • 40
28
votes
1 answer

android:set gray scale filter to imageView

i use this library to show svg image on imageView , i want to show locked and unlocked mode with this imageView, when state is locked show imageView in grayscale color filter. something like this code on css : -webkit-filter:…
mahdi
  • 16,257
  • 15
  • 52
  • 73
2
votes
3 answers

Android reduce size of icon inside image view

I have the following tabs in a List View , these are using an icon SVG inside an image view : My problem is the SVG icon is very big and I need to resize it WITHOUT resizing the image view and its shape , I would like it something like this : This…
2
votes
0 answers

Android: Draw rectangle over SVGImageView with zoom-in/out

In essence, I'm trying to layer multiple ImageViews (one of which is a floor plan, the other a rectangle) on top of each other while still allowing for pinch-zooming. The effect I'm going for is very similar to this post: http:/…
1
vote
0 answers

Create world map from svg in android

I want to create a custom world map using SVG. I have country JSON from https://github.com/Fil/visionscarto-world-atlas . How can I do this with SVG in android?
1
vote
1 answer

SVG issue with Glide using Shorthand Hexadecimal Colors

I’d like to render SVG assets which use the short hex format as fill color and just discovered the following issue with Glide (4.9.0): #3094 (comment) Can I set Glide to accept the short hex colors or is there a workaround to avoid changing every…
Steffen
  • 2,197
  • 2
  • 24
  • 38
1
vote
1 answer

Loading .svg file from web or local cache in Android

I'm using Glide to load .png image asynchronously. File file = Glide.with(context).load(location).downloadOnly(1024, 1024).get(); In case of .svg, the file is created but it is not loading into ImageView.
Papan
  • 382
  • 1
  • 10
1
vote
1 answer

setCloseButtonIcon(Bitmap drawable) is not working with SVGs in ChromeCustomTab

I need to change the default cross-icon in ChromeCustomTab Android, I am changing it with back-icon using the code below: Bitmap icon = BitmapFactory.decodeResource(context.getResources(),R.drawable.ic_arrow_back_white_24dp); It is working fine…
1
vote
0 answers

Apply SVG clipPath to geometry

The library I'm using to render SVG on Android doesn't support clipPath. The workaround is to "apply the clip path to your objects so their shapes are physically clipped". What is the algorithm for converting an SVG containing clipPath elements to…
plátano plomo
  • 1,672
  • 1
  • 18
  • 26
1
vote
1 answer

Exception parsing Vector Asset in Android Studio

I am getting issue while I try to generate Vector Asset from a SVG file contains in my local folder as per the new Android Studio version 1.4 support feature for Vector Drawables. I have attached the screenshot of the error I am getting as…
1
vote
1 answer

How to convert a Drawable to a scaled Bitmap

In my ImageView's onDraw I am struggling to convert a Drawable object to a Bitmap (respecting scaling). I'm loading an SVG file as a PictureDrawable. Then I'm trying to apply rounded corners to the image with a BitmapShader. In order to do that I…
Taig
  • 6,718
  • 4
  • 44
  • 65
1
vote
1 answer

Decoding SVG with AndroidSVG and Universal Image Loader

I am trying to display svgs with uil. I wrote my own imagedecoder using androidsvg (http://code.google.com/p/androidsvg/) like this: public class SVGImageDecoder implements ImageDecoder { @Override public Bitmap decode(ImageDecodingInfo…
Robin
  • 709
  • 2
  • 8
  • 20
0
votes
1 answer

glide with androidsvg sample not loading URL

I am trying to add the ability to set an ImageView to an SVG using Glide and AndroidSVG (https://bigbadaboom.github.io/androidsvg/). I am using the sample from Glide: https://github.com/bumptech/glide/tree/v4.10.0/samples/svg I am using Glide…
se22as
  • 2,282
  • 5
  • 32
  • 54
1
2 3