1
0
mirror of https://github.com/etesync/android synced 2024-12-01 12:28:37 +00:00

Merge pull request #74 from oliver/master

fix NumberFormatException when parsing "ff" alpha value into a Byte
This commit is contained in:
rfc2822 2013-11-14 01:41:46 -08:00
commit 8e8bc1c772

View File

@ -99,7 +99,7 @@ public class LocalCalendar extends LocalCollection<Event> {
Matcher m = p.matcher(info.getColor()); Matcher m = p.matcher(info.getColor());
if (m.find()) { if (m.find()) {
int color_rgb = Integer.parseInt(m.group(1), 16); int color_rgb = Integer.parseInt(m.group(1), 16);
byte color_alpha = m.group(2) != null ? Byte.parseByte(m.group(2), 16) : -1; int color_alpha = m.group(2) != null ? (Integer.parseInt(m.group(2), 16) & 0xFF) : 0xFF;
color = (color_alpha << 24) | color_rgb; color = (color_alpha << 24) | color_rgb;
} }
} }