Adds support for DATA_NULL_EMPTY

This commit is contained in:
Connor Tumbleson 2015-12-14 07:00:12 -06:00
parent 6c4167fba4
commit be4bdf1d75
2 changed files with 14 additions and 0 deletions

View File

@ -180,6 +180,17 @@ public class TypedValue {
/* ------------------------------------------------------------ */
/**
* {@link #TYPE_NULL} data indicating the value was not specified.
*/
public static final int DATA_NULL_UNDEFINED = 0;
/**
* {@link #TYPE_NULL} data indicating the value was explicitly set to null.
*/
public static final int DATA_NULL_EMPTY = 1;
/* ------------------------------------------------------------ */
/**
* If {@link #density} is equal to this value, then the density should be
* treated as the system's default density value:

View File

@ -35,6 +35,9 @@ public class ResValueFactory {
throws AndrolibException {
switch (type) {
case TypedValue.TYPE_NULL:
if (value == TypedValue.DATA_NULL_EMPTY) { // Special case $empty as explicitly defined empty value
return new ResStringValue(null, value);
}
return new ResReferenceValue(mPackage, 0, null);
case TypedValue.TYPE_REFERENCE:
return newReference(value, rawValue);