@Implements(value=android.content.res.Resources.class)
public class ShadowResources
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ShadowResources.ShadowNotFoundException |
static class |
ShadowResources.ShadowTheme |
| Constructor and Description |
|---|
ShadowResources() |
| Modifier and Type | Method and Description |
|---|---|
android.util.DisplayMetrics |
getDisplayMetrics() |
java.lang.String |
getQuantityString(int resId,
int quantity) |
java.lang.String |
getQuantityString(int id,
int quantity,
java.lang.Object... formatArgs) |
static android.content.res.Resources |
getSystem() |
android.graphics.drawable.Drawable |
loadDrawable(android.util.TypedValue value,
int id) |
android.graphics.drawable.Drawable |
loadDrawable(android.util.TypedValue value,
int id,
android.content.res.Resources.Theme theme) |
android.content.res.XmlResourceParser |
loadXmlResourceParser(int resId,
java.lang.String type) |
android.content.res.XmlResourceParser |
loadXmlResourceParser(java.lang.String file,
int id,
int assetCookie,
java.lang.String type) |
android.content.res.TypedArray |
obtainAttributes(android.util.AttributeSet set,
int[] attrs) |
android.content.res.TypedArray |
obtainTypedArray(int id) |
java.io.InputStream |
openRawResource(int id) |
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() |
void |
setDensity(float density) |
void |
setDisplay(android.view.Display display) |
void |
setScaledDensity(float scaledDensity) |
@Resetter public static void reset()
@Implementation public static android.content.res.Resources getSystem()
@Implementation
public android.content.res.TypedArray obtainAttributes(android.util.AttributeSet set,
int[] attrs)
@Implementation
public java.lang.String getQuantityString(int id,
int quantity,
java.lang.Object... formatArgs)
throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@Implementation
public java.lang.String getQuantityString(int resId,
int quantity)
throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@Implementation
public java.io.InputStream openRawResource(int id)
throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@Implementation
public 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
public android.content.res.TypedArray obtainTypedArray(int id)
throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundExceptionpublic void setDensity(float density)
public void setScaledDensity(float scaledDensity)
public void setDisplay(android.view.Display display)
@Implementation public android.util.DisplayMetrics getDisplayMetrics()
@HiddenApi
@Implementation
public android.content.res.XmlResourceParser loadXmlResourceParser(int resId,
java.lang.String type)
throws android.content.res.Resources.NotFoundException
android.content.res.Resources.NotFoundException@HiddenApi
@Implementation
public 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
public android.graphics.drawable.Drawable loadDrawable(android.util.TypedValue value,
int id)
@Implementation
public 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