aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/maps/CachesOverlay.java
diff options
context:
space:
mode:
authorblafoo <github@blafoo.de>2011-11-18 17:50:16 +0100
committerblafoo <github@blafoo.de>2011-11-18 20:21:28 +0100
commit4226ec4247f122a875539c55fcb147a81bce5780 (patch)
treecaa0fab902e3ef981a32697f4fdfa721fcc4dd95 /main/src/cgeo/geocaching/maps/CachesOverlay.java
parente4fb6c596ba35e3ed6c7d2341ffb5e006417ec4e (diff)
downloadcgeo-4226ec4247f122a875539c55fcb147a81bce5780.zip
cgeo-4226ec4247f122a875539c55fcb147a81bce5780.tar.gz
cgeo-4226ec4247f122a875539c55fcb147a81bce5780.tar.bz2
Use of CacheType instead of String
Diffstat (limited to 'main/src/cgeo/geocaching/maps/CachesOverlay.java')
-rw-r--r--main/src/cgeo/geocaching/maps/CachesOverlay.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/main/src/cgeo/geocaching/maps/CachesOverlay.java b/main/src/cgeo/geocaching/maps/CachesOverlay.java
index 52800b9..240afa4 100644
--- a/main/src/cgeo/geocaching/maps/CachesOverlay.java
+++ b/main/src/cgeo/geocaching/maps/CachesOverlay.java
@@ -212,14 +212,14 @@ public class CachesOverlay extends AbstractItemizedOverlay {
cgCoord coordinate = item.getCoord();
- if (StringUtils.isNotBlank(coordinate.getType()) && coordinate.getType().equalsIgnoreCase("cache") && StringUtils.isNotBlank(coordinate.getGeocode())) {
+ if (StringUtils.isNotBlank(coordinate.getCoordType()) && coordinate.getCoordType().equalsIgnoreCase("cache") && StringUtils.isNotBlank(coordinate.getGeocode())) {
Intent popupIntent = new Intent(context, cgeopopup.class);
popupIntent.putExtra("fromdetail", fromDetail);
popupIntent.putExtra("geocode", coordinate.getGeocode());
context.startActivity(popupIntent);
- } else if (coordinate.getType() != null && coordinate.getType().equalsIgnoreCase("waypoint") && coordinate.getId() != null && coordinate.getId() > 0) {
+ } else if (coordinate.getCoordType() != null && coordinate.getCoordType().equalsIgnoreCase("waypoint") && coordinate.getId() != null && coordinate.getId() > 0) {
Intent popupIntent = new Intent(context, cgeowaypoint.class);
popupIntent.putExtra("waypoint", coordinate.getId());
@@ -275,15 +275,11 @@ public class CachesOverlay extends AbstractItemizedOverlay {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
dialog.setCancelable(true);
- if (coordinate.getType().equalsIgnoreCase("cache")) {
+ if (coordinate.getCoordType().equalsIgnoreCase("cache")) {
dialog.setTitle("cache");
- String cacheType;
- if (cgBase.cacheTypesInv.containsKey(coordinate.getTypeSpec())) {
- cacheType = cgBase.cacheTypesInv.get(CacheType.getById(coordinate.getTypeSpec()));
- } else {
- cacheType = cgBase.cacheTypesInv.get(CacheType.MYSTERY);
- }
+ CacheType ct = CacheType.getById(coordinate.getTypeSpec());
+ String cacheType = CacheType.UNKNOWN != ct ? ct.getL10n() : CacheType.MYSTERY.getL10n();
dialog.setMessage(Html.fromHtml(item.getTitle()) + "\n\ngeocode: " + coordinate.getGeocode().toUpperCase() + "\ntype: " + cacheType);
if (fromDetail) {