aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/cgBase.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/cgBase.java')
-rw-r--r--main/src/cgeo/geocaching/cgBase.java121
1 files changed, 2 insertions, 119 deletions
diff --git a/main/src/cgeo/geocaching/cgBase.java b/main/src/cgeo/geocaching/cgBase.java
index 69a35fe..a1c681e 100644
--- a/main/src/cgeo/geocaching/cgBase.java
+++ b/main/src/cgeo/geocaching/cgBase.java
@@ -135,8 +135,6 @@ public class cgBase {
private static Context context;
private static Resources res;
- final private static Map<String, Integer> gcIcons = new HashMap<String, Integer>();
-
private static final int NB_DOWNLOAD_RETRIES = 4;
public static final int UPDATE_LOAD_PROGRESS_DETAIL = 42186;
@@ -715,7 +713,7 @@ public class cgBase {
final JSONObject extra = dataJSON.getJSONObject("cs");
if (extra != null && extra.length() > 0) {
int count = extra.getInt("count");
- // unused, meaning not clearn boolean li = extra.getBoolean("li");
+ // unused, meaning not clear boolean li = extra.getBoolean("li");
// expected meaning pm=premium member
boolean pm = extra.getBoolean("pm");
if (Settings.isPremiumMember() && !pm) {
@@ -1093,6 +1091,7 @@ public class cgBase {
final cgWaypoint waypoint = new cgWaypoint(res.getString(R.string.cache_coordinates_original), WaypointType.WAYPOINT);
waypoint.setCoords(new Geopoint(originalCoords));
cache.addWaypoint(waypoint);
+ cache.setUserModifiedCoords(true);
}
} catch (Geopoint.GeopointException e) {
}
@@ -2869,122 +2868,6 @@ public class cgBase {
return out;
}
- public static int getCacheIcon(final CacheType cacheType) {
- final String type = cacheType.id;
- fillIconsMap();
- Integer iconId = gcIcons.get("type_" + type);
- if (iconId != null) {
- return iconId;
- }
- // fallback to traditional if some icon type is not correct
- return gcIcons.get("type_traditional");
- }
-
- public static int getCacheMarkerIcon(final CacheType cacheType, final boolean own, final boolean found, final boolean disabled) {
- fillIconsMap();
-
- int icon = -1;
- String iconTxt = null;
-
- final String type = cacheType != null ? cacheType.id : null;
-
- if (StringUtils.isNotBlank(type)) {
- if (own) {
- iconTxt = type + "-own";
- } else if (found) {
- iconTxt = type + "-found";
- } else if (disabled) {
- iconTxt = type + "-disabled";
- } else {
- iconTxt = type;
- }
- } else {
- iconTxt = CacheType.TRADITIONAL.id;
- }
-
- if (gcIcons.containsKey(iconTxt)) {
- icon = gcIcons.get(iconTxt);
- } else {
- icon = gcIcons.get(CacheType.TRADITIONAL.id);
- }
-
- return icon;
- }
-
- private static void fillIconsMap() {
- if (gcIcons.isEmpty()) {
- gcIcons.put("type_ape", R.drawable.type_ape);
- gcIcons.put("type_cito", R.drawable.type_cito);
- gcIcons.put("type_earth", R.drawable.type_earth);
- gcIcons.put("type_event", R.drawable.type_event);
- gcIcons.put("type_letterbox", R.drawable.type_letterbox);
- gcIcons.put("type_mega", R.drawable.type_mega);
- gcIcons.put("type_multi", R.drawable.type_multi);
- gcIcons.put("type_traditional", R.drawable.type_traditional);
- gcIcons.put("type_virtual", R.drawable.type_virtual);
- gcIcons.put("type_webcam", R.drawable.type_webcam);
- gcIcons.put("type_wherigo", R.drawable.type_wherigo);
- gcIcons.put("type_mystery", R.drawable.type_mystery);
- gcIcons.put("type_gchq", R.drawable.type_hq);
- // default markers
- gcIcons.put(CacheType.PROJECT_APE.id, R.drawable.marker_cache_ape);
- gcIcons.put(CacheType.CITO.id, R.drawable.marker_cache_cito);
- gcIcons.put(CacheType.EARTH.id, R.drawable.marker_cache_earth);
- gcIcons.put(CacheType.EVENT.id, R.drawable.marker_cache_event);
- gcIcons.put(CacheType.LETTERBOX.id, R.drawable.marker_cache_letterbox);
- gcIcons.put(CacheType.MEGA_EVENT.id, R.drawable.marker_cache_mega);
- gcIcons.put(CacheType.MULTI.id, R.drawable.marker_cache_multi);
- gcIcons.put(CacheType.TRADITIONAL.id, R.drawable.marker_cache_traditional);
- gcIcons.put(CacheType.VIRTUAL.id, R.drawable.marker_cache_virtual);
- gcIcons.put(CacheType.WEBCAM.id, R.drawable.marker_cache_webcam);
- gcIcons.put(CacheType.WHERIGO.id, R.drawable.marker_cache_wherigo);
- gcIcons.put(CacheType.MYSTERY.id, R.drawable.marker_cache_mystery);
- gcIcons.put(CacheType.GCHQ.id, R.drawable.marker_cache_gchq);
- // own cache markers
- gcIcons.put("ape-own", R.drawable.marker_cache_ape_own);
- gcIcons.put("cito-own", R.drawable.marker_cache_cito_own);
- gcIcons.put("earth-own", R.drawable.marker_cache_earth_own);
- gcIcons.put("event-own", R.drawable.marker_cache_event_own);
- gcIcons.put("letterbox-own", R.drawable.marker_cache_letterbox_own);
- gcIcons.put("mega-own", R.drawable.marker_cache_mega_own);
- gcIcons.put("multi-own", R.drawable.marker_cache_multi_own);
- gcIcons.put("traditional-own", R.drawable.marker_cache_traditional_own);
- gcIcons.put("virtual-own", R.drawable.marker_cache_virtual_own);
- gcIcons.put("webcam-own", R.drawable.marker_cache_webcam_own);
- gcIcons.put("wherigo-own", R.drawable.marker_cache_wherigo_own);
- gcIcons.put("mystery-own", R.drawable.marker_cache_mystery_own);
- gcIcons.put("gchq-own", R.drawable.marker_cache_gchq_own);
- // found cache markers
- gcIcons.put("ape-found", R.drawable.marker_cache_ape_found);
- gcIcons.put("cito-found", R.drawable.marker_cache_cito_found);
- gcIcons.put("earth-found", R.drawable.marker_cache_earth_found);
- gcIcons.put("event-found", R.drawable.marker_cache_event_found);
- gcIcons.put("letterbox-found", R.drawable.marker_cache_letterbox_found);
- gcIcons.put("mega-found", R.drawable.marker_cache_mega_found);
- gcIcons.put("multi-found", R.drawable.marker_cache_multi_found);
- gcIcons.put("traditional-found", R.drawable.marker_cache_traditional_found);
- gcIcons.put("virtual-found", R.drawable.marker_cache_virtual_found);
- gcIcons.put("webcam-found", R.drawable.marker_cache_webcam_found);
- gcIcons.put("wherigo-found", R.drawable.marker_cache_wherigo_found);
- gcIcons.put("mystery-found", R.drawable.marker_cache_mystery_found);
- gcIcons.put("gchq-found", R.drawable.marker_cache_gchq_found);
- // disabled cache markers
- gcIcons.put("ape-disabled", R.drawable.marker_cache_ape_disabled);
- gcIcons.put("cito-disabled", R.drawable.marker_cache_cito_disabled);
- gcIcons.put("earth-disabled", R.drawable.marker_cache_earth_disabled);
- gcIcons.put("event-disabled", R.drawable.marker_cache_event_disabled);
- gcIcons.put("letterbox-disabled", R.drawable.marker_cache_letterbox_disabled);
- gcIcons.put("mega-disabled", R.drawable.marker_cache_mega_disabled);
- gcIcons.put("multi-disabled", R.drawable.marker_cache_multi_disabled);
- gcIcons.put("traditional-disabled", R.drawable.marker_cache_traditional_disabled);
- gcIcons.put("virtual-disabled", R.drawable.marker_cache_virtual_disabled);
- gcIcons.put("webcam-disabled", R.drawable.marker_cache_webcam_disabled);
- gcIcons.put("wherigo-disabled", R.drawable.marker_cache_wherigo_disabled);
- gcIcons.put("mystery-disabled", R.drawable.marker_cache_mystery_disabled);
- gcIcons.put("gchq-disabled", R.drawable.marker_cache_gchq_disabled);
- }
- }
-
public static boolean runNavigation(Activity activity, Resources res, Settings settings, final Geopoint coords) {
return runNavigation(activity, res, settings, coords, null);
}