am d181ffe6: Merge "Resolve color xml attributes properly. [DO NOT MERGE]" into jb-dev
* commit 'd181ffe6881d0a1b49193b5f70dac0cc7cc9aae3':
Resolve color xml attributes properly. [DO NOT MERGE]
diff --git a/tools/layoutlib/bridge/src/android/util/BridgeXmlPullAttributes.java b/tools/layoutlib/bridge/src/android/util/BridgeXmlPullAttributes.java
index 6ac5b02..691339e 100644
--- a/tools/layoutlib/bridge/src/android/util/BridgeXmlPullAttributes.java
+++ b/tools/layoutlib/bridge/src/android/util/BridgeXmlPullAttributes.java
@@ -22,6 +22,7 @@
import com.android.layoutlib.bridge.Bridge;
import com.android.layoutlib.bridge.BridgeConstants;
import com.android.layoutlib.bridge.android.BridgeContext;
+import com.android.layoutlib.bridge.impl.ResourceHelper;
import com.android.resources.ResourceType;
import org.xmlpull.v1.XmlPullParser;
@@ -210,6 +211,9 @@
value = r.getValue();
}
+ if (value.charAt(0) == '#') {
+ return ResourceHelper.getColor(value);
+ }
return XmlUtils.convertValueToInt(value, defaultValue);
}