Skip to content

Commit b205fa6

Browse files
deepanshu-Android (Google) Code Review
authored andcommitted
Merge "Resolve color xml attributes properly." into lmp-dev
2 parents dc77ea4 + 99d90a6 commit b205fa6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tools/layoutlib/bridge/src/android/util/BridgeXmlPullAttributes.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.android.layoutlib.bridge.Bridge;
2323
import com.android.layoutlib.bridge.BridgeConstants;
2424
import com.android.layoutlib.bridge.android.BridgeContext;
25+
import com.android.layoutlib.bridge.impl.ResourceHelper;
2526
import com.android.resources.ResourceType;
2627

2728
import org.xmlpull.v1.XmlPullParser;
@@ -210,6 +211,9 @@ public int getAttributeIntValue(int index, int defaultValue) {
210211
value = r.getValue();
211212
}
212213

214+
if (value.charAt(0) == '#') {
215+
return ResourceHelper.getColor(value);
216+
}
213217
return XmlUtils.convertValueToInt(value, defaultValue);
214218
}
215219

0 commit comments

Comments
 (0)