@Implements(value=android.content.res.Resources.class) public class ShadowResources extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ShadowResources.ShadowLegacyTheme |
static class |
ShadowResources.ShadowNotFoundException |
static class |
ShadowResources.ShadowTheme |
| Constructor and Description |
|---|
ShadowResources() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getQuantityString(int resId,
int quantity) |
protected java.lang.String |
getQuantityString(int id,
int quantity,
java.lang.Object... formatArgs) |
protected static android.content.res.Resources |
getSystem() |
protected android.graphics.drawable.Drawable |
loadDrawable(android.util.TypedValue value,
int id) |
protected android.graphics.drawable.Drawable |
loadDrawable(android.util.TypedValue value,
int id,
android.content.res.Resources.Theme theme) |
protected android.content.res.XmlResourceParser |
loadXmlResourceParser(int resId,
java.lang.String type) |
protected android.content.res.XmlResourceParser |
loadXmlResourceParser(java.lang.String file,
int id,
int assetCookie,
java.lang.String type) |
protected android.content.res.TypedArray |
obtainAttributes(android.util.AttributeSet set,
int[] attrs) |
protected android.content.res.TypedArray |
obtainTypedArray(int id) |
protected java.io.InputStream |
openRawResource(int id) |
protected android.content.res.AssetFileDescriptor |
openRawResourceFd(int id)
Since
AssetFileDescriptors are not yet supported by Robolectric, null will be returned if the resource is found. |
static void |
reset() |
@Resetter public static void reset()
@Implementation protected static android.content.res.Resources getSystem()
@Implementation protected android.content.res.TypedArray obtainAttributes(android.util.AttributeSet set, int[] attrs)
@Implementation protected java.lang.String getQuantityString(int id, int quantity, java.lang.Object... formatArgs) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@Implementation protected java.lang.String getQuantityString(int resId, int quantity) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@Implementation protected java.io.InputStream openRawResource(int id) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@Implementation protected android.content.res.AssetFileDescriptor openRawResourceFd(int id) throws android.content.res.Resources.NotFoundException
Since AssetFileDescriptors are not yet supported by Robolectric, null will be returned if the resource is found. If the resource cannot be found, Resources.NotFoundException will be thrown.
android.content.res.Resources.NotFoundException@Implementation protected android.content.res.TypedArray obtainTypedArray(int id) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@HiddenApi @Implementation protected android.content.res.XmlResourceParser loadXmlResourceParser(int resId, java.lang.String type) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@HiddenApi @Implementation protected android.content.res.XmlResourceParser loadXmlResourceParser(java.lang.String file, int id, int assetCookie, java.lang.String type) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@HiddenApi @Implementation(maxSdk=20) protected android.graphics.drawable.Drawable loadDrawable(android.util.TypedValue value, int id)
@Implementation(minSdk=21, maxSdk=25) protected android.graphics.drawable.Drawable loadDrawable(android.util.TypedValue value, int id, android.content.res.Resources.Theme theme) throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException