public class CarbonResources
extends android.content.res.Resources
Constructor and Description |
---|
CarbonResources(android.content.res.AssetManager assets,
android.util.DisplayMetrics metrics,
android.content.res.Configuration config)
Create a new Resources object on top of an existing set of assets in an
AssetManager.
|
Modifier and Type | Method and Description |
---|---|
void |
applyTheme(android.graphics.drawable.Drawable d,
android.content.res.Resources.Theme t)
Applies the specified theme to this Drawable and its children.
|
boolean |
canApplyTheme(android.graphics.drawable.Drawable d) |
android.graphics.drawable.Drawable |
createFromPath(java.lang.String pathName)
Create a drawable from file path name.
|
android.graphics.drawable.Drawable |
createFromResourceStream(android.util.TypedValue value,
java.io.InputStream is,
java.lang.String srcName)
Create a drawable from an inputstream, using the given resources and
value to determine density information.
|
android.graphics.drawable.Drawable |
createFromResourceStream(android.util.TypedValue value,
java.io.InputStream is,
java.lang.String srcName,
android.graphics.BitmapFactory.Options opts)
Create a drawable from an inputstream, using the given resources and
value to determine density information.
|
android.graphics.drawable.Drawable |
createFromStream(java.io.InputStream is,
java.lang.String srcName)
Create a drawable from an inputstream
|
android.graphics.drawable.Drawable |
createFromXml(org.xmlpull.v1.XmlPullParser parser)
Create a drawable from an XML document.
|
android.graphics.drawable.Drawable |
createFromXml(org.xmlpull.v1.XmlPullParser parser,
android.content.res.Resources.Theme theme)
Create a drawable from an XML document using an optional
Resources.Theme . |
android.graphics.drawable.Drawable |
createFromXmlInner(org.xmlpull.v1.XmlPullParser parser,
android.util.AttributeSet attrs,
android.content.res.Resources.Theme theme)
Create a drawable from inside an XML document using an optional
Resources.Theme . |
android.graphics.drawable.Drawable |
getDrawable(int resId) |
android.graphics.drawable.Drawable |
getDrawable(int resId,
android.content.res.Resources.Theme theme) |
android.graphics.drawable.Drawable |
getDrawable(android.content.res.TypedArray array,
int index) |
android.graphics.drawable.Drawable |
getDrawable(android.content.res.TypedArray array,
int index,
android.content.res.Resources.Theme theme) |
android.graphics.drawable.Drawable |
getvDrawableForDensity(int resId,
int density) |
android.graphics.drawable.Drawable |
getvDrawableForDensity(int resId,
int density,
android.content.res.Resources.Theme theme) |
android.graphics.drawable.Drawable |
loadDrawable(android.util.TypedValue value,
android.content.res.Resources.Theme theme) |
void |
registerDrawable(java.lang.Class<? extends android.graphics.drawable.Drawable> clazz,
java.lang.String name) |
void |
unregisterDrawable(java.lang.String name) |
finishPreloading, flushLayoutCache, getAnimation, getAssets, getBoolean, getColor, getColor, getColorStateList, getColorStateList, getConfiguration, getDimension, getDimensionPixelOffset, getDimensionPixelSize, getDisplayMetrics, getDrawableForDensity, getDrawableForDensity, getFraction, getIdentifier, getIntArray, getInteger, getLayout, getMovie, getQuantityString, getQuantityString, getQuantityText, getResourceEntryName, getResourceName, getResourcePackageName, getResourceTypeName, getString, getString, getStringArray, getSystem, getText, getText, getTextArray, getValue, getValue, getValueForDensity, getXml, newTheme, obtainAttributes, obtainTypedArray, openRawResource, openRawResource, openRawResourceFd, parseBundleExtra, parseBundleExtras, updateConfiguration
public CarbonResources(android.content.res.AssetManager assets, android.util.DisplayMetrics metrics, android.content.res.Configuration config)
assets
- Previously created AssetManager.metrics
- Current display metrics to consider when selecting/computing resource values.config
- Desired device configuration to consider whenpublic void registerDrawable(java.lang.Class<? extends android.graphics.drawable.Drawable> clazz, java.lang.String name)
public void unregisterDrawable(java.lang.String name)
public void applyTheme(android.graphics.drawable.Drawable d, android.content.res.Resources.Theme t)
public boolean canApplyTheme(android.graphics.drawable.Drawable d)
public android.graphics.drawable.Drawable createFromStream(java.io.InputStream is, java.lang.String srcName)
public android.graphics.drawable.Drawable createFromResourceStream(android.util.TypedValue value, java.io.InputStream is, java.lang.String srcName)
public android.graphics.drawable.Drawable createFromResourceStream(android.util.TypedValue value, java.io.InputStream is, java.lang.String srcName, android.graphics.BitmapFactory.Options opts)
public android.graphics.drawable.Drawable createFromXml(org.xmlpull.v1.XmlPullParser parser) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
org.xmlpull.v1.XmlPullParserException
java.io.IOException
public android.graphics.drawable.Drawable createFromXml(org.xmlpull.v1.XmlPullParser parser, android.content.res.Resources.Theme theme) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
Resources.Theme
.
For more information on how to create resources in XML, see
Drawable Resources.org.xmlpull.v1.XmlPullParserException
java.io.IOException
public android.graphics.drawable.Drawable createFromXmlInner(org.xmlpull.v1.XmlPullParser parser, android.util.AttributeSet attrs, android.content.res.Resources.Theme theme) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException
Resources.Theme
. Called on a parser positioned at a tag in an XML
document, tries to create a Drawable from that tag. Returns null
if the tag is not a valid drawable.org.xmlpull.v1.XmlPullParserException
java.io.IOException
public android.graphics.drawable.Drawable getDrawable(int resId, android.content.res.Resources.Theme theme)
getDrawable
in class android.content.res.Resources
public android.graphics.drawable.Drawable getDrawable(int resId)
getDrawable
in class android.content.res.Resources
public android.graphics.drawable.Drawable getDrawable(android.content.res.TypedArray array, int index, android.content.res.Resources.Theme theme)
public android.graphics.drawable.Drawable getDrawable(android.content.res.TypedArray array, int index)
public android.graphics.drawable.Drawable loadDrawable(android.util.TypedValue value, android.content.res.Resources.Theme theme) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException
public android.graphics.drawable.Drawable createFromPath(java.lang.String pathName)
@Nullable public android.graphics.drawable.Drawable getvDrawableForDensity(int resId, int density, android.content.res.Resources.Theme theme)
@Nullable public android.graphics.drawable.Drawable getvDrawableForDensity(int resId, int density) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException