Merge "LayoutLib: Handle color state list in methods returning an int." into honeycomb
This commit is contained in:
committed by
Android (Google) Code Review
commit
62a99c0b3b
@@ -270,13 +270,10 @@ public final class BridgeTypedArray extends TypedArray {
|
||||
return defValue;
|
||||
}
|
||||
|
||||
String s = mResourceData[index].getValue();
|
||||
try {
|
||||
return ResourceHelper.getColor(s);
|
||||
} catch (NumberFormatException e) {
|
||||
Bridge.getLog().error(LayoutLog.TAG_RESOURCES_FORMAT, e.getMessage(), e, null /*data*/);
|
||||
|
||||
// we'll return the default value below.
|
||||
ColorStateList colorStateList = ResourceHelper.getColorStateList(
|
||||
mResourceData[index], mContext);
|
||||
if (colorStateList != null) {
|
||||
return colorStateList.getDefaultColor();
|
||||
}
|
||||
|
||||
return defValue;
|
||||
|
||||
Reference in New Issue
Block a user