From bc3c42738fc385fe0863981a50196cf866527372 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 9 Jun 2013 22:57:27 +0300 Subject: [PATCH] Rename GCalendar back to Calendar and remove some unused imports --- src/ro/ieval/unical/{GCalendar.java => Calendar.java} | 10 +++++----- src/ro/ieval/unical/Event.java | 2 +- src/ro/ieval/unical/EventListActivity.java | 8 -------- 3 files changed, 6 insertions(+), 14 deletions(-) rename src/ro/ieval/unical/{GCalendar.java => Calendar.java} (74%) diff --git a/src/ro/ieval/unical/GCalendar.java b/src/ro/ieval/unical/Calendar.java similarity index 74% rename from src/ro/ieval/unical/GCalendar.java rename to src/ro/ieval/unical/Calendar.java index 3889def..11b2667 100644 --- a/src/ro/ieval/unical/GCalendar.java +++ b/src/ro/ieval/unical/Calendar.java @@ -6,7 +6,7 @@ import android.database.Cursor; import android.provider.BaseColumns; import android.provider.CalendarContract.Calendars; -final class GCalendar { +final class Calendar { private static final String[] PROJECTION = { BaseColumns._ID, Calendars.NAME, @@ -29,7 +29,7 @@ final class GCalendar { /** 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) { + 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; @@ -38,13 +38,13 @@ final class GCalendar { this.accountType=accountType; } - public static GCalendar[] getAllCalendars(final Context context){ + 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 GCalendar[] calendars = new GCalendar[cursor.getCount()]; + final Calendar[] calendars = new Calendar[cursor.getCount()]; for(int i=0;i r = new ArrayList(); - 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()]); diff --git a/src/ro/ieval/unical/EventListActivity.java b/src/ro/ieval/unical/EventListActivity.java index 1b55024..58fc8b2 100644 --- a/src/ro/ieval/unical/EventListActivity.java +++ b/src/ro/ieval/unical/EventListActivity.java @@ -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; -- 2.39.2