--- android/TrainInfo/src/dk/thoerup/traininfo/DepartureListAdapter.java 2011/05/03 16:28:56 1434 +++ android/TrainInfo/src/dk/thoerup/traininfo/DepartureListAdapter.java 2013/03/30 10:31:12 1963 @@ -31,15 +31,8 @@ inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } - - public void setShowDetails(boolean showDetails) { - this.showDetails = showDetails; - } - - public boolean getShowDetails() { - return showDetails; - } - + + public void toggleShowDetails() { showDetails = !showDetails; notifyDataSetChanged(); @@ -81,6 +74,8 @@ ((TextView) root.findViewById(R.id.Time)).setText(station.getTime()); ((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination()); + //Platform source'n TritInfo er ikke perfekt - så brug den ikke indtil videre + //((TextView) root.findViewById(R.id.Platform)).setText(station.getPlatform()); if ( (station.getStatus() != null && station.getStatus().length() > 0) || (station.getNote() != null && station.getNote().length() > 0) ) { ImageView image = (ImageView) root.findViewById(R.id.InfoIcon); @@ -124,25 +119,36 @@ //TODO: all these traintypes / icons should be explained somewhere private static void buildImageMap() { - imageMap.put("ra", R.drawable.re); //RA = regionaltog arriva - imageMap.put("re", R.drawable.re); //RE = Regionaltog - imageMap.put("l", R.drawable.lyn); //L = Lyn + imageMap.put("ec", R.drawable.ec); //EC = EuroCity + // Missing FP ? imageMap.put("ic", R.drawable.ic); //IC = Intercity + imageMap.put("il", R.drawable.il); //IntercityLyn Nonstop + // Missing Int ? + // Missing IR ? + imageMap.put("l", R.drawable.lyn); //L = Lyn imageMap.put("pp", R.drawable.pp); //PP = Privatbaner (eg. odderbanen eller LokalBanen) + // Missing PX + imageMap.put("ra", R.drawable.re); //RA = regionaltog arriva + imageMap.put("re", R.drawable.re); //RE = Regionaltog imageMap.put("ør", R.drawable.or); //ØR = Øresundstog - imageMap.put("ec", R.drawable.ec); //EC = EuroCity - imageMap.put("sj", R.drawable.sj); // SJ=Svenska Jernbaner - imageMap.put("ie", R.drawable.ie); - //TODO: missing IL: IntercityLyn Nonstop - - imageMap.put("a", R.drawable.stog_a); //S-Tog: A banen #00b5f1 - imageMap.put("b", R.drawable.stog_b); //S-Tog:B banen #5aba52 - imageMap.put("bx", R.drawable.stog_bx); //S-Tog:Bx banen #a4d17d - imageMap.put("c", R.drawable.stog_c); //S-Tog:C banen #f89734 - imageMap.put("e", R.drawable.stog_e); //S-Tog:E banen #837eba - imageMap.put("f", R.drawable.stog_f); //S-Tog:F banen #ffc32d - imageMap.put("h", R.drawable.stog_h); //S-Tog:H banen #f05737 - + + imageMap.put("sj", R.drawable.sj); //SJ=Svenska Jernbaner -- not mentioned on bane.dk + imageMap.put("ie", R.drawable.ie); //what's this ?? -- not mentioned on bane.dk + + //Missing IB ? -- not mentioned on bane.dk + //Missing RX ? -- not mentioned on bane.dk + + for (int i=0; i<=5; i++) { + String add = (i==0) ? "" : "" + i; + + imageMap.put("a" + add, R.drawable.stog_a); //S-Tog: A banen #00b5f1 + imageMap.put("b" + add, R.drawable.stog_b); //S-Tog:B banen #5aba52 + imageMap.put("bx" + add, R.drawable.stog_bx); //S-Tog:Bx banen #a4d17d + imageMap.put("c" + add, R.drawable.stog_c); //S-Tog:C banen #f89734 + imageMap.put("e" + add, R.drawable.stog_e); //S-Tog:E banen #837eba + imageMap.put("f" + add, R.drawable.stog_f); //S-Tog:F banen #ffc32d + imageMap.put("h" + add, R.drawable.stog_h); //S-Tog:H banen #f05737 + } }