27 |
import android.widget.TableLayout; |
import android.widget.TableLayout; |
28 |
import android.widget.TableRow; |
import android.widget.TableRow; |
29 |
import android.widget.TextView; |
import android.widget.TextView; |
30 |
|
import dk.thoerup.android.traininfo.common.DepartureBean; |
31 |
|
import dk.thoerup.android.traininfo.common.DepartureEntry; |
32 |
|
import dk.thoerup.android.traininfo.common.MetroBean; |
33 |
|
import dk.thoerup.android.traininfo.common.MetroBean.MetroEntry; |
34 |
|
import dk.thoerup.android.traininfo.common.StationBean.StationEntry; |
35 |
import dk.thoerup.traininfo.provider.DepartureProvider; |
import dk.thoerup.traininfo.provider.DepartureProvider; |
36 |
import dk.thoerup.traininfo.provider.MetroProvider; |
import dk.thoerup.traininfo.provider.MetroProvider; |
37 |
import dk.thoerup.traininfo.provider.ProviderFactory; |
import dk.thoerup.traininfo.provider.ProviderFactory; |
|
import dk.thoerup.traininfo.provider.MetroProvider.MetroBean; |
|
|
import dk.thoerup.traininfo.provider.MetroProvider.MetroEntry; |
|
38 |
import dk.thoerup.traininfo.util.MessageBox; |
import dk.thoerup.traininfo.util.MessageBox; |
39 |
|
|
40 |
public class DepartureList extends ListActivity { |
public class DepartureList extends ListActivity { |
60 |
DepartureFetcher fetcher; |
DepartureFetcher fetcher; |
61 |
MetroFetcher metroFetcher; |
MetroFetcher metroFetcher; |
62 |
|
|
63 |
StationBean station; |
StationEntry station; |
64 |
|
|
65 |
boolean arrival = false; |
boolean arrival = false; |
66 |
|
|
76 |
|
|
77 |
Intent launchedBy = getIntent(); |
Intent launchedBy = getIntent(); |
78 |
|
|
79 |
station = (StationBean) launchedBy.getSerializableExtra("stationbean"); |
station = (StationEntry) launchedBy.getSerializableExtra("stationbean"); |
80 |
|
|
81 |
((TextView) findViewById(R.id.stationName)).setText( station.getName() ); |
((TextView) findViewById(R.id.stationName)).setText( station.getName() ); |
82 |
|
|
134 |
|
|
135 |
// findViewById(R.id.header).setOnClickListener( mapLauncher ); |
// findViewById(R.id.header).setOnClickListener( mapLauncher ); |
136 |
|
|
137 |
int distance = station.getDistance(); |
int distance = station.getCalcdist(); |
138 |
if (distance != 0) { |
if (distance != 0) { |
139 |
NumberFormat format = NumberFormat.getNumberInstance(); |
NumberFormat format = NumberFormat.getNumberInstance(); |
140 |
format.setMaximumFractionDigits(1); |
format.setMaximumFractionDigits(1); |
155 |
|
|
156 |
metro = ProviderFactory.getMetroProvider(); |
metro = ProviderFactory.getMetroProvider(); |
157 |
|
|
158 |
if (station.isRegional() == false && station.isSTrain() == false) { |
if (station.isRegional() == false && station.isStrain() == false) { |
159 |
getListView().setVisibility( View.GONE ); |
getListView().setVisibility( View.GONE ); |
160 |
metroView.setVisibility( View.VISIBLE ); |
metroView.setVisibility( View.VISIBLE ); |
161 |
|
|