/[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 1065 by torben, Sat Jul 10 16:03:10 2010 UTC revision 1066 by torben, Thu Sep 16 15:32:42 2010 UTC
# Line 11  import android.view.ViewGroup; Line 11  import android.view.ViewGroup;
11  import android.widget.BaseAdapter;  import android.widget.BaseAdapter;
12  import android.widget.ImageView;  import android.widget.ImageView;
13  import android.widget.TextView;  import android.widget.TextView;
14    import dk.thoerup.android.traininfo.common.DepartureEntry;
15    
16  public class DepartureListAdapter extends BaseAdapter {  public class DepartureListAdapter extends BaseAdapter {
17    
# Line 67  public class DepartureListAdapter extend Line 68  public class DepartureListAdapter extend
68                  ((TextView) root.findViewById(R.id.Time)).setText(station.getTime());                  ((TextView) root.findViewById(R.id.Time)).setText(station.getTime());
69                  ((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination());                  ((TextView) root.findViewById(R.id.Destination)).setText(station.getDestination());
70                                    
71                  if (station.getStatus().length() > 0 || station.getNote().length() > 0) {                  
72                    if ( (station.getStatus() != null && station.getStatus().length() > 0) || (station.getNote() != null && station.getNote().length() > 0) ) {
73                          ImageView image = (ImageView) root.findViewById(R.id.InfoIcon);                          ImageView image = (ImageView) root.findViewById(R.id.InfoIcon);
74                                                    
75                          String status = station.getStatus().toLowerCase();                          
76                          String note = station.getNote().toLowerCase();                          String status = (station.getStatus() != null) ? station.getStatus().toLowerCase() : "";
77                            String note = (station.getNote() != null) ? station.getNote().toLowerCase() : "";
78                                                    
79                          int iconID;                          int iconID;
80                          if (status.indexOf("aflyst") > -1 || note.indexOf("aflyst") > -1 ) {                          if (status.indexOf("aflyst") > -1 || note.indexOf("aflyst") > -1 ) {

Legend:
Removed from v.1065  
changed lines
  Added in v.1066

  ViewVC Help
Powered by ViewVC 1.1.20