Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d96a7403 authored by Xavier Ducrohet's avatar Xavier Ducrohet
Browse files

LayoutLib: Handle color state list in methods returning an int.

Change-Id: Ia35ea09b992a239873026c7ef1629a01dd2e6cec
parent b0d34f9c
Loading
Loading
Loading
Loading
+4 −7
Original line number Original line Diff line number Diff line
@@ -270,13 +270,10 @@ public final class BridgeTypedArray extends TypedArray {
            return defValue;
            return defValue;
        }
        }


        String s = mResourceData[index].getValue();
        ColorStateList colorStateList = ResourceHelper.getColorStateList(
        try {
                mResourceData[index], mContext);
            return ResourceHelper.getColor(s);
        if (colorStateList != null) {
        } catch (NumberFormatException e) {
            return colorStateList.getDefaultColor();
            Bridge.getLog().error(LayoutLog.TAG_RESOURCES_FORMAT, e.getMessage(), e, null /*data*/);

            // we'll return the default value below.
        }
        }


        return defValue;
        return defValue;