Lines Matching refs:index

76     // Contains ids that are @empty. We still store null in mResourceData for that index, since we
94 * @param index the index of the value in the TypedArray
99 public void bridgeSetValue(int index, String name, boolean isFramework, ResourceValue value) {
100 mResourceData[index] = value;
101 mNames[index] = name;
102 mIsFramework[index] = isFramework;
146 int index = 1;
149 mIndices[index++] = i;
178 * Retrieve the styled string value for the attribute at <var>index</var>.
180 * @param index Index of attribute to retrieve.
186 public CharSequence getText(int index) {
188 return getString(index);
192 * Retrieve the string value for the attribute at <var>index</var>.
194 * @param index Index of attribute to retrieve.
200 public String getString(int index) {
201 if (!hasValue(index)) {
207 Integer v = resolveEnumAttribute(index);
208 return v == null ? mResourceData[index].getValue() : String.valueOf((int) v);
212 * Retrieve the boolean value for the attribute at <var>index</var>.
214 * @param index Index of attribute to retrieve.
220 public boolean getBoolean(int index, boolean defValue) {
221 String s = getString(index);
227 * Retrieve the integer value for the attribute at <var>index</var>.
229 * @param index Index of attribute to retrieve.
235 public int getInt(int index, int defValue) {
236 String s = getString(index);
242 s, mNames[index]),
249 * Retrieve the float value for the attribute at <var>index</var>.
251 * @param index Index of attribute to retrieve.
256 public float getFloat(int index, float defValue) {
257 String s = getString(index);
265 s, mNames[index]),
272 * Retrieve the color value for the attribute at <var>index</var>. If
277 * @param index Index of attribute to retrieve.
284 public int getColor(int index, int defValue) {
285 if (index < 0 || index >= mResourceData.length) {
289 if (mResourceData[index] == null) {
294 mResourceData[index], mContext);
303 public ColorStateList getColorStateList(int index) {
304 if (!hasValue(index)) {
308 return ResourceHelper.getColorStateList(mResourceData[index], mContext);
312 public ComplexColor getComplexColor(int index) {
313 if (!hasValue(index)) {
317 return ResourceHelper.getComplexColor(mResourceData[index], mContext);
321 * Retrieve the integer value for the attribute at <var>index</var>.
323 * @param index Index of attribute to retrieve.
330 public int getInteger(int index, int defValue) {
331 return getInt(index, defValue);
335 * Retrieve a dimensional unit attribute at <var>index</var>. Unit
340 * @param index Index of attribute to retrieve.
351 public float getDimension(int index, float defValue) {
352 String s = getString(index);
366 if (ResourceHelper.parseFloatAttribute(mNames[index], s, mValue, true)) {
374 * Retrieve a dimensional unit attribute at <var>index</var> for use
380 * @param index Index of attribute to retrieve.
391 public int getDimensionPixelOffset(int index, int defValue) {
392 return (int) getDimension(index, defValue);
396 * Retrieve a dimensional unit attribute at <var>index</var> for use
403 * @param index Index of attribute to retrieve.
414 public int getDimensionPixelSize(int index, int defValue) {
416 return getDimension(index, null);
418 String s = getString(index);
424 s, mNames[index]), null);
437 * @param index Index of the attribute to retrieve.
444 public int getLayoutDimension(int index, String name) {
447 return getDimension(index, name);
462 public int getLayoutDimension(int index, int defValue) {
463 return getDimensionPixelSize(index, defValue);
467 private int getDimension(int index, @Nullable String name) {
468 String s = getString(index);
484 if (ResourceHelper.parseFloatAttribute(mNames[index], s, mValue, true)) {
497 * Retrieve a fractional unit attribute at <var>index</var>.
499 * @param index Index of attribute to retrieve.
512 public float getFraction(int index, int base, int pbase, float defValue) {
513 String value = getString(index);
518 if (ResourceHelper.parseFloatAttribute(mNames[index], value, mValue, false)) {
526 value, mNames[index]), null);
533 * <var>index</var>. Note that attribute resource as resolved when
539 * @param index Index of attribute to retrieve.
546 public int getResourceId(int index, int defValue) {
547 if (index < 0 || index >= mResourceData.length) {
551 // get the Resource for this index
552 ResourceValue resValue = mResourceData[index];
652 "Unable to resolve id \"%1$s\" for attribute \"%2$s\"", value, mNames[index]),
659 public int getThemeAttributeId(int index, int defValue) {
665 * Retrieve the Drawable for the attribute at <var>index</var>. This
670 * @param index Index of attribute to retrieve.
675 public Drawable getDrawable(int index) {
676 if (!hasValue(index)) {
680 ResourceValue value = mResourceData[index];
686 * Retrieve the CharSequence[] for the attribute at <var>index</var>.
691 * @param index Index of attribute to retrieve.
696 public CharSequence[] getTextArray(int index) {
697 if (!hasValue(index)) {
700 ResourceValue resVal = mResourceData[index];
707 int id = getResourceId(index, 0);
711 resVal.getValue(), mNames[index], resIdMessage));
729 * Retrieve the raw TypedValue for the attribute at <var>index</var>.
731 * @param index Index of attribute to retrieve.
738 public boolean getValue(int index, TypedValue outValue) {
739 String s = getString(index);
740 return s != null && ResourceHelper.parseFloatAttribute(mNames[index], s, outValue, false);
745 public int getType(int index) {
746 String value = getString(index);
798 * Determines whether there is an attribute at <var>index</var>.
800 * @param index Index of attribute to retrieve.
805 public boolean hasValue(int index) {
806 return index >= 0 && index < mResourceData.length && mResourceData[index] != null;
810 public boolean hasValueOrEmpty(int index) {
811 return hasValue(index) || index >= 0 && index < mResourceData.length &&
812 mEmptyIds != null && Arrays.binarySearch(mEmptyIds, index) >= 0;
816 * Retrieve the raw TypedValue for the attribute at <var>index</var>
820 * @param index Index of attribute to retrieve.
827 public TypedValue peekValue(int index) {
828 if (index < 0 || index >= mResourceData.length) {
832 if (getValue(index, mValue)) {
864 * @param index Index of attribute to retrieve.
868 private Integer resolveEnumAttribute(int index) {
871 if (mIsFramework[index]) {
872 map = Bridge.getEnumValues(mNames[index]);
876 ResourceValue attr = res.getProjectResource(ResourceType.ATTR, mNames[index]);
888 String[] keywords = mResourceData[index].getValue().split("\\|");
916 int index = 0;
922 index++;
925 if ('0' == charSeq.charAt(index)) {
927 if (index == (len - 1))
930 char c = charSeq.charAt(index + 1);
933 index += 2;
936 index++;
940 } else if ('#' == charSeq.charAt(index)) {
949 return ((int)Long.parseLong(charSeq.substring(index), base)) * sign;