]> iEval git - unical.git/commitdiff
Add colour to Calendar
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 9 Jun 2013 19:58:04 +0000 (22:58 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 9 Jun 2013 19:58:04 +0000 (22:58 +0300)
src/ro/ieval/unical/Calendar.java

index 11b2667b47b7181c6e73d21cb19e6f6a3a738fdd..1ab1988a7d27aeb5974d3b90aeadc7e93f86fb29 100644 (file)
@@ -14,6 +14,7 @@ final class Calendar {
                Calendars.VISIBLE,
                Calendars.ACCOUNT_NAME,
                Calendars.ACCOUNT_TYPE,
+               Calendars.CALENDAR_COLOR,
        };
 
        /** Calendar ID */
@@ -28,14 +29,17 @@ final class Calendar {
        public final String accountName;
        /** Type of the calendar used to sync this calendar */ 
        public final String accountType;
+       /** Calendar colour */
+       public final int colour;
 
-       private Calendar(final long _id, final String name, final String displayName, final boolean visible, final String accountName, final String accountType) {
+       private Calendar(final long _id, final String name, final String displayName, final boolean visible, final String accountName, final String accountType, final int colour) {
                this._id=_id;
                this.name=name;
                this.displayName=displayName;
                this.visible=visible;
                this.accountName=accountName;
                this.accountType=accountType;
+               this.colour=colour;
        }
 
        public static Calendar[] getAllCalendars(final Context context){
@@ -44,7 +48,7 @@ final class Calendar {
                cursor.moveToFirst();
                final Calendar[] calendars = new Calendar[cursor.getCount()];
                for(int i=0;i<calendars.length;i++){
-                       calendars[i]=new Calendar(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getInt(3)!=0, cursor.getString(4), cursor.getString(5));
+                       calendars[i]=new Calendar(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getInt(3)!=0, cursor.getString(4), cursor.getString(5), cursor.getInt(6));
                        cursor.moveToNext();
                }
                cursor.close();
This page took 0.029797 seconds and 4 git commands to generate.