aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/maps
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/maps')
-rw-r--r--main/src/cgeo/geocaching/maps/google/GoogleMapView.java11
-rw-r--r--main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java7
-rw-r--r--main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapView024.java7
3 files changed, 23 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/maps/google/GoogleMapView.java b/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
index 094c456..ea815ab 100644
--- a/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
+++ b/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
@@ -38,16 +38,23 @@ public class GoogleMapView extends MapView implements MapViewImpl {
public GoogleMapView(Context context, AttributeSet attrs) {
super(context, attrs);
- gestureDetector = new GestureDetector(context, new GestureListener());
+ initialize(context);
}
public GoogleMapView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- gestureDetector = new GestureDetector(context, new GestureListener());
+ initialize(context);
}
public GoogleMapView(Context context, String apiKey) {
super(context, apiKey);
+ initialize(context);
+ }
+
+ private void initialize(Context context) {
+ if (isInEditMode()) {
+ return;
+ }
gestureDetector = new GestureDetector(context, new GestureListener());
}
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
index fb057a4..d95cc80 100644
--- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
+++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
@@ -42,6 +42,13 @@ public class MapsforgeMapView extends MapView implements MapViewImpl {
public MapsforgeMapView(Context context, AttributeSet attrs) {
super(context, attrs);
+ initialize(context);
+ }
+
+ private void initialize(Context context) {
+ if (isInEditMode()) {
+ return;
+ }
gestureDetector = new GestureDetector(context, new GestureListener());
if (Settings.isScaleMapsforgeText()) {
this.setTextScale(getResources().getDisplayMetrics().density);
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapView024.java b/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapView024.java
index 68a03b7..8dd15fc 100644
--- a/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapView024.java
+++ b/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapView024.java
@@ -36,6 +36,13 @@ public class MapsforgeMapView024 extends MapView implements MapViewImpl {
public MapsforgeMapView024(Context context, AttributeSet attrs) {
super(context, attrs);
+ initialize(context);
+ }
+
+ private void initialize(Context context) {
+ if (isInEditMode()) {
+ return;
+ }
gestureDetector = new GestureDetector(context, new GestureListener());
}