diff options
author | Alan Viverette <alanv@google.com> | 2014-11-21 20:49:04 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-21 20:49:04 +0000 |
commit | 47379f3050265453655ff82edd4c36bda01ba48f (patch) | |
tree | 653ff1e9839ca9da2a9fccb325c22f20beb5c38c /core/java/android/content/res | |
parent | 296ea9174222e64085a66a238e6df13b8b378b1e (diff) | |
parent | e442e904ae19f0b59ebfd4a7c735648b64bc955e (diff) | |
download | frameworks_base-47379f3050265453655ff82edd4c36bda01ba48f.zip frameworks_base-47379f3050265453655ff82edd4c36bda01ba48f.tar.gz frameworks_base-47379f3050265453655ff82edd4c36bda01ba48f.tar.bz2 |
am e442e904: am 47172f53: Merge "Use parseColor instead of getHTMLColor"
* commit 'e442e904ae19f0b59ebfd4a7c735648b64bc955e':
Use parseColor instead of getHTMLColor
Diffstat (limited to 'core/java/android/content/res')
-rw-r--r-- | core/java/android/content/res/StringBlock.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/java/android/content/res/StringBlock.java b/core/java/android/content/res/StringBlock.java index 77b8a33..9652db7 100644 --- a/core/java/android/content/res/StringBlock.java +++ b/core/java/android/content/res/StringBlock.java @@ -311,13 +311,13 @@ final class StringBlock { * the color black is returned instead. * * @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, * false otherwise * * @return A CharacterStyle * - * @see Color#getHtmlColor(String) + * @see Color#parseColor(String) */ private static CharacterStyle getColor(String color, boolean foreground) { int c = 0xff000000; @@ -336,7 +336,11 @@ final class StringBlock { } } } else { - c = Color.getHtmlColor(color); + try { + c = Color.parseColor(color); + } catch (IllegalArgumentException e) { + c = Color.BLACK; + } } } |