From ce34abfb6ce8bdcda181d67542d9fb668393b042 Mon Sep 17 00:00:00 2001 From: fabianterhorst Date: Fri, 10 Jun 2016 09:44:31 +0200 Subject: [PATCH] add color support --- .../fabianterhorst/fastlayout/converters/LayoutConverter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fastlayout-converters/src/main/java/io/fabianterhorst/fastlayout/converters/LayoutConverter.java b/fastlayout-converters/src/main/java/io/fabianterhorst/fastlayout/converters/LayoutConverter.java index fee4ad7..23bd2a1 100644 --- a/fastlayout-converters/src/main/java/io/fabianterhorst/fastlayout/converters/LayoutConverter.java +++ b/fastlayout-converters/src/main/java/io/fabianterhorst/fastlayout/converters/LayoutConverter.java @@ -59,6 +59,9 @@ public LayoutAttribute onConvertLayoutAttributeValue(String attributeValue, Stri return onConvertLayoutAttribute(attribute, attributeName, false); } else if (attribute.endsWith("sp") && isNumber(attribute.replace("sp", ""))) { return onConvertLayoutAttribute(attribute, "LayoutUtils.convertSpToPixel(" + attribute.replace("sp", "f") + ", getContext())", attributeName, false); + } else if (attribute.startsWith("#")) { + //Todo : #999 isnĀ“t working or #000 + return onConvertLayoutAttribute(attribute, "android.graphics.Color.parseColor(\"" + attribute + "\")", attributeName, false); } else if (isNumber(attribute)) { return onConvertLayoutAttribute(attributeValue, attributeName, false); }