From 810f5287ab8b7f0065303bde41706890e550c3cd Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Mon, 10 Jun 2013 00:41:11 +0300 Subject: [PATCH] Default eventColour to the calendar colour --- src/ro/ieval/unical/Event.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ro/ieval/unical/Event.java b/src/ro/ieval/unical/Event.java index 23ccd74..97ce822 100644 --- a/src/ro/ieval/unical/Event.java +++ b/src/ro/ieval/unical/Event.java @@ -67,17 +67,19 @@ final class Event implements Parcelable{ this.calendarID=calendarID; } - public static Event[] getEventsByCalendar(final Context context, final long calendarID, final String sort){ + public static Event[] getEventsByCalendar(final Context context, final Calendar calendar, final String sort){ final ContentResolver cr=context.getContentResolver(); final Cursor cursor = cr.query(Events.CONTENT_URI, PROJECTION, Events.CALENDAR_ID+" = ?", - new String[]{Long.toString(calendarID)}, + new String[]{Long.toString(calendar._id)}, sort); cursor.moveToFirst(); final Event[] events = new Event[cursor.getCount()]; for(int i=0;i r = new ArrayList(); for(final Calendar calendar : Calendar.getAllCalendars(context)) - for(final Event event : getEventsByCalendar(context, calendar._id, null)) + for(final Event event : getEventsByCalendar(context, calendar, null)) r.add(event); return r.toArray(new Event[r.size()]); } -- 2.39.2