From 5835912b53529d21c80bc395ab6b26d176b88b7b Mon Sep 17 00:00:00 2001 From: Petru Date: Mon, 15 Jul 2013 18:06:53 +0300 Subject: [PATCH] Removes final atribute from Event fields. Fixes a bug when setting the date --- src/ro/ieval/unical/AddEventActivity.java | 8 ++++---- src/ro/ieval/unical/Event.java | 18 +++++++++--------- src/ro/ieval/unical/TrivialFragment.java | 4 +++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/ro/ieval/unical/AddEventActivity.java b/src/ro/ieval/unical/AddEventActivity.java index 976f4eb..6284b73 100644 --- a/src/ro/ieval/unical/AddEventActivity.java +++ b/src/ro/ieval/unical/AddEventActivity.java @@ -78,11 +78,11 @@ public final class AddEventActivity extends Activity implements OnDateSetListene private Event getEvent(final Activity v) { //TODO get all information - final long _id=22; + final long _id=23;//blatul olimpic final String organizer=""; - final String title=((EditText)v.findViewById(R.id.eventtitle)).getText().toString(); + final String title=""; final String eventLocation=""; - final String description=((EditText)v.findViewById(R.id.description)).getText().toString(); + final String description=""; final int eventColor=0; final long dtstart=0; final long dtend=0; @@ -111,7 +111,7 @@ public final class AddEventActivity extends Activity implements OnDateSetListene public void onDateSet(final DatePicker picker, final int year, final int monthOfYear, final int dayOfMonth) { final Calendar calendar=new GregorianCalendar(year, monthOfYear, dayOfMonth); dateTimeTextView.setText(Utils.formatDate(year, monthOfYear, dayOfMonth)); - calendar.add(Calendar.DAY_OF_MONTH, 1); + //calendar.add(Calendar.DAY_OF_MONTH, 1); if(dateTimeTextView.getId() == R.id.date_start) ((TextView)findViewById(R.id.date_end)).setText(Utils.formatDate(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH))); } diff --git a/src/ro/ieval/unical/Event.java b/src/ro/ieval/unical/Event.java index 41809e9..748d42e 100644 --- a/src/ro/ieval/unical/Event.java +++ b/src/ro/ieval/unical/Event.java @@ -37,23 +37,23 @@ final class Event implements Parcelable{ }; /** Event ID */ - public final long _id; + public long _id; /** Event owner */ - public final String organizer; + public String organizer; /** Event title */ - public final String title; + public String title; /** Event location */ - public final String eventLocation; + public String eventLocation; /** Event description */ - public final String description; + public String description; /** Event colour */ - public final int eventColour; + public int eventColour; /** Event start time (UTC milliseconds since epoch) */ - public final long dtstart; + public long dtstart; /** Event end time (UTC milliseconds since epoch) */ - public final long dtend; + public long dtend; /** Calendar ID */ - public final long calendarID; + public 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; diff --git a/src/ro/ieval/unical/TrivialFragment.java b/src/ro/ieval/unical/TrivialFragment.java index 9486f83..e578abf 100644 --- a/src/ro/ieval/unical/TrivialFragment.java +++ b/src/ro/ieval/unical/TrivialFragment.java @@ -1,6 +1,8 @@ package ro.ieval.unical; +import android.app.ActionBar; import android.app.Fragment; +import android.app.FragmentTransaction; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -38,7 +40,7 @@ public final class TrivialFragment extends Fragment { break; default: } - } + } @Override public void onNothingSelected(final AdapterView arg0) { /* do nothing */ } } -- 2.39.2