--- android/TrainInfo/src/dk/thoerup/traininfo/TimetableList.java 2009/09/30 10:20:05 366 +++ android/TrainInfo/src/dk/thoerup/traininfo/TimetableList.java 2010/01/28 09:10:44 563 @@ -17,6 +17,7 @@ import dk.thoerup.traininfo.provider.ProviderFactory; import dk.thoerup.traininfo.provider.TimetableProvider; import dk.thoerup.traininfo.util.MessageBox; +import static dk.thoerup.traininfo.R.string.*; public class TimetableList extends Activity { @@ -47,8 +48,9 @@ ((TextView)findViewById(R.id.Train)).setText(departure.getTrainNumber()); ((TextView)findViewById(R.id.Status)).setText(departure.getStatus()); + ((TextView)findViewById(R.id.Location)).setText(departure.getLocation()); ((TextView)findViewById(R.id.Note)).setText(departure.getNote()); - ((TextView)findViewById(R.id.Updated)).setText(departure.getLastUpdateString()); + ((TextView)findViewById(R.id.Updated)).setText(departure.getLastUpdateString(this)); if (savedInstanceState == null) { @@ -96,8 +98,8 @@ protected Dialog onCreateDialog(int id) { switch (id) { case DLG_PROGRESS: - ProgressDialog dlg = new ProgressDialog(this); - dlg.setMessage("Fetch timetable data"); + ProgressDialog dlg = new ProgressDialog(this); + dlg.setMessage( getString(timetablelist_fetchdata) ); dlg.setCancelable(true); return dlg; default: @@ -124,20 +126,20 @@ if (success) { adapter.setTimetable(timetables); if (timetables.size() == 0) { - MessageBox.showMessage(TimetableList.this, "No timetable found"); + MessageBox.showMessage(TimetableList.this, getString(timetablelist_nodata)); } } else { // communication or parse error AlertDialog.Builder builder = new AlertDialog.Builder(TimetableList.this); - builder.setMessage("Error finding departures"); + builder.setMessage(getString(timetablelist_fetcherror)); builder.setCancelable(true); - builder.setPositiveButton("Retry", new DialogInterface.OnClickListener() { + builder.setPositiveButton(getString(generic_retry), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); startTimetableFetcher(); } }); - builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + builder.setNegativeButton(getString(generic_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } @@ -151,7 +153,7 @@ protected Void doInBackground(String... arg0) { String trainID = arg0[0]; success = provider.lookupTimetable(trainID); - timetables = provider.getTimetable(); + timetables = provider.getTimetable(trainID); return null; }