60 |
|
|
61 |
if (station.getStatus().length() > 0 || station.getNote().length() > 0) { |
if (station.getStatus().length() > 0 || station.getNote().length() > 0) { |
62 |
ImageView image = (ImageView) root.findViewById(R.id.InfoIcon); |
ImageView image = (ImageView) root.findViewById(R.id.InfoIcon); |
63 |
image.setImageResource(R.drawable.info20); |
|
64 |
|
int iconID; |
65 |
|
if (station.getStatus().toLowerCase().indexOf("aflyst") > -1 || |
66 |
|
station.getNote().toLowerCase().indexOf("aflyst") > -1 ) { |
67 |
|
iconID = R.drawable.warn20; |
68 |
|
} else { |
69 |
|
iconID = R.drawable.info20; |
70 |
|
} |
71 |
|
|
72 |
|
image.setImageResource( iconID ); |
73 |
} |
} |
74 |
|
|
75 |
ImageView typeIcon = (ImageView) root.findViewById(R.id.TypeIcon); |
ImageView typeIcon = (ImageView) root.findViewById(R.id.TypeIcon); |
76 |
String trainNumber = station.getTrainNumber(); |
String trainNumber = station.getTrainNumber().trim(); |
77 |
if ( trainNumber.substring(0, 2).equalsIgnoreCase("ra")) { |
String code = trainNumber.split(" ")[0]; |
78 |
typeIcon.setImageResource(R.drawable.retog); |
|
79 |
} else if (trainNumber.substring(0,1).equalsIgnoreCase("l")) { |
|
80 |
typeIcon.setImageResource(R.drawable.lyntog); |
|
81 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("ic")) { |
if ( code.equalsIgnoreCase("ra")) { //ra = regionaltog arriva |
82 |
typeIcon.setImageResource(R.drawable.ictog); |
typeIcon.setImageResource(R.drawable.re); |
83 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("pp")) { |
} else if ( code.equalsIgnoreCase("re")) { |
84 |
typeIcon.setImageResource(R.drawable.pptog); |
typeIcon.setImageResource(R.drawable.re); |
85 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("a ")) { |
} else if ( code.equalsIgnoreCase("l")) { |
86 |
typeIcon.setImageResource(R.drawable.stog); |
typeIcon.setImageResource(R.drawable.lyn); |
87 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("b ")) { |
} else if ( code.equalsIgnoreCase("ic")) { |
88 |
typeIcon.setImageResource(R.drawable.stog); |
typeIcon.setImageResource(R.drawable.ic); |
89 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("c ")) { |
} else if ( code.equalsIgnoreCase("pp")) { |
90 |
typeIcon.setImageResource(R.drawable.stog); |
typeIcon.setImageResource(R.drawable.pp); |
91 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("d ")) { |
} else if ( code.equalsIgnoreCase("ør")) { |
92 |
typeIcon.setImageResource(R.drawable.stog); |
typeIcon.setImageResource(R.drawable.or); |
93 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("e ")) { |
} else if ( code.equalsIgnoreCase("a") ) { |
94 |
typeIcon.setImageResource(R.drawable.stog); |
typeIcon.setImageResource(R.drawable.stog_a); //S-Tog: A banen #00b5f1 |
95 |
|
} else if ( code.equalsIgnoreCase("b") ) { |
96 |
|
typeIcon.setImageResource(R.drawable.stog_b); //S-Tog:B banen #5aba52 |
97 |
|
} else if ( code.equalsIgnoreCase("bx") ) { |
98 |
|
typeIcon.setImageResource(R.drawable.stog_bx); //S-Tog:Bx banen #a4d17d |
99 |
|
} else if ( code.equalsIgnoreCase("c") ) { |
100 |
|
typeIcon.setImageResource(R.drawable.stog_c); //S-Tog:C banen #f89734 |
101 |
|
} else if ( code.equalsIgnoreCase("e") ) { |
102 |
|
typeIcon.setImageResource(R.drawable.stog_e); //S-Tog:E banen #837eba |
103 |
|
} else if ( code.equalsIgnoreCase("f") ) { |
104 |
|
typeIcon.setImageResource(R.drawable.stog_f); //S-Tog:F banen #ffc32d |
105 |
|
} else if ( code.equalsIgnoreCase("h") ) { |
106 |
|
typeIcon.setImageResource(R.drawable.stog_h); //S-Tog:H banen #f05737 |
107 |
|
} else { |
108 |
|
typeIcon.setImageResource(R.drawable.unknown); |
109 |
} |
} |
110 |
|
//Mangler: SJ=Sverige?, EC, |
111 |
|
|
112 |
|
|
113 |
|
|