/[projects]/android/TrainInfo/src/dk/thoerup/traininfo/DepartureListAdapter.java
ViewVC logotype

Diff of /android/TrainInfo/src/dk/thoerup/traininfo/DepartureListAdapter.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 249 by torben, Sun Aug 9 17:46:09 2009 UTC revision 250 by torben, Mon Aug 10 10:46:07 2009 UTC
# Line 59  public class DepartureListAdapter extend Line 59  public class DepartureListAdapter extend
59                  ((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination());                  ((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination());
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.Icon);                          ImageView image = (ImageView) root.findViewById(R.id.InfoIcon);
63                          image.setImageResource(R.drawable.info20);                          image.setImageResource(R.drawable.info20);
64                  }                  }
65                                    
66                    ImageView typeIcon = (ImageView) root.findViewById(R.id.TypeIcon);
67                    String trainNumber = station.getTrainNumber();
68                    if ( trainNumber.substring(0, 2).equalsIgnoreCase("ra")) {
69                            typeIcon.setImageResource(R.drawable.retog);
70                    } else if (trainNumber.substring(0,1).equalsIgnoreCase("l")) {
71                            typeIcon.setImageResource(R.drawable.lyntog);
72                    } else if (trainNumber.substring(0,2).equalsIgnoreCase("ic")) {
73                            typeIcon.setImageResource(R.drawable.ictog);
74                    } else if (trainNumber.substring(0,2).equalsIgnoreCase("pp")) {
75                            typeIcon.setImageResource(R.drawable.pptog);
76                    } else if (trainNumber.substring(0,2).equalsIgnoreCase("a ")) {
77                            typeIcon.setImageResource(R.drawable.stog);
78                    } else if (trainNumber.substring(0,2).equalsIgnoreCase("b ")) {
79                            typeIcon.setImageResource(R.drawable.stog);
80                    } else if (trainNumber.substring(0,2).equalsIgnoreCase("c ")) {
81                            typeIcon.setImageResource(R.drawable.stog);
82                    } else if (trainNumber.substring(0,2).equalsIgnoreCase("d ")) {
83                            typeIcon.setImageResource(R.drawable.stog);
84                    } else if (trainNumber.substring(0,2).equalsIgnoreCase("e ")) {
85                            typeIcon.setImageResource(R.drawable.stog);
86                    }
87                    
88                    
89                                    
90                  return root;                  return root;
91          }          }

Legend:
Removed from v.249  
changed lines
  Added in v.250

  ViewVC Help
Powered by ViewVC 1.1.20