3 |
import java.util.List; |
import java.util.List; |
4 |
|
|
5 |
import android.content.Context; |
import android.content.Context; |
6 |
|
import android.util.Log; |
7 |
import android.view.LayoutInflater; |
import android.view.LayoutInflater; |
8 |
import android.view.View; |
import android.view.View; |
9 |
import android.view.ViewGroup; |
import android.view.ViewGroup; |
10 |
import android.widget.BaseAdapter; |
import android.widget.BaseAdapter; |
11 |
|
import android.widget.TextView; |
12 |
|
|
13 |
public class TimetableListAdapter extends BaseAdapter { |
public class TimetableListAdapter extends BaseAdapter { |
14 |
|
|
16 |
LayoutInflater inflater; |
LayoutInflater inflater; |
17 |
Context context; |
Context context; |
18 |
|
|
19 |
|
@Override |
20 |
|
public boolean isEnabled(int position) { |
21 |
|
return false; |
22 |
|
} |
23 |
|
|
24 |
public TimetableListAdapter(Context context) { |
public TimetableListAdapter(Context context) { |
25 |
super(); |
super(); |
26 |
this.context = context; |
this.context = context; |
53 |
|
|
54 |
@Override |
@Override |
55 |
public View getView(int position, View convertView, ViewGroup parent) { |
public View getView(int position, View convertView, ViewGroup parent) { |
56 |
// TODO Auto-generated method stub |
TimetableBean timetableBean = timetable.get(position); |
57 |
return null; |
|
58 |
|
View root = inflater.inflate(R.layout.timetablerow , parent, false); |
59 |
|
|
60 |
|
TextView station = (TextView) root.findViewById(R.id.Station); |
61 |
|
station.setText(timetableBean.getStation()); |
62 |
|
|
63 |
|
TextView arrival = (TextView) root.findViewById(R.id.Arrival); |
64 |
|
arrival.setText(timetableBean.getArrival()); |
65 |
|
|
66 |
|
TextView departure = (TextView) root.findViewById(R.id.Departure); |
67 |
|
departure.setText(timetableBean.getDeparture()); |
68 |
|
|
69 |
|
|
70 |
|
if (timetableBean.isCurrent()) { |
71 |
|
final int bgcolor = 0xFFFFFFFF; |
72 |
|
final int fgcolor = 0xFF000000; |
73 |
|
|
74 |
|
station.setTextColor(fgcolor); |
75 |
|
arrival.setTextColor(fgcolor); |
76 |
|
departure.setTextColor(fgcolor); |
77 |
|
root.setBackgroundColor(bgcolor); |
78 |
|
|
79 |
|
Log.e("Current","current"); |
80 |
|
} |
81 |
|
|
82 |
|
return root; |
83 |
} |
} |
84 |
|
|
85 |
} |
} |