From 50aea3a53570014d2cfccdacfa0c589132c96e72 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 15 Aug 2013 20:43:38 +0300 Subject: [PATCH] Fix AddEventActivity --- src/ro/ieval/unical/AddEventActivity.java | 54 +++++++++++------------ 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/src/ro/ieval/unical/AddEventActivity.java b/src/ro/ieval/unical/AddEventActivity.java index 8d00641..373c4f9 100644 --- a/src/ro/ieval/unical/AddEventActivity.java +++ b/src/ro/ieval/unical/AddEventActivity.java @@ -95,34 +95,32 @@ public final class AddEventActivity extends Activity implements OnDateSetListene final ActionBar actionBar = getActionBar(); setContentView(R.layout.add_event); - if(getIntent().hasExtra(EXTRA_EVENT)) { - final LinearLayout layout = (LinearLayout) findViewById(R.id.repeat_layout); - final Switch repeatSwitch = (Switch) findViewById(R.id.repeat_switch); - Utils.setEnabledRecursively(layout, false); - - repeatSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener(layout)); - - EditText title = (EditText) findViewById(R.id.eventtitle); - title.setText(event.title); - - TextView tstart = (TextView) findViewById(R.id.time_start); - TextView tend = (TextView) findViewById(R.id.time_end); - SimpleDateFormat sf=new SimpleDateFormat("HH:mm"); - Date d=new Date(event.dtstart); - tstart.setText(sf.format(d).toString()); - d.setTime(event.dtend); - tend.setText(sf.format(d).toString()); - - SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); - TextView dstart = (TextView)findViewById(R.id.date_start); - TextView dend = (TextView)findViewById(R.id.date_end); - d.setTime(event.dtstart); - dstart.setText(sd.format(d).toString()); - d.setTime(event.dtend); - dend.setText(sd.format(d).toString()); - EditText description = (EditText) findViewById(R.id.description); - description.setText(event.description); - } + final LinearLayout layout = (LinearLayout) findViewById(R.id.repeat_layout); + final Switch repeatSwitch = (Switch) findViewById(R.id.repeat_switch); + Utils.setEnabledRecursively(layout, false); + + repeatSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener(layout)); + + final EditText title = (EditText) findViewById(R.id.eventtitle); + title.setText(event.title); + + final TextView tstart = (TextView) findViewById(R.id.time_start); + final TextView tend = (TextView) findViewById(R.id.time_end); + final SimpleDateFormat sf=new SimpleDateFormat("HH:mm"); + final Date d=new Date(event.dtstart); + tstart.setText(sf.format(d).toString()); + d.setTime(event.dtend); + tend.setText(sf.format(d).toString()); + + final SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); + final TextView dstart = (TextView)findViewById(R.id.date_start); + final TextView dend = (TextView)findViewById(R.id.date_end); + d.setTime(event.dtstart); + dstart.setText(sd.format(d).toString()); + d.setTime(event.dtend); + dend.setText(sd.format(d).toString()); + final EditText description = (EditText) findViewById(R.id.description); + description.setText(event.description); } @Override -- 2.39.2