]> iEval git - unical.git/blame_incremental - src/ro/ieval/unical/EventAdapter.java
Replace new event button with no-op add alarm button
[unical.git] / src / ro / ieval / unical / EventAdapter.java
... / ...
CommitLineData
1package ro.ieval.unical;
2import java.util.Date;
3
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
12public class EventAdapter extends ArrayAdapter<Event> {
13 private final Event[] values;
14 private final Context context;
15
16 public EventAdapter(final Context context, final Event[] values) {//NOPMD
17 super(context,R.layout.event_row_layout,values);
18 this.context=context;
19 this.values=values;
20 }
21
22 @Override
23 public View getView(final int position, final View convertView, final ViewGroup parent) {
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());
35
36 return rowView;
37 }
38}
This page took 0.022463 seconds and 4 git commands to generate.