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

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

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

revision 1256 by torben, Thu Sep 16 15:32:42 2010 UTC revision 1257 by torben, Mon Apr 4 15:28:12 2011 UTC
# Line 1  Line 1 
1  package dk.thoerup.traininfo;  package dk.thoerup.traininfo;
2    
3  import android.content.Context;  import android.content.Context;
4    import android.util.Log;
5  import android.view.LayoutInflater;  import android.view.LayoutInflater;
6  import android.view.View;  import android.view.View;
7  import android.view.ViewGroup;  import android.view.ViewGroup;
# Line 50  public class TimetableListAdapter extend Line 51  public class TimetableListAdapter extend
51                  return position;                  return position;
52          }          }
53    
54            String getTranslated(String str) {
55                    if (str == null)
56                            return str;            
57                    
58                    str = str.replace("Aflyst", context.getString(R.string.timetablelist_cancel) );
59                    return str;
60            }
61            
62          @Override          @Override
63          public View getView(int position, View convertView, ViewGroup parent) {          public View getView(int position, View convertView, ViewGroup parent) {
64                  TimetableEntry entry = timetable.entries.get(position);                  TimetableEntry entry = timetable.entries.get(position);
# Line 57  public class TimetableListAdapter extend Line 66  public class TimetableListAdapter extend
66                  View root = inflater.inflate(R.layout.timetablerow , parent, false);                  View root = inflater.inflate(R.layout.timetablerow , parent, false);
67                                    
68                  TextView station = (TextView) root.findViewById(R.id.Station);                  TextView station = (TextView) root.findViewById(R.id.Station);
69                  station.setText(entry.getStation());                  station.setText( entry.getStation() );
70                                    
71                  TextView arrival = (TextView) root.findViewById(R.id.Arrival);                            TextView arrival = (TextView) root.findViewById(R.id.Arrival);          
72                  arrival.setText(entry.getArrival());                  arrival.setText( getTranslated(entry.getArrival()) );
73                                    
74                  TextView departure = (TextView) root.findViewById(R.id.Departure);                                TextView departure = (TextView) root.findViewById(R.id.Departure);              
75                  departure.setText(entry.getDeparture());                  departure.setText( getTranslated(entry.getDeparture()) );
76                                    
77                                    
78                  if (entry.isCurrent()) {                  if (entry.isCurrent()) {

Legend:
Removed from v.1256  
changed lines
  Added in v.1257

  ViewVC Help
Powered by ViewVC 1.1.20