aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/BusStopOverlay.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/cbaines/suma/BusStopOverlay.java')
-rw-r--r--src/net/cbaines/suma/BusStopOverlay.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/net/cbaines/suma/BusStopOverlay.java b/src/net/cbaines/suma/BusStopOverlay.java
index f912d19..58f5bb0 100644
--- a/src/net/cbaines/suma/BusStopOverlay.java
+++ b/src/net/cbaines/suma/BusStopOverlay.java
@@ -28,7 +28,6 @@ import org.osmdroid.views.MapView.Projection;
import org.osmdroid.views.overlay.Overlay;
import android.app.Activity;
-import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Paint;
@@ -60,7 +59,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants {
private static final String TAG = "BusStopOverlay";
- private final SouthamptonUniversityMapActivity context;
+ private final MapActivity context;
private Dao<BusStop, String> busStopDao;
@@ -68,7 +67,7 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants {
private boolean[] routes = new boolean[5];
- public BusStopOverlay(SouthamptonUniversityMapActivity context, List<BusStop> busStops) throws SQLException {
+ public BusStopOverlay(MapActivity context, List<BusStop> busStops) throws SQLException {
super(context);
this.context = context;
@@ -191,9 +190,20 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants {
}
}
+ public boolean onTouchEvent(final MotionEvent event, final MapView mapView) {
+ // Log.i(TAG, "Touch Event " + event.getPointerCount() + " " + event.getAction());
+ return false;
+ }
+
@Override
public boolean onSingleTapUp(final MotionEvent event, final MapView mapView) {
+ Log.v(TAG, "Pointer count for onSingleTapUp is " + event.getPointerCount() + " " + event.getAction());
+ if (event.getPointerCount() != 1) {
+ Log.v(TAG, "Pointer count for onSingleTapUp not 1, ignoring");
+ return false;
+ }
+
BusStop busStop = getSelectedItem(event, mapView);
if (busStop == null) {
@@ -216,6 +226,12 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants {
public boolean onDoubleTap(final MotionEvent event, final MapView mapView) {
+ Log.v(TAG, "Pointer count for onDoubleTap is " + event.getPointerCount() + " " + event.getAction());
+ if (event.getPointerCount() != 1) {
+ Log.v(TAG, "Pointer count for onDoubleTap not 1, ignoring");
+ return false;
+ }
+
BusStop busStop = getSelectedItem(event, mapView);
if (busStop == null) {
@@ -237,6 +253,13 @@ public class BusStopOverlay extends Overlay implements RouteColorConstants {
@Override
public boolean onLongPress(final MotionEvent event, final MapView mapView) {
+
+ Log.v(TAG, "Pointer count for onLongPress is " + event.getPointerCount() + " " + event.getAction());
+ if (event.getPointerCount() != 1) {
+ Log.v(TAG, "Pointer count for onLongPress not 1, ignoring");
+ return false;
+ }
+
BusStop busStop = getSelectedItem(event, mapView);
if (busStop == null) {