public abstract class Sharp
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Sharp.DrawableCallback |
static interface |
Sharp.PictureCallback |
static class |
Sharp.SvgHandler |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkAssumedUnits(java.lang.String unit) |
protected abstract void |
close(java.io.InputStream inputStream) |
SharpDrawable |
getDrawable()
Processes the SVG and provides the resulting drawable.
|
SharpDrawable |
getDrawable(android.view.View view)
Deprecated.
Use
getDrawable() instead. |
void |
getDrawable(android.view.View view,
Sharp.DrawableCallback callback)
Processes the SVG and provides the resulting drawable.
|
protected abstract java.io.InputStream |
getInputStream() |
SharpPicture |
getSharpPicture() |
void |
getSharpPicture(Sharp.PictureCallback callback) |
void |
into(android.view.View view) |
static Sharp |
loadAsset(android.content.res.AssetManager assetMngr,
java.lang.String svgPath)
Parse SVG data from an Android application asset.
|
static Sharp |
loadFile(java.io.File imageFile)
Parse SVG data from a file.
|
static Sharp |
loadInputStream(java.io.InputStream svgData)
Parse SVG data from an input stream.
|
static android.graphics.Path |
loadPath(java.lang.String pathString)
Parses a single SVG path and returns it as a
android.graphics.Path object. |
static Sharp |
loadResource(android.content.res.Resources resources,
int resId)
Parse SVG data from an Android application resource.
|
static Sharp |
loadString(java.lang.String svgData)
Parse SVG data from a text.
|
static void |
prepareTexts(java.util.HashMap<java.lang.String,java.lang.String> texts) |
Sharp |
setOnElementListener(OnSvgElementListener onElementListener) |
Sharp |
withAssets(android.content.res.AssetManager assetManager) |
public static void prepareTexts(java.util.HashMap<java.lang.String,java.lang.String> texts)
public static Sharp loadInputStream(java.io.InputStream svgData)
svgData - the input stream, with SVG XML data in UTF-8 character encoding.public static Sharp loadString(java.lang.String svgData)
svgData - the text containing SVG XML data.public static Sharp loadResource(android.content.res.Resources resources, int resId)
resources - the Android context resources.resId - the ID of the raw resource SVG.public static Sharp loadAsset(android.content.res.AssetManager assetMngr, java.lang.String svgPath)
assetMngr - the Android asset manager.svgPath - the path to the SVG file in the application's assets.public static Sharp loadFile(java.io.File imageFile)
imageFile - the input stream, with SVG XML data in UTF-8 character encoding.public static android.graphics.Path loadPath(java.lang.String pathString)
android.graphics.Path object.
An example path is M250,150L150,350L350,350Z, which draws a triangle.pathString - the SVG path, see the specification here.public Sharp setOnElementListener(OnSvgElementListener onElementListener)
protected abstract java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOExceptionprotected abstract void close(java.io.InputStream inputStream)
throws java.io.IOException
java.io.IOExceptionpublic Sharp withAssets(android.content.res.AssetManager assetManager)
public void into(android.view.View view)
public SharpDrawable getDrawable()
@Deprecated public SharpDrawable getDrawable(android.view.View view)
getDrawable() instead.public void getDrawable(android.view.View view,
Sharp.DrawableCallback callback)
public SharpPicture getSharpPicture() throws SvgParseException
SvgParseExceptionpublic void getSharpPicture(Sharp.PictureCallback callback)
public static void checkAssumedUnits(java.lang.String unit)