aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-02-19 10:16:16 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-02-19 10:16:16 +0000
commita02e8ae9eed3b2e3c105db19e84c27a0774172dd (patch)
tree523ba41be4e1bad06150d9caedb682eef0d7edf2 /src/net/cbaines
parentbff738801d5a231806c42bcb06b1e187d120b5a9 (diff)
downloadsouthamptonuniversitymap-a02e8ae9eed3b2e3c105db19e84c27a0774172dd.tar
southamptonuniversitymap-a02e8ae9eed3b2e3c105db19e84c27a0774172dd.tar.gz
More bug fixes and stuff.
Diffstat (limited to 'src/net/cbaines')
-rw-r--r--src/net/cbaines/suma/DataHandler.java12
-rw-r--r--src/net/cbaines/suma/MapActivity.java7
-rw-r--r--src/net/cbaines/suma/POIView.java2
-rw-r--r--src/net/cbaines/suma/StopView.java6
4 files changed, 18 insertions, 9 deletions
diff --git a/src/net/cbaines/suma/DataHandler.java b/src/net/cbaines/suma/DataHandler.java
index f564d19..25f66ff 100644
--- a/src/net/cbaines/suma/DataHandler.java
+++ b/src/net/cbaines/suma/DataHandler.java
@@ -25,8 +25,6 @@ import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
-import android.util.Log;
-
public class DataHandler extends DefaultHandler {
// this holds the data
@@ -70,7 +68,8 @@ public class DataHandler extends DefaultHandler {
}
/**
- * This gets called at the start of an element. Here we're also setting the booleans to true if it's at that specific tag. (so we know where we are)
+ * This gets called at the start of an element. Here we're also setting the booleans to true if it's at that
+ * specific tag. (so we know where we are)
*
* @param namespaceURI
* @param localName
@@ -81,7 +80,8 @@ public class DataHandler extends DefaultHandler {
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
if (localName.equals("trkpt")) {
- // Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " + atts.getValue("lon"));
+ // Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " +
+ // atts.getValue("lon"));
_data.addPoint(Util.csLatLongToGeoPoint(atts.getValue("lat"), atts.getValue("lon")));
}
}
@@ -100,8 +100,8 @@ public class DataHandler extends DefaultHandler {
}
/**
- * Calling when we're within an element. Here we're checking to see if there is any content in the tags that we're interested in and populating it in the
- * Config object.
+ * Calling when we're within an element. Here we're checking to see if there is any content in the tags that we're
+ * interested in and populating it in the Config object.
*
* @param ch
* @param start
diff --git a/src/net/cbaines/suma/MapActivity.java b/src/net/cbaines/suma/MapActivity.java
index d12057c..cad7567 100644
--- a/src/net/cbaines/suma/MapActivity.java
+++ b/src/net/cbaines/suma/MapActivity.java
@@ -758,6 +758,13 @@ public class MapActivity extends OrmLiteBaseActivity<DatabaseHelper> implements
&& !activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U9",
UNI_LINK_BUS_STOP_OVERLAY_ENABLED_BY_DEFAULT)) {
Log.i(TAG, "Uni-Link bus stop overlay not needed");
+ overlays.remove(UNI_LINK_BUS_STOP_OVERLAY);
+
+ synchronized (mapView.getOverlays()) {
+ mapView.getOverlays().remove(uniLinkBusStopOverlay);
+ Collections.sort(mapView.getOverlays(), comparator);
+ }
+
uniLinkBusStopOverlay = null;
} else {
uniLinkBusStopOverlay.setRoutes(0, activityPrefs.getBoolean(BUS_STOP_OVERLAYS + "U1",
diff --git a/src/net/cbaines/suma/POIView.java b/src/net/cbaines/suma/POIView.java
index d312f37..fb8a6c6 100644
--- a/src/net/cbaines/suma/POIView.java
+++ b/src/net/cbaines/suma/POIView.java
@@ -23,11 +23,9 @@ import android.content.Context;
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
-import android.view.View;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
-import android.widget.TableLayout.LayoutParams;
public class POIView extends LinearLayout {
diff --git a/src/net/cbaines/suma/StopView.java b/src/net/cbaines/suma/StopView.java
index 32cd3e1..764072e 100644
--- a/src/net/cbaines/suma/StopView.java
+++ b/src/net/cbaines/suma/StopView.java
@@ -24,6 +24,7 @@ import java.text.DateFormat;
import android.app.Activity;
import android.content.Intent;
+import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
@@ -131,13 +132,16 @@ public class StopView extends LinearLayout implements OnClickListener, OnLongCli
busDao.refresh(stop.bus);
busRouteDao.refresh(stop.bus.route);
+ Log.i("StopView", "Bus route " + stop.bus.route + " Uni-Link " + stop.bus.route.uniLink + " Bus ID "
+ + stop.bus.id);
+
if (stop.bus.id != null && stop.bus.route.uniLink) {
Intent i = new Intent(context, BusActivity.class);
i.putExtra("busID", stop.bus.id);
i.putExtra("busStopID", stop.busStop.id);
((Activity) context).startActivityForResult(i, 0);
} else {
- if (stop.bus.route.uniLink) {
+ if (!stop.bus.route.uniLink) {
if (context.activityToast == null) {
context.activityToast = Toast.makeText(context,
"Bus schedules only avalible for Uni-Link buses", Toast.LENGTH_SHORT);