ARSCDecoder: decode strings with their stylings.

This commit is contained in:
Ryszard Wiśniewski 2010-06-14 09:17:44 +02:00
parent 29fd92b2c4
commit a85eff1aef
3 changed files with 8 additions and 6 deletions

View File

@ -46,7 +46,12 @@ public abstract class ResScalarValue extends ResValue
serializer.attribute(null, "type", type);
}
serializer.attribute(null, "name", res.getResSpec().getName());
serializer.text(toResXmlFormat());
String body = toResXmlFormat();
if (! body.isEmpty()) {
serializer.ignorableWhitespace(body);
}
serializer.endTag(null, tagName);
}

View File

@ -41,9 +41,6 @@ public class ResStringValue extends ResScalarValue
@Override
public String toResXmlFormat() {
if (mValue.isEmpty()) {
return mValue;
}
return AndrolibResources.escapeForResXml(mValue);
return mValue;
}
}

View File

@ -208,7 +208,7 @@ public class ARSCDecoder {
int data = mIn.readInt();
return type == TypedValue.TYPE_STRING ?
mPkg.getValueFactory().factory(mTableStrings.getString(data)) :
mPkg.getValueFactory().factory(mTableStrings.getHTML(data)) :
mPkg.getValueFactory().factory(type, data);
}