]> iEval git - unical.git/commitdiff
Adds method to get information from add event layout. work in progress
authorPetru <l3asketballplayer@yahoo.com>
Sun, 14 Jul 2013 20:37:07 +0000 (23:37 +0300)
committerPetru <l3asketballplayer@yahoo.com>
Sun, 14 Jul 2013 20:37:07 +0000 (23:37 +0300)
src/ro/ieval/unical/AddEventActivity.java
src/ro/ieval/unical/Event.java

index 3526d653a2a56d0640bbfc5b1b02841c974f0dd9..976f4ebcbf168035c9096b8e6b4ed11501664f0d 100644 (file)
@@ -13,6 +13,7 @@ import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.DatePicker;
+import android.widget.EditText;
 import android.widget.TextView;
 import android.widget.TimePicker;
 
@@ -67,12 +68,31 @@ public final class AddEventActivity extends Activity implements OnDateSetListene
                        case R.id.cancel:
                                finish();
                                return true;
+            case R.id.save:
+                Event e = getEvent(this);
+                return true;
                        default:
                                return false;
                }
        }
 
-       public void showDateTimePickerDialog(final View v) {
+    private Event getEvent(final Activity v) {
+        //TODO get all information
+        final long _id=22;
+        final String organizer="";
+        final String title=((EditText)v.findViewById(R.id.eventtitle)).getText().toString();
+        final String eventLocation="";
+        final String description=((EditText)v.findViewById(R.id.description)).getText().toString();
+        final int eventColor=0;
+        final long dtstart=0;
+        final long dtend=0;
+        final long calendarID = 0;
+        System.out.print(title + description);
+        Event ret = new Event(_id,organizer,title,eventLocation,description,eventColor,dtstart,dtend,calendarID);
+        return ret;
+    }
+
+    public void showDateTimePickerDialog(final View v) {
                dateTimeTextView=(TextView) v;
                if(v.getId()==R.id.date_start || v.getId()==R.id.date_end || v.getId() == R.id.repeat_until)
                        new DatePickerFragment().show(getFragmentManager(), "datePicker");
index c1648056963e54568c7987551da2a9d5632fb0e7..41809e9c6b2ca8dc2d5afc4d2fdd04edc6e43875 100644 (file)
@@ -55,7 +55,7 @@ final class Event implements Parcelable{
        /** Calendar ID */
        public final long calendarID;
 
-       private Event(final long _id, final String organizer, final String title, final String eventLocation, final String description, final int eventColor, final long dtstart, final long dtend, final long calendarID) {
+       public Event(final long _id, final String organizer, final String title, final String eventLocation, final String description, final int eventColor, final long dtstart, final long dtend, final long calendarID) {
                this._id=_id;
                this.organizer=organizer;
                this.title=title;
This page took 0.024984 seconds and 4 git commands to generate.