1 package com.xtremelabs.robolectric.shadows; 2 3 import android.content.res.Resources; 4 import android.content.res.TypedArray; 5 import com.xtremelabs.robolectric.Robolectric; 6 import com.xtremelabs.robolectric.internal.Implementation; 7 import com.xtremelabs.robolectric.internal.Implements; 8 9 @SuppressWarnings({"UnusedDeclaration"}) 10 @Implements(TypedArray.class) 11 public class ShadowTypedArray { 12 @Implementation getResources()13 public Resources getResources() { 14 return Robolectric.application.getResources(); 15 } 16 17 @Implementation getBoolean(int index, boolean defValue)18 public boolean getBoolean(int index, boolean defValue) { 19 return defValue; 20 } 21 22 @Implementation getFloat(int index, float defValue)23 public float getFloat(int index, float defValue) { 24 return defValue; 25 } 26 27 @Implementation getInt(int index, int defValue)28 public int getInt(int index, int defValue) { 29 return defValue; 30 } 31 32 @Implementation getInteger(int index, int defValue)33 public int getInteger(int index, int defValue) { 34 return defValue; 35 } 36 37 @Implementation getDimension(int index, float defValue)38 public float getDimension(int index, float defValue) { 39 return defValue; 40 } 41 42 @Implementation getDimensionPixelOffset(int index, int defValue)43 public int getDimensionPixelOffset(int index, int defValue) { 44 return defValue; 45 } 46 47 @Implementation getDimensionPixelSize(int index, int defValue)48 public int getDimensionPixelSize(int index, int defValue) { 49 return defValue; 50 } 51 52 @Implementation getLayoutDimension(int index, int defValue)53 public int getLayoutDimension(int index, int defValue) { 54 return defValue; 55 } 56 57 @Implementation getResourceId(int index, int defValue)58 public int getResourceId(int index, int defValue) { 59 return defValue; 60 } 61 } 62