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

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

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

revision 1557 by torben, Mon May 2 11:54:17 2011 UTC revision 1558 by torben, Fri Jul 8 13:10:53 2011 UTC
# Line 20  public class StationListAdapter extends Line 20  public class StationListAdapter extends
20          Context context;                  Context context;        
21          NumberFormat number = NumberFormat.getNumberInstance();          NumberFormat number = NumberFormat.getNumberInstance();
22                    
23          public StationListAdapter(Context context) {          boolean showDistance;
24            
25            public StationListAdapter(Context context, boolean showDistance) {
26                  super();                  super();
27                  this.context = context;                  this.context = context;
28                                    
29                    this.showDistance = showDistance;
30                    
31                  inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);                  inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
32                  number.setMaximumFractionDigits(1);                  number.setMaximumFractionDigits(1);
33                  number.setMinimumFractionDigits(1);                  number.setMinimumFractionDigits(1);
# Line 65  public class StationListAdapter extends Line 69  public class StationListAdapter extends
69                  tview.setText(station.getName());                  tview.setText(station.getName());
70    
71                  tview = (TextView) root.findViewById(R.id.stationDistance);                  tview = (TextView) root.findViewById(R.id.stationDistance);
72                  if (station.getCalcdist() != 0) {                  if (showDistance == true) {
73                          tview.setText( context.getString(stationlistadapter_distance) + " " + number.format( (double)station.getCalcdist()/1000.0) + " km.");                          tview.setText( context.getString(stationlistadapter_distance) + " " + number.format( (double)station.getCalcdist()/1000.0) + " km.");
74                  } else {                  } else {
75                          tview.setVisibility(View.GONE);                          tview.setVisibility(View.GONE);

Legend:
Removed from v.1557  
changed lines
  Added in v.1558

  ViewVC Help
Powered by ViewVC 1.1.20