Home
last modified time | relevance | path

Searched refs:typedArray (Results 1 – 11 of 11) sorted by relevance

/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/
DShadowTypedArrayTest.java45 TypedArray typedArray = context.obtainStyledAttributes( in getInt_withFlags_shouldReturnValue() local
50 assertThat(typedArray.getInt(0, -1)).isEqualTo(0x33); in getInt_withFlags_shouldReturnValue()
60 TypedArray typedArray = context.obtainStyledAttributes( in getResourceId_shouldReturnActualValue() local
65 assertThat(typedArray.getResourceId(0, -1)).isEqualTo(R.id.snippet_text); in getResourceId_shouldReturnActualValue()
75 TypedArray typedArray = context.obtainStyledAttributes( in getFraction_shouldReturnGivenValue() local
80 assertThat(typedArray.getFraction(0, 100, 1, -1)).isEqualTo(50f); in getFraction_shouldReturnGivenValue()
90 TypedArray typedArray = context.obtainStyledAttributes( in getDimension_shouldReturnGivenValue() local
95 assertThat(typedArray.getDimension(0, -1)).isEqualTo(50f); in getDimension_shouldReturnGivenValue()
100 TypedArray typedArray = context.obtainStyledAttributes( in getDrawable_withExplicitColorValue_shouldReturnColorDrawable() local
105 assertThat(typedArray.getDrawable(0)).isEqualTo(new ColorDrawable(0xff777777)); in getDrawable_withExplicitColorValue_shouldReturnColorDrawable()
[all …]
DShadowResourcesTest.java124 TypedArray typedArray = resources.obtainTypedArray(R.array.typed_array_with_resource_id); in withIdReferenceEntry_obtainTypedArray() local
125 assertThat(typedArray.length()).isEqualTo(2); in withIdReferenceEntry_obtainTypedArray()
127 assertThat(typedArray.getResourceId(0, 0)).isEqualTo(R.id.id_declared_in_item_tag); in withIdReferenceEntry_obtainTypedArray()
128 assertThat(typedArray.getResourceId(1, 0)).isEqualTo(R.id.id_declared_in_layout); in withIdReferenceEntry_obtainTypedArray()
643 TypedArray typedArray = resources.obtainAttributes(attributeSet, new int[]{android.R.attr.id}); in obtainAttributes_shouldUseReferencedIdFromAttributeSet() local
644 assertThat(typedArray.getResourceId(0, -9)).isEqualTo(android.R.id.mask); in obtainAttributes_shouldUseReferencedIdFromAttributeSet()
649 TypedArray typedArray = resources.obtainAttributes(Robolectric.buildAttributeSet() in obtainAttributes() local
652 assertThat(typedArray).isNotNull(); in obtainAttributes()
653 assertThat(typedArray.peekValue(0).resourceId).isEqualTo(R.xml.shortcuts); in obtainAttributes()
681 …TypedArray typedArray = RuntimeEnvironment.application.getTheme().obtainStyledAttributes(attribute… in obtainStyledAttributes_shouldCheckXmlFirst_fromAttributeSetBuilder() local
[all …]
DShadowAssetManagerTest.java184 TypedArray typedArray = in multiFormatAttributes_integerDecimalValue() local
187 typedArray.getValue(0, outValue); in multiFormatAttributes_integerDecimalValue()
195 TypedArray typedArray = in multiFormatAttributes_integerHexValue() local
198 typedArray.getValue(0, outValue); in multiFormatAttributes_integerHexValue()
206 TypedArray typedArray = in multiFormatAttributes_stringValue() local
209 typedArray.getValue(0, outValue); in multiFormatAttributes_stringValue()
217 TypedArray typedArray = in multiFormatAttributes_booleanValue() local
220 typedArray.getValue(0, outValue); in multiFormatAttributes_booleanValue()
DShadowThemeTest.java363 TypedArray typedArray = theme1.obtainStyledAttributes( in shouldFindInheritedAndroidAttributeInTheme() local
365 assertThat(typedArray.hasValue(0)).isTrue(); // animalStyle in shouldFindInheritedAndroidAttributeInTheme()
366 assertThat(typedArray.hasValue(1)).isTrue(); // layout_height in shouldFindInheritedAndroidAttributeInTheme()
413 TypedArray typedArray = resources.newTheme().obtainStyledAttributes( in dimenRef() local
415 assertThat(typedArray.getDimensionPixelSize(0, -1)).isEqualTo(15); in dimenRef()
423 TypedArray typedArray = resources.newTheme().obtainStyledAttributes( in dimenRefRef() local
425 assertThat(typedArray.getDimensionPixelSize(0, -1)).isEqualTo(15); in dimenRefRef()
DShadowContextTest.java263 …TypedArray typedArray = context.obtainStyledAttributes(roboAttributeSet, new int[]{R.attr.quitKeyC… in obtainStyledAttributes_shouldExtractAttributesFromAttributeSet() local
264 assertThat(typedArray.getString(0)).isEqualTo("^q"); in obtainStyledAttributes_shouldExtractAttributesFromAttributeSet()
265 assertThat(typedArray.getInt(1, -1234)).isEqualTo(1 /* ungulate */); in obtainStyledAttributes_shouldExtractAttributesFromAttributeSet()
/external/robolectric/v1/src/test/java/com/xtremelabs/robolectric/shadows/
DTypedArrayTest.java18 private android.content.res.TypedArray typedArray; field in TypedArrayTest
22 typedArray = Robolectric.newInstanceOf(android.content.res.TypedArray.class); in setUp()
32 assertThat(typedArray.getBoolean(0, true), equalTo(true)); in testBooleanDefaultValue()
33 assertThat(typedArray.getBoolean(0, false), equalTo(false)); in testBooleanDefaultValue()
38 assertThat(typedArray.getInt(0, 15), equalTo(15)); in testIntDefaultValue()
39 assertThat(typedArray.getInteger(0, 24), equalTo(24)); in testIntDefaultValue()
44 assertThat(typedArray.getFloat(0, 0.5f), equalTo(0.5f)); in testFloatDefaultValue()
49 assertThat(typedArray.getDimension(0, 0.5f), equalTo(0.5f)); in testDimensionDefaultValue()
54 assertThat(typedArray.getDimensionPixelOffset(0, 2), equalTo(2)); in testDimensionPixelOffsetDefaultValue()
59 assertThat(typedArray.getDimensionPixelSize(0, 2), equalTo(2)); in testDimensionPixelSizeDefaultValue()
[all …]
/external/robolectric-shadows/shadows/framework/src/main/java/org/robolectric/shadows/
DShadowTypedArray.java30 TypedArray typedArray; in create() local
32 typedArray = ReflectionHelpers.callConstructor(TypedArray.class, in create()
34 ReflectionHelpers.setField(typedArray, "mData", data); in create()
35 ReflectionHelpers.setField(typedArray, "mLength", len); in create()
36 ReflectionHelpers.setField(typedArray, "mIndices", indices); in create()
38 typedArray = ReflectionHelpers.callConstructor(TypedArray.class, in create()
45 Shadows.shadowOf(typedArray).stringData = stringData; in create()
46 return typedArray; in create()
69 public static void dump(TypedArray typedArray) { in dump() argument
70 int[] data = ReflectionHelpers.getField(typedArray, "mData"); in dump()
[all …]
DShadowResources.java177 TypedArray typedArray = shadowAssetManager.getTypedArrayResource(realResources, id); in obtainTypedArray() local
178 if (typedArray != null) { in obtainTypedArray()
179 return typedArray; in obtainTypedArray()
DShadowAssetManager.java1008 …TypedArray typedArray = ShadowTypedArray.create(resources, attrs, data, indices, nextIndex, string… in attrsToTypedArray() local
1010 shadowOf(typedArray).positionDescription = set.getPositionDescription(); in attrsToTypedArray()
1012 return typedArray; in attrsToTypedArray()
/external/mockito/src/main/java/org/mockito/internal/util/collections/
DHashCodeAndEqualsSafeSet.java110 public <T> T[] toArray(T[] typedArray) { in toArray() argument
111 …T[] array = typedArray.length >= size() ? typedArray : (T[]) newInstance(typedArray.getClass().get… in toArray()
/external/v8/src/js/
Dtypedarray.js92 function TypedArrayDefaultConstructor(typedArray) { argument
93 switch (%_ClassOf(typedArray)) {
236 function NAMEConstructByTypedArray(obj, typedArray) { argument
238 var srcData = %TypedArrayGetBuffer(typedArray);
239 var length = %_TypedArrayGetLength(typedArray);
240 var byteLength = %_ArrayBufferViewGetByteLength(typedArray);
242 NAMEConstructByArrayLike(obj, typedArray, length);