- correctly handles @null in xml
 - added unit test
This commit is contained in:
Connor Tumbleson 2016-01-22 06:07:49 -06:00
parent a64a031f4f
commit d5ca4c12a1
3 changed files with 5 additions and 1 deletions

View File

@ -34,7 +34,7 @@ public class ResValueFactory {
public ResScalarValue factory(int type, int value, String rawValue) throws AndrolibException { public ResScalarValue factory(int type, int value, String rawValue) throws AndrolibException {
switch (type) { switch (type) {
case TypedValue.TYPE_NULL: case TypedValue.TYPE_NULL:
if (value == TypedValue.DATA_NULL_EMPTY) { // Special case $empty as explicitly defined empty value if (value == TypedValue.DATA_NULL_UNDEFINED) { // Special case $empty as explicitly defined empty value
return new ResStringValue(null, value); return new ResStringValue(null, value);
} }
return new ResReferenceValue(mPackage, 0, null); return new ResReferenceValue(mPackage, 0, null);

View File

@ -9,4 +9,7 @@
<item name="@string/issue_477">?android:dividerVertical</item> <item name="@string/issue_477">?android:dividerVertical</item>
</style> </style>
<style name="Foo.Bar" parent=""/> <style name="Foo.Bar" parent=""/>
<style name="IssueStyle">
<item name="@string/issue_1123">@null</item>
</style>
</resources> </resources>

View File

@ -3,4 +3,5 @@
<string name="test1" /> <string name="test1" />
<string name="hello_world">Hello World</string> <string name="hello_world">Hello World</string>
<string name="issue_477">divider</string> <string name="issue_477">divider</string>
<string name="issue_1123">divider</string>
</resources> </resources>