/[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 244 by torben, Sun Aug 9 17:46:09 2009 UTC revision 253 by torben, Mon Aug 10 16:58:22 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.length() >= 2) {
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);
73                            } else if (trainNumber.substring(0,1).equalsIgnoreCase("l")) {
74                                    typeIcon.setImageResource(R.drawable.lyntog);
75                            } else if (trainNumber.substring(0,2).equalsIgnoreCase("ic")) {
76                                    typeIcon.setImageResource(R.drawable.ictog);
77                            } else if (trainNumber.substring(0,2).equalsIgnoreCase("pp")) {
78                                    typeIcon.setImageResource(R.drawable.pptog);
79                            }
80                    } else {
81                            //if each line needs seperate icons, switch on the first(and only( character
82                            typeIcon.setImageResource(R.drawable.stog);
83                    }
84                    
85                    
86                                    
87                  return root;                  return root;
88          }          }

Legend:
Removed from v.244  
changed lines
  Added in v.253

  ViewVC Help
Powered by ViewVC 1.1.20