aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/BuildingNumOverlay.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/cbaines/suma/BuildingNumOverlay.java')
-rw-r--r--src/net/cbaines/suma/BuildingNumOverlay.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/net/cbaines/suma/BuildingNumOverlay.java b/src/net/cbaines/suma/BuildingNumOverlay.java
index b541aa1..6acffa1 100644
--- a/src/net/cbaines/suma/BuildingNumOverlay.java
+++ b/src/net/cbaines/suma/BuildingNumOverlay.java
@@ -239,12 +239,34 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
}
}
+ /**
+ * <b>You can prevent all(!) other Touch-related events from happening!</b><br />
+ * By default does nothing (<code>return false</code>). If you handled the Event, return <code>true</code>, otherwise return
+ * <code>false</code>. If you returned <code>true</code> none of the following Overlays or the underlying {@link MapView} has
+ * the chance to handle this event.
+ */
+ public boolean onTouchEvent(final MotionEvent event, final MapView mapView) {
+ Log.i(TAG, "getAction " + event.getAction());
+ Log.i(TAG, "getDownTime " + event.getDownTime());
+ Log.i(TAG, "getPointerCount " + event.getPointerCount());
+
+ return true;
+ }
+
@Override
public boolean onLongPress(final MotionEvent event, final MapView mapView) {
if (!this.isEnabled())
return false;
+ int pointerCount = event.getPointerCount();
+ if (pointerCount > 1) {
+ Log.v(TAG, "Detected a zoom " + pointerCount);
+ return false;
+ } else {
+ Log.v(TAG, "Zoom not detected " + pointerCount);
+ }
+
final Building building = getSelectedItem(event, mapView);
if (building == null) {
@@ -254,7 +276,7 @@ public class BuildingNumOverlay extends Overlay implements Preferences, OnShared
Log.v(TAG, "building Pressed " + building.id);
final SharedPreferences favouritesPrefs = context.getSharedPreferences(FAVOURITES_PREFERENCES, 0);
- final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
+ // final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
if (favouritesPrefs.getBoolean(building.id, false)) {
favouritesPrefs.edit().remove(building.id).commit();