]>
iEval git - unical.git/blob - EventAdapter.java
b06e08a38fe06b3d3272b5fc0eb71032c5574304
1 package ro
.ieval
.unical
;
4 import android
.content
.Context
;
5 import android
.view
.LayoutInflater
;
6 import android
.view
.View
;
7 import android
.view
.ViewGroup
;
8 import android
.widget
.ArrayAdapter
;
9 import android
.widget
.TextView
;
12 public class EventAdapter
extends ArrayAdapter
<Event
> {
13 private final Event
[] values
;
14 private final Context context
;
16 public EventAdapter(final Context context
, final Event
[] values
) {
17 super(context
,R
.layout
.event_row_layout
,values
);
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());
This page took 0.049498 seconds and 3 git commands to generate.