]> iEval git - unical.git/blame - src/ro/ieval/unical/EventAdapter.java
Add refresh to event_list
[unical.git] / src / ro / ieval / unical / EventAdapter.java
CommitLineData
ecee6932 1package ro.ieval.unical;
a824030c
MG
2import java.util.Date;
3
ecee6932
PT
4import android.content.Context;
5import android.view.LayoutInflater;
6import android.view.View;
7import android.view.ViewGroup;
8import android.widget.ArrayAdapter;
9import android.widget.TextView;
10
11
a824030c
MG
12public class EventAdapter extends ArrayAdapter<Event> {
13 private final Event[] values;
ecee6932 14 private final Context context;
1786431d 15
c9b1e441 16 public EventAdapter(final Context context, final Event[] values) {//NOPMD
ecee6932
PT
17 super(context,R.layout.event_row_layout,values);
18 this.context=context;
19 this.values=values;
20 }
070d3ab2 21
ecee6932 22 @Override
1786431d 23 public View getView(final int position, final View convertView, final ViewGroup parent) {
8a08d036
MG
24 final LayoutInflater inflater = (LayoutInflater) context
25 .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
26 final View rowView = inflater.inflate(R.layout.event_row_layout, parent, false);
27 final TextView title = (TextView) rowView.findViewById(R.id.smalleventtitle);
28 final TextView dstart = (TextView) rowView.findViewById(R.id.smalldatestart);
29 final TextView dend = (TextView) rowView.findViewById(R.id.smalldateend);
30 final View header = rowView.findViewById(R.id.rowHeader);
31 header.setBackgroundColor(values[position].eventColour);
32 title.setText(values[position].title);
33 dstart.setText(new Date(values[position].dtstart).toString());
34 dend.setText(new Date(values[position].dtend).toString());
070d3ab2 35
8a08d036 36 return rowView;
ecee6932
PT
37 }
38}
This page took 0.026769 seconds and 4 git commands to generate.