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 |
|
|
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 ) { |