public class SimpleAssetResolver extends SVGExternalFileResolver
SVGExternalFileResolver that retrieves files from
an application's "assets" folder.| Constructor and Description |
|---|
SimpleAssetResolver(AssetManager assetManager) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isFormatSupported(String mimeType)
Returns true when passed the MIME types for SVG, JPEG, PNG or any of the
other bitmap image formats supported by Android's BitmapFactory class.
|
String |
resolveCSSStyleSheet(String url)
Attempt to find the specified stylesheet file in the "assets" folder and return its string contents.
|
Typeface |
resolveFont(String fontFamily,
int fontWeight,
String fontStyle)
Attempt to find the specified font in the "assets" folder and return a Typeface object.
|
Bitmap |
resolveImage(String filename)
Attempt to find the specified image file in the
assets folder and return a decoded Bitmap. |
public SimpleAssetResolver(AssetManager assetManager)
public Typeface resolveFont(String fontFamily, int fontWeight, String fontStyle)
resolveFont in class SVGExternalFileResolverfontFamily - Font family as specified in a font-family style attribute.fontWeight - Font weight as specified in a font-weight style attribute.fontStyle - Font style as specified in a font-style style attribute.public Bitmap resolveImage(String filename)
assets folder and return a decoded Bitmap.resolveImage in class SVGExternalFileResolverfilename - the filename as provided in the xlink:href attribute of a <image> element.public boolean isFormatSupported(String mimeType)
isFormatSupported in class SVGExternalFileResolvermimeType - A MIME type (such as "image/jpeg").resolveImage() implementation supports this file format.public String resolveCSSStyleSheet(String url)
resolveCSSStyleSheet in class SVGExternalFileResolverurl - the URL of the CSS file as it appears in the SVG file.