64 |
} |
} |
65 |
|
|
66 |
ImageView typeIcon = (ImageView) root.findViewById(R.id.TypeIcon); |
ImageView typeIcon = (ImageView) root.findViewById(R.id.TypeIcon); |
67 |
String trainNumber = station.getTrainNumber(); |
String trainNumber = station.getTrainNumber().trim(); |
68 |
if (trainNumber.length() >= 2) { |
String code = trainNumber.split(" ")[0]; |
69 |
if ( trainNumber.substring(0, 2).equalsIgnoreCase("ra")) { //ra = regionaltog arriva |
|
70 |
typeIcon.setImageResource(R.drawable.retog); |
|
71 |
} else if ( trainNumber.substring(0, 2).equalsIgnoreCase("re")) { |
|
72 |
typeIcon.setImageResource(R.drawable.retog); |
if ( code.equalsIgnoreCase("ra")) { //ra = regionaltog arriva |
73 |
} else if (trainNumber.substring(0,1).equalsIgnoreCase("l")) { |
typeIcon.setImageResource(R.drawable.re); |
74 |
typeIcon.setImageResource(R.drawable.lyntog); |
} else if ( code.equalsIgnoreCase("re")) { |
75 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("ic")) { |
typeIcon.setImageResource(R.drawable.re); |
76 |
typeIcon.setImageResource(R.drawable.ictog); |
} else if ( code.equalsIgnoreCase("l")) { |
77 |
} else if (trainNumber.substring(0,2).equalsIgnoreCase("pp")) { |
typeIcon.setImageResource(R.drawable.lyn); |
78 |
typeIcon.setImageResource(R.drawable.pptog); |
} else if ( code.equalsIgnoreCase("ic")) { |
79 |
} |
typeIcon.setImageResource(R.drawable.ic); |
80 |
} else { |
} else if ( code.equalsIgnoreCase("pp")) { |
81 |
//if each line needs seperate icons, switch on the first(and only( character |
typeIcon.setImageResource(R.drawable.pp); |
82 |
typeIcon.setImageResource(R.drawable.stog); |
} else if ( code.equalsIgnoreCase("ør")) { |
83 |
|
typeIcon.setImageResource(R.drawable.or); |
84 |
|
} else if ( code.equalsIgnoreCase("a") ) { |
85 |
|
typeIcon.setImageResource(R.drawable.stog_a); //S-Tog: A banen #00b5f1 |
86 |
|
} else if ( code.equalsIgnoreCase("b") ) { |
87 |
|
typeIcon.setImageResource(R.drawable.stog_b); //S-Tog:B banen #5aba52 |
88 |
|
} else if ( code.equalsIgnoreCase("bx") ) { |
89 |
|
typeIcon.setImageResource(R.drawable.stog_bx); //S-Tog:Bx banen #a4d17d |
90 |
|
} else if ( code.equalsIgnoreCase("c") ) { |
91 |
|
typeIcon.setImageResource(R.drawable.stog_c); //S-Tog:C banen #f89734 |
92 |
|
} else if ( code.equalsIgnoreCase("e") ) { |
93 |
|
typeIcon.setImageResource(R.drawable.stog_e); //S-Tog:E banen #837eba |
94 |
|
} else if ( code.equalsIgnoreCase("f") ) { |
95 |
|
typeIcon.setImageResource(R.drawable.stog_f); //S-Tog:F banen #ffc32d |
96 |
|
} else if ( code.equalsIgnoreCase("h") ) { |
97 |
|
typeIcon.setImageResource(R.drawable.stog_h); //S-Tog:H banen #f05737 |
98 |
|
} else { |
99 |
|
typeIcon.setImageResource(R.drawable.unknown); |
100 |
} |
} |
101 |
|
//Mangler: SJ=Sverige?, EC, |
102 |
|
|
103 |
|
|
104 |
|
|