Exemplo n.º 1
0
 private CharSequence loadStringValueAt(int index) {
   final int[] data = mData;
   final int cookie = data[index + AssetManager.STYLE_ASSET_COOKIE];
   if (cookie < 0) {
     if (mXml != null) {
       return mXml.getPooledString(data[index + AssetManager.STYLE_DATA]);
     }
     return null;
   }
   // System.out.println("Getting pooled from: " + v);
   return mResources.mAssets.getPooledString(cookie, data[index + AssetManager.STYLE_DATA]);
 }
Exemplo n.º 2
0
 /**
  * Retrieve the string value for the attribute at <var>index</var>, but only if that string comes
  * from an immediate value in an XML file. That is, this does not allow references to string
  * resources, string attributes, or conversions from other types. As such, this method will only
  * return strings for TypedArray objects that come from attributes in an XML file.
  *
  * @param index Index of attribute to retrieve.
  * @return String holding string data. Any styling information is removed. Returns null if the
  *     attribute is not defined or is not an immediate string value.
  */
 public String getNonResourceString(int index) {
   index *= AssetManager.STYLE_NUM_ENTRIES;
   final int[] data = mData;
   final int type = data[index + AssetManager.STYLE_TYPE];
   if (type == TypedValue.TYPE_STRING) {
     final int cookie = data[index + AssetManager.STYLE_ASSET_COOKIE];
     if (cookie < 0) {
       return mXml.getPooledString(data[index + AssetManager.STYLE_DATA]).toString();
     }
   }
   return null;
 }
Exemplo n.º 3
0
 /** Returns a message about the parser state suitable for printing error messages. */
 public String getPositionDescription() {
   return mXml != null ? mXml.getPositionDescription() : "<internal>";
 }