31 |
|
|
32 |
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
33 |
} |
} |
34 |
|
|
35 |
public void setShowDetails(boolean showDetails) { |
|
|
this.showDetails = showDetails; |
|
|
} |
|
|
|
|
|
public boolean getShowDetails() { |
|
|
return showDetails; |
|
|
} |
|
|
|
|
36 |
public void toggleShowDetails() { |
public void toggleShowDetails() { |
37 |
showDetails = !showDetails; |
showDetails = !showDetails; |
38 |
notifyDataSetChanged(); |
notifyDataSetChanged(); |
74 |
((TextView) root.findViewById(R.id.Time)).setText(station.getTime()); |
((TextView) root.findViewById(R.id.Time)).setText(station.getTime()); |
75 |
((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination()); |
((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination()); |
76 |
|
|
77 |
|
//Platform source'n TritInfo er ikke perfekt - så brug den ikke indtil videre |
78 |
|
//((TextView) root.findViewById(R.id.Platform)).setText(station.getPlatform()); |
79 |
|
|
80 |
if ( (station.getStatus() != null && station.getStatus().length() > 0) || (station.getNote() != null && station.getNote().length() > 0) ) { |
if ( (station.getStatus() != null && station.getStatus().length() > 0) || (station.getNote() != null && station.getNote().length() > 0) ) { |
81 |
ImageView image = (ImageView) root.findViewById(R.id.InfoIcon); |
ImageView image = (ImageView) root.findViewById(R.id.InfoIcon); |
119 |
|
|
120 |
//TODO: all these traintypes / icons should be explained somewhere |
//TODO: all these traintypes / icons should be explained somewhere |
121 |
private static void buildImageMap() { |
private static void buildImageMap() { |
122 |
imageMap.put("ra", R.drawable.re); //RA = regionaltog arriva |
imageMap.put("ec", R.drawable.ec); //EC = EuroCity |
123 |
imageMap.put("re", R.drawable.re); //RE = Regionaltog |
// Missing FP ? |
|
imageMap.put("l", R.drawable.lyn); //L = Lyn |
|
124 |
imageMap.put("ic", R.drawable.ic); //IC = Intercity |
imageMap.put("ic", R.drawable.ic); //IC = Intercity |
125 |
|
imageMap.put("il", R.drawable.il); //IntercityLyn Nonstop |
126 |
|
// Missing Int ? |
127 |
|
// Missing IR ? |
128 |
|
imageMap.put("l", R.drawable.lyn); //L = Lyn |
129 |
imageMap.put("pp", R.drawable.pp); //PP = Privatbaner (eg. odderbanen eller LokalBanen) |
imageMap.put("pp", R.drawable.pp); //PP = Privatbaner (eg. odderbanen eller LokalBanen) |
130 |
|
// Missing PX |
131 |
|
imageMap.put("ra", R.drawable.re); //RA = regionaltog arriva |
132 |
|
imageMap.put("re", R.drawable.re); //RE = Regionaltog |
133 |
imageMap.put("ør", R.drawable.or); //ØR = Øresundstog |
imageMap.put("ør", R.drawable.or); //ØR = Øresundstog |
134 |
imageMap.put("ec", R.drawable.ec); //EC = EuroCity |
|
135 |
imageMap.put("sj", R.drawable.sj); // SJ=Svenska Jernbaner |
imageMap.put("sj", R.drawable.sj); //SJ=Svenska Jernbaner -- not mentioned on bane.dk |
136 |
imageMap.put("ie", R.drawable.ie); |
imageMap.put("ie", R.drawable.ie); //what's this ?? -- not mentioned on bane.dk |
137 |
//TODO: missing IL: IntercityLyn Nonstop |
|
138 |
|
//Missing IB ? -- not mentioned on bane.dk |
139 |
imageMap.put("a", R.drawable.stog_a); //S-Tog: A banen #00b5f1 |
//Missing RX ? -- not mentioned on bane.dk |
140 |
imageMap.put("b", R.drawable.stog_b); //S-Tog:B banen #5aba52 |
|
141 |
imageMap.put("bx", R.drawable.stog_bx); //S-Tog:Bx banen #a4d17d |
for (int i=0; i<=5; i++) { |
142 |
imageMap.put("c", R.drawable.stog_c); //S-Tog:C banen #f89734 |
String add = (i==0) ? "" : "" + i; |
143 |
imageMap.put("e", R.drawable.stog_e); //S-Tog:E banen #837eba |
|
144 |
imageMap.put("f", R.drawable.stog_f); //S-Tog:F banen #ffc32d |
imageMap.put("a" + add, R.drawable.stog_a); //S-Tog: A banen #00b5f1 |
145 |
imageMap.put("h", R.drawable.stog_h); //S-Tog:H banen #f05737 |
imageMap.put("b" + add, R.drawable.stog_b); //S-Tog:B banen #5aba52 |
146 |
|
imageMap.put("bx" + add, R.drawable.stog_bx); //S-Tog:Bx banen #a4d17d |
147 |
|
imageMap.put("c" + add, R.drawable.stog_c); //S-Tog:C banen #f89734 |
148 |
|
imageMap.put("e" + add, R.drawable.stog_e); //S-Tog:E banen #837eba |
149 |
|
imageMap.put("f" + add, R.drawable.stog_f); //S-Tog:F banen #ffc32d |
150 |
|
imageMap.put("h" + add, R.drawable.stog_h); //S-Tog:H banen #f05737 |
151 |
|
} |
152 |
|
|
153 |
|
|
154 |
} |
} |