From: Marius Gavrilescu Date: Sun, 9 Jun 2013 11:41:59 +0000 (+0300) Subject: Cleanup previous commit X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=9dcd994f872e2281e76f512319e7ca23b4c3dbb5;p=unical.git Cleanup previous commit --- diff --git a/src/ro/ieval/unical/Attendee.java b/src/ro/ieval/unical/Attendee.java index ede40d4..d6cb4ff 100644 --- a/src/ro/ieval/unical/Attendee.java +++ b/src/ro/ieval/unical/Attendee.java @@ -4,7 +4,6 @@ import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; import android.provider.BaseColumns; -import android.provider.CalendarContract; import android.provider.CalendarContract.Attendees; final class Attendee { diff --git a/src/ro/ieval/unical/DeleteEventDialog.java b/src/ro/ieval/unical/DeleteEventDialog.java index 2783a8c..a076507 100644 --- a/src/ro/ieval/unical/DeleteEventDialog.java +++ b/src/ro/ieval/unical/DeleteEventDialog.java @@ -13,12 +13,13 @@ public final class DeleteEventDialog extends DialogFragment { builder.setMessage(R.string.askdeleteevent) .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @Override - public void onClick(final DialogInterface dialog, final int id) { + public void onClick(final DialogInterface dialog, final int id) { + } }) .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { @Override - public void onClick(final DialogInterface dialog, final int id) { + public void onClick(final DialogInterface dialog, final int id) { // User cancelled the dialog } }); diff --git a/src/ro/ieval/unical/DisplayEventActivity.java b/src/ro/ieval/unical/DisplayEventActivity.java index 8b8a767..47f82a6 100644 --- a/src/ro/ieval/unical/DisplayEventActivity.java +++ b/src/ro/ieval/unical/DisplayEventActivity.java @@ -15,7 +15,6 @@ public class DisplayEventActivity extends Activity { public static final String EXTRA_EVENT = "event"; public static void displayEvent(final Context context, final Event event){ - System.out.println("Muie"); final Intent i=new Intent(context,DisplayEventActivity.class); i.putExtra(DisplayEventActivity.EXTRA_EVENT, event); context.startActivity(i); diff --git a/src/ro/ieval/unical/EventListActivity.java b/src/ro/ieval/unical/EventListActivity.java index 2473260..17b219a 100644 --- a/src/ro/ieval/unical/EventListActivity.java +++ b/src/ro/ieval/unical/EventListActivity.java @@ -1,11 +1,9 @@ package ro.ieval.unical; import java.util.Arrays; -import java.util.Date; -import java.util.GregorianCalendar; +import java.util.Comparator; import android.app.Activity; -import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.view.View; @@ -15,41 +13,38 @@ import android.widget.LinearLayout; public class EventListActivity extends Activity { - GregorianCalendar gc; - + private static class EventComparator implements Comparator { + @Override + public int compare(final Event lhs, final Event rhs) { + if(lhs.dtstart < rhs.dtstart) + return -1; + if(lhs.dtstart == rhs.dtstart) + return 0; + return 1; + } + + } + @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub + protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.event_list); - - Date d=new Date(); - d.getTime(); - gc=new GregorianCalendar(); - gc.setTime(d); - - Event r[]=Event.getAllEvents(getBaseContext()); - LinearLayout ll = (LinearLayout)findViewById(R.id.eventslayout); - Arrays.sort(r,new EventComparator()); - EventButton[] b=new EventButton[10000]; - for(int i=0; i