diff options
author | Christopher Baines <cbaines8@gmail.com> | 2012-02-08 12:38:08 +0000 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2012-02-08 12:38:08 +0000 |
commit | f2ac73dde202d0999e210956747a510712129027 (patch) | |
tree | 324786a6752f7cfe6108d5c2c07938d9b6c2dc34 | |
parent | cccc62990e9b3736d7b5b86acd7acf7dcd8de8c3 (diff) | |
download | southamptonuniversitymap-f2ac73dde202d0999e210956747a510712129027.tar southamptonuniversitymap-f2ac73dde202d0999e210956747a510712129027.tar.gz |
Basic route movement working, need to code the dialog box next...
-rw-r--r-- | src/net/cbaines/suma/BusRoute.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/net/cbaines/suma/BusRoute.java b/src/net/cbaines/suma/BusRoute.java index 5af89e7..96cf0ce 100644 --- a/src/net/cbaines/suma/BusRoute.java +++ b/src/net/cbaines/suma/BusRoute.java @@ -121,20 +121,18 @@ public class BusRoute { if (forwardDirection != null) { - if (direction == null) { - return null; - } + if (direction != null) { - if (forwardDirection.equals(direction)) { + if (forwardDirection.equals(direction)) { - } else if (reverseDirection.equals(direction)) { - moveAmount = -moveAmount; - } else { - Log.e("BusRoute", "Direction (" + direction + ") doesnt match either the forward direction (" + forwardDirection + ") or reverse direction (" - + reverseDirection + ")"); - return null; + } else if (reverseDirection.equals(direction)) { + moveAmount = -moveAmount; + } else { + Log.e("BusRoute", "Direction (" + direction + ") doesnt match either the forward direction (" + forwardDirection + + ") or reverse direction (" + reverseDirection + ")"); + return null; + } } - } try { @@ -147,12 +145,12 @@ public class BusRoute { List<RouteStops> routeStopsFound = routeStopsDao.query(routeStopsPreparedQuery); Log.v("BusRoute", "Found " + routeStopsFound.size() + " stops"); - + int stopIndex = 0; - + for (RouteStops routeStop : routeStopsFound) { if (routeStop.stop.id.equals(stop.id)) { - stopIndex = routeStop.sequence -1; + stopIndex = routeStop.sequence - 1; } } |