From 1786431dc2b24fd48abac5d60c1663e8a6ec7d0f Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Mon, 10 Jun 2013 00:30:43 +0300 Subject: [PATCH] Clean up --- src/ro/ieval/unical/EventAdapter.java | 19 +++++++++---------- src/ro/ieval/unical/EventListActivity.java | 5 ++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/ro/ieval/unical/EventAdapter.java b/src/ro/ieval/unical/EventAdapter.java index 73f29fb..b06e08a 100644 --- a/src/ro/ieval/unical/EventAdapter.java +++ b/src/ro/ieval/unical/EventAdapter.java @@ -2,33 +2,32 @@ package ro.ieval.unical; import java.util.Date; import android.content.Context; -import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; -import android.widget.ImageView; import android.widget.TextView; public class EventAdapter extends ArrayAdapter { private final Event[] values; private final Context context; - public EventAdapter(Context context,Event[] values) { + + public EventAdapter(final Context context, final Event[] values) { super(context,R.layout.event_row_layout,values); this.context=context; this.values=values; } @Override - public View getView(int position, View convertView, ViewGroup parent) { - LayoutInflater inflater = (LayoutInflater) context + public View getView(final int position, final View convertView, final ViewGroup parent) { + final LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - View rowView = inflater.inflate(R.layout.event_row_layout, parent, false); - TextView title = (TextView) rowView.findViewById(R.id.smalleventtitle); - TextView dstart = (TextView) rowView.findViewById(R.id.smalldatestart); - TextView dend = (TextView) rowView.findViewById(R.id.smalldateend); - ImageView header = (ImageView) rowView.findViewById(R.id.rowHeader); + final View rowView = inflater.inflate(R.layout.event_row_layout, parent, false); + final TextView title = (TextView) rowView.findViewById(R.id.smalleventtitle); + final TextView dstart = (TextView) rowView.findViewById(R.id.smalldatestart); + final TextView dend = (TextView) rowView.findViewById(R.id.smalldateend); + final View header = rowView.findViewById(R.id.rowHeader); header.setBackgroundColor(values[position].eventColour); title.setText(values[position].title); dstart.setText(new Date(values[position].dtstart).toString()); diff --git a/src/ro/ieval/unical/EventListActivity.java b/src/ro/ieval/unical/EventListActivity.java index 18fa49d..7379d59 100644 --- a/src/ro/ieval/unical/EventListActivity.java +++ b/src/ro/ieval/unical/EventListActivity.java @@ -31,9 +31,8 @@ public class EventListActivity extends Activity { lv.setOnItemClickListener(new OnItemClickListener() { @Override - public void onItemClick(AdapterView arg0, View arg1, int arg2, - long arg3) { - // TODO Auto-generated method stub + public void onItemClick(final AdapterView arg0, final View arg1, final int arg2, + final long arg3) { DisplayEventActivity.displayEvent(EventListActivity.this,events[arg2]); } -- 2.39.2