]> iEval git - unical.git/commitdiff
Rename GCalendar back to Calendar and remove some unused imports
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 9 Jun 2013 19:57:27 +0000 (22:57 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 9 Jun 2013 19:57:27 +0000 (22:57 +0300)
src/ro/ieval/unical/Calendar.java [new file with mode: 0644]
src/ro/ieval/unical/Event.java
src/ro/ieval/unical/EventListActivity.java
src/ro/ieval/unical/GCalendar.java [deleted file]

diff --git a/src/ro/ieval/unical/Calendar.java b/src/ro/ieval/unical/Calendar.java
new file mode 100644 (file)
index 0000000..11b2667
--- /dev/null
@@ -0,0 +1,53 @@
+package ro.ieval.unical;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.database.Cursor;
+import android.provider.BaseColumns;
+import android.provider.CalendarContract.Calendars;
+
+final class Calendar {
+       private static final String[] PROJECTION = {
+               BaseColumns._ID,
+               Calendars.NAME,
+               Calendars.CALENDAR_DISPLAY_NAME,
+               Calendars.VISIBLE,
+               Calendars.ACCOUNT_NAME,
+               Calendars.ACCOUNT_TYPE,
+       };
+
+       /** Calendar ID */
+       public final long _id;
+       /** Calendar name */
+       public final String name;
+       /** Calendar display name */
+       public final String displayName;
+       /** Calendar visibility (false - do not show events associated with this calendar, true - show events associated with this calendar) */
+       public final boolean visible;
+       /** Name of the account used to sync this calendar */
+       public final String accountName;
+       /** Type of the calendar used to sync this calendar */ 
+       public final String accountType;
+
+       private Calendar(final long _id, final String name, final String displayName, final boolean visible, final String accountName, final String accountType) {
+               this._id=_id;
+               this.name=name;
+               this.displayName=displayName;
+               this.visible=visible;
+               this.accountName=accountName;
+               this.accountType=accountType;
+       }
+
+       public static Calendar[] getAllCalendars(final Context context){
+               final ContentResolver cr=context.getContentResolver();
+               final Cursor cursor = cr.query(Calendars.CONTENT_URI, PROJECTION, null, null, null);
+               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));
+                       cursor.moveToNext();
+               }
+               cursor.close();
+               return calendars;
+       }
+}
index 94b817ac63169656a2fbe556d16909aa3ed90840..23ccd74d5488b9ba411464bc294bf315c540a7ee 100644 (file)
@@ -86,7 +86,7 @@ final class Event implements Parcelable{
        
        public static Event[] getAllEvents(final Context context) {
                final ArrayList<Event> r = new ArrayList<Event>();
-               for(final GCalendar calendar : GCalendar.getAllCalendars(context))
+               for(final Calendar calendar : Calendar.getAllCalendars(context))
                        for(final Event event : getEventsByCalendar(context, calendar._id, null))
                                r.add(event);
                return  r.toArray(new Event[r.size()]);
index 1b550249938ce32a0a250244a5ab886fe9c1413a..58fc8b2e221cc94cc9abeabf6bc4396118f3d31e 100644 (file)
@@ -1,25 +1,17 @@
 package ro.ieval.unical;
 
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Calendar;
 import java.util.Comparator;
-import java.util.Date;
-import java.util.GregorianCalendar;
 
 import android.app.Activity;
 import android.content.Intent;
-import android.graphics.Color;
 import android.os.Bundle;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
-import android.view.View.OnClickListener;
 import android.widget.AdapterView;
 import android.widget.AdapterView.OnItemClickListener;
-import android.widget.Button;
-import android.widget.LinearLayout;
 import android.widget.ListView;
 
 
diff --git a/src/ro/ieval/unical/GCalendar.java b/src/ro/ieval/unical/GCalendar.java
deleted file mode 100644 (file)
index 3889def..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package ro.ieval.unical;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.database.Cursor;
-import android.provider.BaseColumns;
-import android.provider.CalendarContract.Calendars;
-
-final class GCalendar {
-       private static final String[] PROJECTION = {
-               BaseColumns._ID,
-               Calendars.NAME,
-               Calendars.CALENDAR_DISPLAY_NAME,
-               Calendars.VISIBLE,
-               Calendars.ACCOUNT_NAME,
-               Calendars.ACCOUNT_TYPE,
-       };
-
-       /** Calendar ID */
-       public final long _id;
-       /** Calendar name */
-       public final String name;
-       /** Calendar display name */
-       public final String displayName;
-       /** Calendar visibility (false - do not show events associated with this calendar, true - show events associated with this calendar) */
-       public final boolean visible;
-       /** Name of the account used to sync this calendar */
-       public final String accountName;
-       /** Type of the calendar used to sync this calendar */ 
-       public final String accountType;
-
-       private GCalendar(final long _id, final String name, final String displayName, final boolean visible, final String accountName, final String accountType) {
-               this._id=_id;
-               this.name=name;
-               this.displayName=displayName;
-               this.visible=visible;
-               this.accountName=accountName;
-               this.accountType=accountType;
-       }
-
-       public static GCalendar[] getAllCalendars(final Context context){
-               final ContentResolver cr=context.getContentResolver();
-               final Cursor cursor = cr.query(Calendars.CONTENT_URI, PROJECTION, null, null, null);
-               cursor.moveToFirst();
-               final GCalendar[] calendars = new GCalendar[cursor.getCount()];
-               for(int i=0;i<calendars.length;i++){
-                       calendars[i]=new GCalendar(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getInt(3)!=0, cursor.getString(4), cursor.getString(5));
-                       cursor.moveToNext();
-               }
-               cursor.close();
-               return calendars;
-       }
-}
This page took 0.034255 seconds and 4 git commands to generate.