From f2ac73dde202d0999e210956747a510712129027 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 8 Feb 2012 12:38:08 +0000 Subject: Basic route movement working, need to code the dialog box next... --- src/net/cbaines/suma/BusRoute.java | 26 ++++++++++++-------------- 1 file 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 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; } } -- cgit v1.2.3