aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/BusSpecificTimetableAdapter.java
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-02-16 22:35:53 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-02-16 22:35:53 +0000
commit3f10264e8dba0cd972647fbe1379f148b1ee6847 (patch)
tree2219a824f9aa865c1836998eb46757db6e708545 /src/net/cbaines/suma/BusSpecificTimetableAdapter.java
parent86629c735d4f7c48e1562825ca63ba3335363cbb (diff)
downloadsouthamptonuniversitymap-3f10264e8dba0cd972647fbe1379f148b1ee6847.tar
southamptonuniversitymap-3f10264e8dba0cd972647fbe1379f148b1ee6847.tar.gz
More progress on the route movement stuff, identified the bus stops that need addressing manualy, however I need to redefine the concept
of direction. As all of the routes that direction applies are circular, direction is only relevent for dealing with the bus stops that are present in the route more than once.
Diffstat (limited to 'src/net/cbaines/suma/BusSpecificTimetableAdapter.java')
-rw-r--r--src/net/cbaines/suma/BusSpecificTimetableAdapter.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java
index 4cc894f..469fa56 100644
--- a/src/net/cbaines/suma/BusSpecificTimetableAdapter.java
+++ b/src/net/cbaines/suma/BusSpecificTimetableAdapter.java
@@ -32,6 +32,8 @@ public class BusSpecificTimetableAdapter extends BaseAdapter {
private final Animation a;
private boolean[] changed;
+ private long timeOfLastForcedUpdate = System.currentTimeMillis();
+
// private static final String TAG = "BusSpecificTimetableAdapter";
public BusSpecificTimetableAdapter(BusActivity context, Timetable timetable) {
@@ -43,6 +45,13 @@ public class BusSpecificTimetableAdapter extends BaseAdapter {
public View getView(int position, View convertView, ViewGroup parent) {
// Log.i(TAG, "Returning stop " + position + " " + timetable.get(position));
+ context.busStopsActive.set(position, true);
+
+ if (timeOfLastForcedUpdate + 1000 < System.currentTimeMillis()) {
+ context.handler.post(context.refreshData);
+ timeOfLastForcedUpdate = System.currentTimeMillis();
+ }
+
BusSpecificStopView stopView;
if (convertView == null) {
stopView = new BusSpecificStopView(context, timetable.get(position));