--- android/TrainInfo/src/dk/thoerup/traininfo/DepartureListAdapter.java 2009/08/09 17:46:09 244 +++ android/TrainInfo/src/dk/thoerup/traininfo/DepartureListAdapter.java 2009/09/28 21:39:49 351 @@ -59,10 +59,48 @@ ((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination()); if (station.getStatus().length() > 0 || station.getNote().length() > 0) { - ImageView image = (ImageView) root.findViewById(R.id.Icon); + ImageView image = (ImageView) root.findViewById(R.id.InfoIcon); image.setImageResource(R.drawable.info20); } + ImageView typeIcon = (ImageView) root.findViewById(R.id.TypeIcon); + String trainNumber = station.getTrainNumber().trim(); + String code = trainNumber.split(" ")[0]; + + + + if ( code.equalsIgnoreCase("ra")) { //ra = regionaltog arriva + typeIcon.setImageResource(R.drawable.re); + } else if ( code.equalsIgnoreCase("re")) { + typeIcon.setImageResource(R.drawable.re); + } else if ( code.equalsIgnoreCase("l")) { + typeIcon.setImageResource(R.drawable.lyn); + } else if ( code.equalsIgnoreCase("ic")) { + typeIcon.setImageResource(R.drawable.ic); + } else if ( code.equalsIgnoreCase("pp")) { + typeIcon.setImageResource(R.drawable.pp); + } else if ( code.equalsIgnoreCase("ør")) { + typeIcon.setImageResource(R.drawable.or); + } else if ( code.equalsIgnoreCase("a") ) { + typeIcon.setImageResource(R.drawable.stog_a); //S-Tog: A banen #00b5f1 + } else if ( code.equalsIgnoreCase("b") ) { + typeIcon.setImageResource(R.drawable.stog_b); //S-Tog:B banen #5aba52 + } else if ( code.equalsIgnoreCase("bx") ) { + typeIcon.setImageResource(R.drawable.stog_bx); //S-Tog:Bx banen #a4d17d + } else if ( code.equalsIgnoreCase("c") ) { + typeIcon.setImageResource(R.drawable.stog_c); //S-Tog:C banen #f89734 + } else if ( code.equalsIgnoreCase("e") ) { + typeIcon.setImageResource(R.drawable.stog_e); //S-Tog:E banen #837eba + } else if ( code.equalsIgnoreCase("f") ) { + typeIcon.setImageResource(R.drawable.stog_f); //S-Tog:F banen #ffc32d + } else if ( code.equalsIgnoreCase("h") ) { + typeIcon.setImageResource(R.drawable.stog_h); //S-Tog:H banen #f05737 + } else { + typeIcon.setImageResource(R.drawable.unknown); + } + //Mangler: SJ=Sverige?, EC, + + return root; }