1
0
mirror of https://github.com/etesync/android synced 2024-12-23 07:08:16 +00:00

Don't require # for calendar colors (see #136, closes #238)

This commit is contained in:
rfc2822 2014-11-15 12:58:38 +01:00
parent 4b250dcb66
commit 6f0b9421c1

View File

@ -110,7 +110,7 @@ public class LocalCalendar extends LocalCollection<Event> {
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);