android.test.mock
Class MockResources

java.lang.Object
  extended by android.content.res.Resources
      extended by android.test.mock.MockResources

public class MockResources
extends android.content.res.Resources


Nested Class Summary
 
Nested classes/interfaces inherited from class android.content.res.Resources
android.content.res.Resources.NotFoundException, android.content.res.Resources.Theme
 
Constructor Summary
MockResources()
           
 
Method Summary
 android.content.res.XmlResourceParser getAnimation(int id)
           
 int getColor(int id)
           
 android.content.res.ColorStateList getColorStateList(int id)
           
 android.content.res.Configuration getConfiguration()
           
 float getDimension(int id)
           
 int getDimensionPixelOffset(int id)
           
 int getDimensionPixelSize(int id)
           
 android.util.DisplayMetrics getDisplayMetrics()
           
 android.graphics.drawable.Drawable getDrawable(int id)
           
 int getIdentifier(String name, String defType, String defPackage)
           
 int[] getIntArray(int id)
           
 int getInteger(int id)
           
 android.content.res.XmlResourceParser getLayout(int id)
           
 android.graphics.Movie getMovie(int id)
           
 String getQuantityString(int id, int quantity)
           
 String getQuantityString(int id, int quantity, Object... formatArgs)
           
 CharSequence getQuantityText(int id, int quantity)
           
 String getResourceEntryName(int resid)
           
 String getResourceName(int resid)
           
 String getResourcePackageName(int resid)
           
 String getResourceTypeName(int resid)
           
 String getString(int id)
           
 String getString(int id, Object... formatArgs)
           
 String[] getStringArray(int id)
           
 CharSequence getText(int id)
           
 CharSequence getText(int id, CharSequence def)
           
 CharSequence[] getTextArray(int id)
           
 void getValue(int id, android.util.TypedValue outValue, boolean resolveRefs)
           
 void getValue(String name, android.util.TypedValue outValue, boolean resolveRefs)
           
 android.content.res.XmlResourceParser getXml(int id)
           
 android.content.res.TypedArray obtainAttributes(android.util.AttributeSet set, int[] attrs)
           
 android.content.res.TypedArray obtainTypedArray(int id)
           
 InputStream openRawResource(int id)
           
 android.content.res.AssetFileDescriptor openRawResourceFd(int id)
           
 void updateConfiguration(android.content.res.Configuration config, android.util.DisplayMetrics metrics)
           
 
Methods inherited from class android.content.res.Resources
finishPreloading, flushLayoutCache, getAssets, getBoolean, getFraction, getSystem, newTheme, openRawResource, parseBundleExtra, parseBundleExtras
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockResources

public MockResources()
Method Detail

updateConfiguration

public void updateConfiguration(android.content.res.Configuration config,
                                android.util.DisplayMetrics metrics)
Overrides:
updateConfiguration in class android.content.res.Resources

getText

public CharSequence getText(int id)
                     throws android.content.res.Resources.NotFoundException
Overrides:
getText in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getQuantityText

public CharSequence getQuantityText(int id,
                                    int quantity)
                             throws android.content.res.Resources.NotFoundException
Overrides:
getQuantityText in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getString

public String getString(int id)
                 throws android.content.res.Resources.NotFoundException
Overrides:
getString in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getString

public String getString(int id,
                        Object... formatArgs)
                 throws android.content.res.Resources.NotFoundException
Overrides:
getString in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getQuantityString

public String getQuantityString(int id,
                                int quantity,
                                Object... formatArgs)
                         throws android.content.res.Resources.NotFoundException
Overrides:
getQuantityString in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getQuantityString

public String getQuantityString(int id,
                                int quantity)
                         throws android.content.res.Resources.NotFoundException
Overrides:
getQuantityString in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getText

public CharSequence getText(int id,
                            CharSequence def)
Overrides:
getText in class android.content.res.Resources

getTextArray

public CharSequence[] getTextArray(int id)
                            throws android.content.res.Resources.NotFoundException
Overrides:
getTextArray in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getStringArray

public String[] getStringArray(int id)
                        throws android.content.res.Resources.NotFoundException
Overrides:
getStringArray in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getIntArray

public int[] getIntArray(int id)
                  throws android.content.res.Resources.NotFoundException
Overrides:
getIntArray in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

obtainTypedArray

public android.content.res.TypedArray obtainTypedArray(int id)
                                                throws android.content.res.Resources.NotFoundException
Overrides:
obtainTypedArray in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getDimension

public float getDimension(int id)
                   throws android.content.res.Resources.NotFoundException
Overrides:
getDimension in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getDimensionPixelOffset

public int getDimensionPixelOffset(int id)
                            throws android.content.res.Resources.NotFoundException
Overrides:
getDimensionPixelOffset in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getDimensionPixelSize

public int getDimensionPixelSize(int id)
                          throws android.content.res.Resources.NotFoundException
Overrides:
getDimensionPixelSize in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getDrawable

public android.graphics.drawable.Drawable getDrawable(int id)
                                               throws android.content.res.Resources.NotFoundException
Overrides:
getDrawable in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getMovie

public android.graphics.Movie getMovie(int id)
                                throws android.content.res.Resources.NotFoundException
Overrides:
getMovie in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getColor

public int getColor(int id)
             throws android.content.res.Resources.NotFoundException
Overrides:
getColor in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getColorStateList

public android.content.res.ColorStateList getColorStateList(int id)
                                                     throws android.content.res.Resources.NotFoundException
Overrides:
getColorStateList in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getInteger

public int getInteger(int id)
               throws android.content.res.Resources.NotFoundException
Overrides:
getInteger in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getLayout

public android.content.res.XmlResourceParser getLayout(int id)
                                                throws android.content.res.Resources.NotFoundException
Overrides:
getLayout in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getAnimation

public android.content.res.XmlResourceParser getAnimation(int id)
                                                   throws android.content.res.Resources.NotFoundException
Overrides:
getAnimation in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getXml

public android.content.res.XmlResourceParser getXml(int id)
                                             throws android.content.res.Resources.NotFoundException
Overrides:
getXml in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

openRawResource

public InputStream openRawResource(int id)
                            throws android.content.res.Resources.NotFoundException
Overrides:
openRawResource in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

openRawResourceFd

public android.content.res.AssetFileDescriptor openRawResourceFd(int id)
                                                          throws android.content.res.Resources.NotFoundException
Overrides:
openRawResourceFd in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getValue

public void getValue(int id,
                     android.util.TypedValue outValue,
                     boolean resolveRefs)
              throws android.content.res.Resources.NotFoundException
Overrides:
getValue in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getValue

public void getValue(String name,
                     android.util.TypedValue outValue,
                     boolean resolveRefs)
              throws android.content.res.Resources.NotFoundException
Overrides:
getValue in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

obtainAttributes

public android.content.res.TypedArray obtainAttributes(android.util.AttributeSet set,
                                                       int[] attrs)
Overrides:
obtainAttributes in class android.content.res.Resources

getDisplayMetrics

public android.util.DisplayMetrics getDisplayMetrics()
Overrides:
getDisplayMetrics in class android.content.res.Resources

getConfiguration

public android.content.res.Configuration getConfiguration()
Overrides:
getConfiguration in class android.content.res.Resources

getIdentifier

public int getIdentifier(String name,
                         String defType,
                         String defPackage)
Overrides:
getIdentifier in class android.content.res.Resources

getResourceName

public String getResourceName(int resid)
                       throws android.content.res.Resources.NotFoundException
Overrides:
getResourceName in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getResourcePackageName

public String getResourcePackageName(int resid)
                              throws android.content.res.Resources.NotFoundException
Overrides:
getResourcePackageName in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getResourceTypeName

public String getResourceTypeName(int resid)
                           throws android.content.res.Resources.NotFoundException
Overrides:
getResourceTypeName in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException

getResourceEntryName

public String getResourceEntryName(int resid)
                            throws android.content.res.Resources.NotFoundException
Overrides:
getResourceEntryName in class android.content.res.Resources
Throws:
android.content.res.Resources.NotFoundException


Copyright © 2008-2011. All Rights Reserved.