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 |
|
|
48 |
|
|
49 |
@Override |
@Override |
50 |
public View getView(int position, View convertView, ViewGroup parent) { |
public View getView(int position, View convertView, ViewGroup parent) { |
51 |
// TODO Auto-generated method stub |
TimetableBean timetableBean = timetable.get(position); |
52 |
return null; |
|
53 |
|
View root = inflater.inflate(R.layout.timetablerow , parent, false); |
54 |
|
|
55 |
|
TextView station = (TextView) root.findViewById(R.id.Station); |
56 |
|
station.setText(timetableBean.getStation()); |
57 |
|
|
58 |
|
TextView arrival = (TextView) root.findViewById(R.id.Arrival); |
59 |
|
arrival.setText(timetableBean.getArrival()); |
60 |
|
|
61 |
|
TextView departure = (TextView) root.findViewById(R.id.Departure); |
62 |
|
departure.setText(timetableBean.getDeparture()); |
63 |
|
|
64 |
|
|
65 |
|
if (timetableBean.isCurrent()) { |
66 |
|
final int bgcolor = 0xFFFFFFFF; |
67 |
|
final int fgcolor = 0xFF000000; |
68 |
|
|
69 |
|
station.setTextColor(fgcolor); |
70 |
|
arrival.setTextColor(fgcolor); |
71 |
|
departure.setTextColor(fgcolor); |
72 |
|
root.setBackgroundColor(bgcolor); |
73 |
|
|
74 |
|
Log.e("Current","current"); |
75 |
|
} |
76 |
|
|
77 |
|
return root; |
78 |
} |
} |
79 |
|
|
80 |
} |
} |