1 |
torben |
362 |
package dk.thoerup.traininfo; |
2 |
|
|
|
3 |
|
|
import java.util.List; |
4 |
|
|
|
5 |
|
|
import android.content.Context; |
6 |
|
|
import android.view.LayoutInflater; |
7 |
|
|
import android.view.View; |
8 |
|
|
import android.view.ViewGroup; |
9 |
|
|
import android.widget.BaseAdapter; |
10 |
|
|
|
11 |
|
|
public class TimetableListAdapter extends BaseAdapter { |
12 |
|
|
|
13 |
|
|
private List<TimetableBean> timetable; |
14 |
|
|
LayoutInflater inflater; |
15 |
|
|
Context context; |
16 |
|
|
|
17 |
|
|
public TimetableListAdapter(Context context) { |
18 |
|
|
super(); |
19 |
|
|
this.context = context; |
20 |
|
|
|
21 |
|
|
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
22 |
|
|
} |
23 |
|
|
|
24 |
|
|
public void setTimetable(List<TimetableBean> timetable) { |
25 |
|
|
this.timetable = timetable; |
26 |
|
|
notifyDataSetChanged(); |
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
@Override |
30 |
|
|
public int getCount() { |
31 |
|
|
if (timetable != null) |
32 |
|
|
return timetable.size(); |
33 |
|
|
else |
34 |
|
|
return 0; |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
@Override |
38 |
|
|
public Object getItem(int position) { |
39 |
|
|
return null; |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
@Override |
43 |
|
|
public long getItemId(int position) { |
44 |
|
|
return position; |
45 |
|
|
} |
46 |
|
|
|
47 |
|
|
@Override |
48 |
|
|
public View getView(int position, View convertView, ViewGroup parent) { |
49 |
|
|
// TODO Auto-generated method stub |
50 |
|
|
return null; |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
} |