From 6f0b9421c1a29b91a1126011f0b8a65f1236fe0d Mon Sep 17 00:00:00 2001 From: rfc2822 Date: Sat, 15 Nov 2014 12:58:38 +0100 Subject: [PATCH] Don't require # for calendar colors (see #136, closes #238) --- src/at/bitfire/davdroid/resource/LocalCalendar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/at/bitfire/davdroid/resource/LocalCalendar.java b/src/at/bitfire/davdroid/resource/LocalCalendar.java index 8f9c6e63..9fb60064 100644 --- a/src/at/bitfire/davdroid/resource/LocalCalendar.java +++ b/src/at/bitfire/davdroid/resource/LocalCalendar.java @@ -110,7 +110,7 @@ public class LocalCalendar extends LocalCollection { int color = 0xFFC3EA6E; // fallback: "DAVdroid green" if (info.getColor() != null) { - Pattern p = Pattern.compile("#(\\p{XDigit}{6})(\\p{XDigit}{2})?"); + Pattern p = Pattern.compile("#?(\\p{XDigit}{6})(\\p{XDigit}{2})?"); Matcher m = p.matcher(info.getColor()); if (m.find()) { int color_rgb = Integer.parseInt(m.group(1), 16);