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.java29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/cgeo/geocaching/mapcommon/cgeomap.java b/src/cgeo/geocaching/mapcommon/cgeomap.java
index 25f0b4e..9ea03e5 100644
--- a/src/cgeo/geocaching/mapcommon/cgeomap.java
+++ b/src/cgeo/geocaching/mapcommon/cgeomap.java
@@ -32,7 +32,6 @@ import cgeo.geocaching.cgSettings.mapSourceEnum;
import cgeo.geocaching.cgUpdateDir;
import cgeo.geocaching.cgUpdateLoc;
import cgeo.geocaching.cgUser;
-import cgeo.geocaching.cgWarning;
import cgeo.geocaching.cgWaypoint;
import cgeo.geocaching.cgeoapplication;
import cgeo.geocaching.activity.ActivityMixin;
@@ -65,7 +64,6 @@ public class cgeomap extends MapBase {
private MapControllerImpl mapController = null;
private cgSettings settings = null;
private cgBase base = null;
- private cgWarning warning = null;
private cgeoapplication app = null;
private SharedPreferences.Editor prefsEdit = null;
private cgGeo geo = null;
@@ -202,10 +200,10 @@ public class cgeomap extends MapBase {
}
if (geo == null) {
- geo = app.startGeo(activity, geoUpdate, base, settings, warning, 0, 0);
+ geo = app.startGeo(activity, geoUpdate, base, settings, 0, 0);
}
if (settings.useCompass == 1 && dir == null) {
- dir = app.startDir(activity, dirUpdate, warning);
+ dir = app.startDir(activity, dirUpdate);
}
}
}
@@ -215,7 +213,7 @@ public class cgeomap extends MapBase {
@Override
public void handleMessage(Message msg) {
if (!noMapTokenShowed) {
- warning.showToast(res.getString(R.string.map_token_err));
+ ActivityMixin.showToast(activity, res.getString(R.string.map_token_err));
noMapTokenShowed = true;
}
@@ -237,7 +235,6 @@ public class cgeomap extends MapBase {
app.setAction(null);
settings = new cgSettings(activity, activity.getSharedPreferences(cgSettings.preferences, 0));
base = new cgBase(app, settings, activity.getSharedPreferences(cgSettings.preferences, 0));
- warning = new cgWarning(activity);
prefsEdit = activity.getSharedPreferences(cgSettings.preferences, 0).edit();
MapFactory mapFactory = settings.getMapFactory();
@@ -253,10 +250,10 @@ public class cgeomap extends MapBase {
ActivityMixin.setTitle(activity, res.getString(R.string.map_map));
if (geo == null) {
- geo = app.startGeo(activity, geoUpdate, base, settings, warning, 0, 0);
+ geo = app.startGeo(activity, geoUpdate, base, settings, 0, 0);
}
if (settings.useCompass == 1 && dir == null) {
- dir = app.startDir(activity, dirUpdate, warning);
+ dir = app.startDir(activity, dirUpdate);
}
// initialize map
@@ -355,10 +352,10 @@ public class cgeomap extends MapBase {
app.setAction(null);
if (geo == null) {
- geo = app.startGeo(activity, geoUpdate, base, settings, warning, 0, 0);
+ geo = app.startGeo(activity, geoUpdate, base, settings, 0, 0);
}
if (settings.useCompass == 1 && dir == null) {
- dir = app.startDir(activity, dirUpdate, warning);
+ dir = app.startDir(activity, dirUpdate);
}
if (geo != null) {
@@ -572,7 +569,7 @@ public class cgeomap extends MapBase {
for (cgCache oneCache : cachesProtected) {
if (oneCache != null && oneCache.latitude != null && oneCache.longitude != null) {
- if (base.isCacheInViewPort(mapCenterLat, mapCenterLon, mapSpanLat, mapSpanLon, oneCache.latitude, oneCache.longitude) && app.isOffline(oneCache.geocode, null) == false) {
+ if (cgBase.isCacheInViewPort(mapCenterLat, mapCenterLon, mapSpanLat, mapSpanLon, oneCache.latitude, oneCache.longitude) && app.isOffline(oneCache.geocode, null) == false) {
geocodes.add(oneCache.geocode);
}
}
@@ -585,7 +582,7 @@ public class cgeomap extends MapBase {
detailTotal = geocodes.size();
if (detailTotal == 0) {
- warning.showToast(res.getString(R.string.warn_save_nothing));
+ ActivityMixin.showToast(activity, res.getString(R.string.warn_save_nothing));
return true;
}
@@ -603,10 +600,10 @@ public class cgeomap extends MapBase {
}
if (geo == null) {
- geo = app.startGeo(activity, geoUpdate, base, settings, warning, 0, 0);
+ geo = app.startGeo(activity, geoUpdate, base, settings, 0, 0);
}
if (settings.useCompass == 1 && dir == null) {
- dir = app.startDir(activity, dirUpdate, warning);
+ dir = app.startDir(activity, dirUpdate);
}
} catch (Exception e) {
Log.e(cgSettings.tag, "cgeocaches.onPrepareOptionsMenu.onCancel: " + e.toString());
@@ -878,7 +875,7 @@ public class cgeomap extends MapBase {
} else if (((Math.abs(spanLatitudeNow - spanLatitude) > 50) || (Math.abs(spanLongitudeNow - spanLongitude) > 50) || // changed zoom
(Math.abs(centerLatitudeNow - centerLatitude) > (spanLatitudeNow / 4)) || (Math.abs(centerLongitudeNow - centerLongitude) > (spanLongitudeNow / 4)) // map moved
) && (cachesCnt <= 0 || caches == null || caches.isEmpty()
- || !base.isInViewPort(centerLatitude, centerLongitude, centerLatitudeNow, centerLongitudeNow, spanLatitude, spanLongitude, spanLatitudeNow, spanLongitudeNow))) {
+ || !cgBase.isInViewPort(centerLatitude, centerLongitude, centerLatitudeNow, centerLongitudeNow, spanLatitude, spanLongitude, spanLatitudeNow, spanLongitudeNow))) {
moved = true;
}
@@ -993,7 +990,7 @@ public class cgeomap extends MapBase {
moved = true;
} else if (((Math.abs(spanLatitudeNow - spanLatitudeUsers) > 50) || (Math.abs(spanLongitudeNow - spanLongitudeUsers) > 50) || // changed zoom
(Math.abs(centerLatitudeNow - centerLatitudeUsers) > (spanLatitudeNow / 4)) || (Math.abs(centerLongitudeNow - centerLongitudeUsers) > (spanLongitudeNow / 4)) // map moved
- ) && !base.isInViewPort(centerLatitudeUsers, centerLongitudeUsers, centerLatitudeNow, centerLongitudeNow, spanLatitudeUsers, spanLongitudeUsers, spanLatitudeNow, spanLongitudeNow)) {
+ ) && !cgBase.isInViewPort(centerLatitudeUsers, centerLongitudeUsers, centerLatitudeNow, centerLongitudeNow, spanLatitudeUsers, spanLongitudeUsers, spanLatitudeNow, spanLongitudeNow)) {
moved = true;
}