--- android/TrainInfo/src/dk/thoerup/traininfo/DepartureList.java 2010/09/14 17:05:21 1057 +++ android/TrainInfo/src/dk/thoerup/traininfo/DepartureList.java 2011/03/31 17:39:20 1249 @@ -27,11 +27,14 @@ import android.widget.TableLayout; import android.widget.TableRow; import android.widget.TextView; +import dk.thoerup.android.traininfo.common.DepartureBean; +import dk.thoerup.android.traininfo.common.DepartureEntry; +import dk.thoerup.android.traininfo.common.MetroBean; +import dk.thoerup.android.traininfo.common.MetroBean.MetroEntry; +import dk.thoerup.android.traininfo.common.StationBean.StationEntry; import dk.thoerup.traininfo.provider.DepartureProvider; import dk.thoerup.traininfo.provider.MetroProvider; import dk.thoerup.traininfo.provider.ProviderFactory; -import dk.thoerup.traininfo.provider.MetroProvider.MetroBean; -import dk.thoerup.traininfo.provider.MetroProvider.MetroEntry; import dk.thoerup.traininfo.util.MessageBox; public class DepartureList extends ListActivity { @@ -57,7 +60,7 @@ DepartureFetcher fetcher; MetroFetcher metroFetcher; - StationBean station; + StationEntry station; boolean arrival = false; @@ -73,7 +76,7 @@ Intent launchedBy = getIntent(); - station = (StationBean) launchedBy.getSerializableExtra("stationbean"); + station = (StationEntry) launchedBy.getSerializableExtra("stationbean"); ((TextView) findViewById(R.id.stationName)).setText( station.getName() ); @@ -131,7 +134,7 @@ // findViewById(R.id.header).setOnClickListener( mapLauncher ); - int distance = station.getDistance(); + int distance = station.getCalcdist(); if (distance != 0) { NumberFormat format = NumberFormat.getNumberInstance(); format.setMaximumFractionDigits(1); @@ -152,7 +155,7 @@ metro = ProviderFactory.getMetroProvider(); - if (station.isRegional() == false && station.isSTrain() == false) { + if (station.isRegional() == false && station.isStrain() == false) { getListView().setVisibility( View.GONE ); metroView.setVisibility( View.VISIBLE ); @@ -292,7 +295,7 @@ boolean res; switch(item.getItemId()) { case MENU_MAP: - Uri uri = Uri.parse("geo:" + station.getLatitude() + "," + station.getLongitude()); + Uri uri = Uri.parse("geo:" + station.getLatitude() + "," + station.getLongitude() + "?z=16"); startActivity( new Intent(Intent.ACTION_VIEW, uri)); res = true; break; @@ -403,7 +406,7 @@ @Override protected Void doInBackground(Integer... params) { - departures = provider.lookupDepartures(params[0], DepartureList.this.arrival); + departures = provider.lookupDepartures(params[0], DepartureList.this.arrival, "BOTH"); return null; } @@ -421,6 +424,7 @@ TextView h1 = new TextView(this); h1.setText("Metro"); + h1.setTextSize(16); h1.setTypeface( Typeface.defaultFromStyle(Typeface.BOLD)); @@ -431,9 +435,12 @@ TextView h2 = new TextView(this); + h2.setTextSize(16); h2.setTypeface( Typeface.defaultFromStyle(Typeface.BOLD)); h2.setText("Om minutter"); + params = new TableRow.LayoutParams(); + params.weight = 2; head.addView(h2,params); @@ -446,14 +453,17 @@ Log.e("Test", "" + entry.destination); TextView v1 = new TextView(this); - v1.setText( entry.metro ); + v1.setTextSize(16); + v1.setText( entry.metro ); row.addView(v1); TextView v2 = new TextView(this); + v2.setTextSize(16); v2.setText( entry.destination ); row.addView(v2); TextView v3 = new TextView(this); + v3.setTextSize(16); v3.setText( entry.minutes ); row.addView(v3);