]>
iEval git - unical.git/blob - src/ro/ieval/unical/EventAdapter.java
73f29fb0d50f93c83b396134970778ae82efe3d2
1 package ro
.ieval
.unical
;
4 import android
.content
.Context
;
5 import android
.graphics
.Color
;
6 import android
.view
.LayoutInflater
;
7 import android
.view
.View
;
8 import android
.view
.ViewGroup
;
9 import android
.widget
.ArrayAdapter
;
10 import android
.widget
.ImageView
;
11 import android
.widget
.TextView
;
14 public class EventAdapter
extends ArrayAdapter
<Event
> {
15 private final Event
[] values
;
16 private final Context context
;
17 public EventAdapter(Context context
,Event
[] values
) {
18 super(context
,R
.layout
.event_row_layout
,values
);
24 public View
getView(int position
, View convertView
, ViewGroup parent
) {
25 LayoutInflater inflater
= (LayoutInflater
) context
26 .getSystemService(Context
.LAYOUT_INFLATER_SERVICE
);
27 View rowView
= inflater
.inflate(R
.layout
.event_row_layout
, parent
, false);
28 TextView title
= (TextView
) rowView
.findViewById(R
.id
.smalleventtitle
);
29 TextView dstart
= (TextView
) rowView
.findViewById(R
.id
.smalldatestart
);
30 TextView dend
= (TextView
) rowView
.findViewById(R
.id
.smalldateend
);
31 ImageView header
= (ImageView
) rowView
.findViewById(R
.id
.rowHeader
);
32 header
.setBackgroundColor(values
[position
].eventColour
);
33 title
.setText(values
[position
].title
);
34 dstart
.setText(new Date(values
[position
].dtstart
).toString());
35 dend
.setText(new Date(values
[position
].dtend
).toString());
This page took 0.045192 seconds and 4 git commands to generate.