Package org.robolectric.shadows
Class ShadowResources
- java.lang.Object
-
- org.robolectric.shadows.ShadowResources
-
@Implements(android.content.res.Resources.class) public class ShadowResources extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShadowResources.ShadowLegacyThemestatic classShadowResources.ShadowNotFoundExceptionstatic classShadowResources.ShadowTheme
-
Constructor Summary
Constructors Constructor Description ShadowResources()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetQuantityString(int resId, int quantity)protected java.lang.StringgetQuantityString(int id, int quantity, java.lang.Object... formatArgs)protected static android.content.res.ResourcesgetSystem()protected android.graphics.drawable.DrawableloadDrawable(android.util.TypedValue value, int id)protected android.graphics.drawable.DrawableloadDrawable(android.util.TypedValue value, int id, android.content.res.Resources.Theme theme)protected android.content.res.XmlResourceParserloadXmlResourceParser(int resId, java.lang.String type)protected android.content.res.XmlResourceParserloadXmlResourceParser(java.lang.String file, int id, int assetCookie, java.lang.String type)protected android.content.res.TypedArrayobtainAttributes(android.util.AttributeSet set, int[] attrs)protected android.content.res.TypedArrayobtainTypedArray(int id)protected java.io.InputStreamopenRawResource(int id)protected android.content.res.AssetFileDescriptoropenRawResourceFd(int id)SinceAssetFileDescriptors are not yet supported by Robolectric,nullwill be returned if the resource is found.static voidreset()
-
-
-
Method Detail
-
reset
@Resetter public static void reset()
-
getSystem
@Implementation protected static android.content.res.Resources getSystem()
-
obtainAttributes
@Implementation protected android.content.res.TypedArray obtainAttributes(android.util.AttributeSet set, int[] attrs)
-
getQuantityString
@Implementation protected java.lang.String getQuantityString(int id, int quantity, java.lang.Object... formatArgs) throws android.content.res.Resources.NotFoundException- Throws:
android.content.res.Resources.NotFoundException
-
getQuantityString
@Implementation protected java.lang.String getQuantityString(int resId, int quantity) throws android.content.res.Resources.NotFoundException- Throws:
android.content.res.Resources.NotFoundException
-
openRawResource
@Implementation protected java.io.InputStream openRawResource(int id) throws android.content.res.Resources.NotFoundException- Throws:
android.content.res.Resources.NotFoundException
-
openRawResourceFd
@Implementation protected android.content.res.AssetFileDescriptor openRawResourceFd(int id) throws android.content.res.Resources.NotFoundExceptionSinceAssetFileDescriptors are not yet supported by Robolectric,nullwill be returned if the resource is found. If the resource cannot be found,Resources.NotFoundExceptionwill be thrown.- Throws:
android.content.res.Resources.NotFoundException
-
obtainTypedArray
@Implementation protected android.content.res.TypedArray obtainTypedArray(int id) throws android.content.res.Resources.NotFoundException- Throws:
android.content.res.Resources.NotFoundException
-
loadXmlResourceParser
@HiddenApi @Implementation protected android.content.res.XmlResourceParser loadXmlResourceParser(int resId, java.lang.String type) throws android.content.res.Resources.NotFoundException- Throws:
android.content.res.Resources.NotFoundException
-
loadXmlResourceParser
@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- Throws:
android.content.res.Resources.NotFoundException
-
loadDrawable
@HiddenApi @Implementation(maxSdk=20) protected android.graphics.drawable.Drawable loadDrawable(android.util.TypedValue value, int id)
-
loadDrawable
@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- Throws:
android.content.res.Resources.NotFoundException
-
-