am e442e904: am 47172f53: Merge "Use parseColor instead of getHTMLColor"

* commit 'e442e904ae19f0b59ebfd4a7c735648b64bc955e':
  Use parseColor instead of getHTMLColor
This commit is contained in:
Alan Viverette
2014-11-21 20:49:04 +00:00
committed by Android Git Automerger

View File

@@ -311,13 +311,13 @@ final class StringBlock {
* the color black is returned instead. * the color black is returned instead.
* *
* @param color The color as a string. Can be a resource reference, * @param color The color as a string. Can be a resource reference,
* HTML hexadecimal, octal or a name * hexadecimal, octal or a name
* @param foreground True if the color will be used as the foreground color, * @param foreground True if the color will be used as the foreground color,
* false otherwise * false otherwise
* *
* @return A CharacterStyle * @return A CharacterStyle
* *
* @see Color#getHtmlColor(String) * @see Color#parseColor(String)
*/ */
private static CharacterStyle getColor(String color, boolean foreground) { private static CharacterStyle getColor(String color, boolean foreground) {
int c = 0xff000000; int c = 0xff000000;
@@ -336,7 +336,11 @@ final class StringBlock {
} }
} }
} else { } else {
c = Color.getHtmlColor(color); try {
c = Color.parseColor(color);
} catch (IllegalArgumentException e) {
c = Color.BLACK;
}
} }
} }