aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/mapcommon/cgeomap.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgeo/geocaching/mapcommon/cgeomap.java')
-rw-r--r--src/cgeo/geocaching/mapcommon/cgeomap.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/cgeo/geocaching/mapcommon/cgeomap.java b/src/cgeo/geocaching/mapcommon/cgeomap.java
index 7d7d51e..4d595ed 100644
--- a/src/cgeo/geocaching/mapcommon/cgeomap.java
+++ b/src/cgeo/geocaching/mapcommon/cgeomap.java
@@ -29,23 +29,23 @@ import cgeo.geocaching.cgCoord;
import cgeo.geocaching.cgDirection;
import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgSettings;
-import cgeo.geocaching.cgSettings.mapSourceEnum;
import cgeo.geocaching.cgUpdateDir;
import cgeo.geocaching.cgUpdateLoc;
import cgeo.geocaching.cgUser;
import cgeo.geocaching.cgWaypoint;
import cgeo.geocaching.cgeoapplication;
import cgeo.geocaching.activity.ActivityMixin;
+import cgeo.geocaching.cgSettings.mapSourceEnum;
import cgeo.geocaching.mapinterfaces.ActivityImpl;
import cgeo.geocaching.mapinterfaces.CacheOverlayItemImpl;
import cgeo.geocaching.mapinterfaces.GeoPointImpl;
import cgeo.geocaching.mapinterfaces.MapControllerImpl;
import cgeo.geocaching.mapinterfaces.MapFactory;
import cgeo.geocaching.mapinterfaces.MapViewImpl;
+import cgeo.geocaching.mapinterfaces.OnDragListener;
import cgeo.geocaching.mapinterfaces.UserOverlayItemImpl;
-import cgeo.geocaching.utils.CollectionUtils;
-public class cgeomap extends MapBase {
+public class cgeomap extends MapBase implements OnDragListener {
private static final int MENU_SELECT_MAPVIEW = 1;
private static final int MENU_MAP_LIVE = 2;
@@ -265,6 +265,7 @@ public class cgeomap extends MapBase {
mapView.setBuiltInZoomControls(true);
mapView.displayZoomControls(true);
mapView.preLoad();
+ mapView.setOnDragListener(this);
// initialize overlays
mapView.clearOverlays();
@@ -506,7 +507,7 @@ public class cgeomap extends MapBase {
}
item = menu.findItem(MENU_STORE_CACHES); // store loaded
- if (live && !isLoading() && app.getNotOfflineCount(searchId) > 0 && CollectionUtils.isNotEmpty(caches)) {
+ if (live && !isLoading() && app.getNotOfflineCount(searchId) > 0 && caches != null && caches.size() > 0) {
item.setEnabled(true);
} else {
item.setEnabled(false);
@@ -563,7 +564,7 @@ public class cgeomap extends MapBase {
ArrayList<cgCache> cachesProtected = new ArrayList<cgCache>(caches);
try {
- if (CollectionUtils.isNotEmpty(cachesProtected)) {
+ if (cachesProtected.size() > 0) {
final GeoPointImpl mapCenter = mapView.getMapViewCenter();
final int mapCenterLat = mapCenter.getLatitudeE6();
final int mapCenterLon = mapCenter.getLongitudeE6();
@@ -1763,6 +1764,14 @@ public class cgeomap extends MapBase {
}
}
+ @Override
+ public void onDrag() {
+ if (followMyLocation) {
+ followMyLocation = false;
+ myLocSwitch.setImageResource(R.drawable.actionbar_mylocation_off);
+ }
+ }
+
// make geopoint
private GeoPointImpl makeGeoPoint(Double latitude, Double longitude) {
return settings.getMapFactory().getGeoPointBase((int) (latitude * 1e6), (int) (longitude * 1e6));