diff options
24 files changed, 135 insertions, 84 deletions
diff --git a/main/AndroidManifest.xml b/main/AndroidManifest.xml index b78e26e..17fed31 100644 --- a/main/AndroidManifest.xml +++ b/main/AndroidManifest.xml @@ -44,7 +44,7 @@ </activity> <activity android:name=".SearchActivity" - android:label="@string/search" + android:label="@string/app_name" android:launchMode="singleTop" android:windowSoftInputMode="stateHidden" android:configChanges="keyboardHidden|orientation" > @@ -106,7 +106,7 @@ </activity> <activity android:name=".cgeocaches" - android:label="@string/stored_caches_button" + android:label="@string/app_name" android:configChanges="keyboardHidden|orientation|screenSize" > <intent-filter> <action android:name="android.intent.action.VIEW" /> @@ -155,7 +155,7 @@ </activity> <activity android:name=".CacheDetailActivity" - android:label="@string/cache" + android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" > <intent-filter> <action android:name="wikitudeapi.arcallback" /> @@ -182,7 +182,7 @@ </activity> <activity android:name="cgeo.geocaching.TrackableActivity" - android:label="@string/trackable" + android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" > <intent-filter> <action android:name="android.intent.action.VIEW" /> diff --git a/main/res/values-de/strings.xml b/main/res/values-de/strings.xml index 954f1c1..1a5b84f 100644 --- a/main/res/values-de/strings.xml +++ b/main/res/values-de/strings.xml @@ -1057,15 +1057,18 @@ <string name="status_geocaching_change" tools:ignore="UnusedResources">Änderungen auf geocaching.com führen zu Problemen mit c:geo.\nWir arbeiten daran.</string> <string name="status_geocaching_livemap" tools:ignore="UnusedResources">Änderungen auf geocaching.com führen zu Problemen mit der Live Map.\nWir arbeiten daran.</string> - <string name="clipboard_copy_ok">In Zwischenablage kopiert</string> - <plurals name="days_ago"> - <item quantity="one">gestern</item> - <item quantity="other">vor %d Tagen</item> - </plurals> + <!-- text-to-speech for compass view --> <string name="tts_service">Sprechender Kompass</string> <string name="tts_start">Starte Sprache</string> <string name="tts_stop">Stoppe Sprache</string> <string name="tts_kilometers">%s Kilometer</string> <string name="tts_meters">%s Meter</string> <string name="tts_oclock">%s Uhr</string> + + <!-- various --> + <string name="clipboard_copy_ok">In Zwischenablage kopiert</string> + <plurals name="days_ago"> + <item quantity="one">gestern</item> + <item quantity="other">vor %d Tagen</item> + </plurals> </resources> diff --git a/main/res/values-fr/strings.xml b/main/res/values-fr/strings.xml index 6fe4960..23af86a 100644 --- a/main/res/values-fr/strings.xml +++ b/main/res/values-fr/strings.xml @@ -34,6 +34,7 @@ <string name="ape">Project ape cache</string> <string name="gchq">Groundspeak hq</string> <string name="gps">GPS cache exhibit</string> + <string name="block">Fête locale Groundspeak</string> <string name="unknown">Type inconnu</string> <!-- cache sizes --> @@ -126,6 +127,14 @@ <string name="log_image_camera">Nouvelle</string> <string name="log_image_caption">Légende</string> <string name="log_image_description">Description</string> + <string name="log_image_scale">Mise à l\'échelle</string> + <string-array name="log_image_scales"> + <item>Taille originale</item> + <item>512 px</item> + <item>640 px</item> + <item>800 px</item> + <item>1024 px</item> + </string-array> <!-- translation --> <string name="translate_to_sys_lang">Traduire en %s</string> @@ -516,6 +525,8 @@ <string name="cache_log_image_default_title">Photo</string> <string name="cache_personal_note">Note personnelle</string> <string name="cache_personal_note_edit">Éditer</string> + <string name="cache_personal_note_unstored">Cache non sauvegardée localement</string> + <string name="cache_personal_note_store">La cache va être sauvegardée localement avant d\'autoriser les notes personnelles.</string> <string name="cache_description">Description</string> <string name="cache_description_long">Description longue</string> <string name="cache_description_table_note">La description contient des informations de formattages qui nécessitent possiblement d\'être vues sur le site %s pour être affichées correctement.</string> @@ -596,6 +607,8 @@ <string name="cache_status_disabled">Désactivée</string> <string name="cache_status_premium">Membres privilégiés seulement</string> <string name="cache_status_not_premium">Pour tous les membres</string> + <string name="cache_status_stored">Stockée</string> + <string name="cache_status_not_stored">Non stockée</string> <string name="cache_geocode">Code gc</string> <string name="cache_name">Nom</string> <string name="cache_type">Type</string> @@ -993,6 +1006,8 @@ <string name="attribute_swamp_no">Pas de marais</string> <string name="attribute_hills_yes">Endroit vallonné</string> <string name="attribute_hills_no">Pas d\'endroit vallonné</string> + <string name="attribute_easy_climbing_yes">Escalade facile</string> + <string name="attribute_easy_climbing_no">Pas d\'escalade facile</string> <string name="attribute_poi_yes">Point d\'intérêt</string> <string name="attribute_poi_no">Pas de point d\'intérêt</string> <string name="attribute_moving_target_yes">Cible mouvante</string> @@ -1048,6 +1063,7 @@ <string name="facebook">facebook: <a href="">page c:geo</a></string> <string name="twitter">twitter: <a href="">@android_GC</a></string> <string name="nutshellmanual">Manuel: <a href="">c:geo en bref</a></string> + <string name="market">Android: <a href="">c:geo sur Google Play</a></string> <string name="about_twitter">Voulez-vous publier un nouveau statut sur Twitter à chaque nouvelle cache découverte sous <b>c:geo</b>?</string> <string name="about_auth_1">Le processus suivant permet à <b>c:geo</b> d\'accéder à votre compte Twitter - si vous acceptez.</string> <string name="about_auth_2">Cliquer sur le bouton \"début d\'autorisation\" pour démarrer. Une fenêtre de navigateur va s\'ouvrir pour vous connecter sur Twitter. Accepter pour que <b>c:geo</b> accéde à votre compte. Twitter vous affichera alors une code PIN composé de chiffres. Merci de coller ce code dans <b>c:geo</b> puis confirmer. C\'est tout!</string> @@ -1059,15 +1075,20 @@ <string name="status_geocaching_change" tools:ignore="UnusedResources">Des changements récents sur Geocaching.com ont cassé c:geo.\nNous sommes en train de nous en occuper.</string> <string name="status_geocaching_livemap" tools:ignore="UnusedResources">Des changements récents sur Geocaching.com ont cassé la carte active.\nNous sommes en train de nous en occuper.</string> - <string name="clipboard_copy_ok">Copié dans le presse-papiers</string> - <plurals name="days_ago"> - <item quantity="one">hier</item> - <item quantity="other">il y a %d jours</item> - </plurals> + <!-- text-to-speech for compass view --> <string name="tts_service">Boussole parlante</string> <string name="tts_start">Commencer à parler</string> <string name="tts_stop">Arrêter de parler</string> <string name="tts_kilometers">%s kilomètres</string> <string name="tts_meters">%s mètres</string> + <string name="tts_miles">%s milles</string> + <string name="tts_feet">%s pieds</string> <string name="tts_oclock">%s heures</string> + + <!-- various --> + <string name="clipboard_copy_ok">Copié dans le presse-papiers</string> + <plurals name="days_ago"> + <item quantity="one">hier</item> + <item quantity="other">il y a %d jours</item> + </plurals> </resources> diff --git a/main/res/values-it/strings.xml b/main/res/values-it/strings.xml index 89dd5a7..8cd5ee7 100644 --- a/main/res/values-it/strings.xml +++ b/main/res/values-it/strings.xml @@ -500,12 +500,6 @@ <item quantity="one">Un cache</item> <item quantity="other">%1$d Cache</item> </plurals> - <string name="tts_service">Bussola parlante</string> - <string name="tts_start">Start voce</string> - <string name="tts_stop">Stop voce</string> - <string name="tts_kilometers">%s chilometri</string> - <string name="tts_meters">%s metri</string> - <string name="tts_oclock">%s precisi</string> <string name="cache_offline">Offline</string> <string name="cache_offline_refresh">Aggiorna</string> <string name="cache_offline_drop">Elimina</string> @@ -1070,6 +1064,15 @@ <string name="status_geocaching_change" tools:ignore="UnusedResources">Modifiche recenti al sito geocaching hanno disattivato c:geo.\nCi stiamo lavorando, riprova più tardi.</string> <string name="status_geocaching_livemap" tools:ignore="UnusedResources">Modifiche recenti al sito geocaching hanno disattivato la mappa live.\nCi stiamo lavorando, riprova più tardi.</string> + <!-- text-to-speech for compass view --> + <string name="tts_service">Bussola parlante</string> + <string name="tts_start">Start voce</string> + <string name="tts_stop">Stop voce</string> + <string name="tts_kilometers">%s chilometri</string> + <string name="tts_meters">%s metri</string> + <string name="tts_oclock">%s precisi</string> + + <!-- various --> <string name="clipboard_copy_ok">Copiato nella clipboard</string> <plurals name="days_ago"> <item quantity="one">ieri</item> diff --git a/main/res/values-sv/strings.xml b/main/res/values-sv/strings.xml index 79907cc..4085f53 100644 --- a/main/res/values-sv/strings.xml +++ b/main/res/values-sv/strings.xml @@ -874,15 +874,18 @@ <string name="status_geocaching_change" tools:ignore="UnusedResources">Ändringar som gjorts på geocaching.com har gjort så att c:geo inte fungerar.\nVi jobbar för att lösa problemen, försök igen om en stund.</string> <string name="status_geocaching_livemap" tools:ignore="UnusedResources">Ändringar som gjorts på geocaching.com har gjort så att Live kartan inte fungerar.\nVi jobbar för att lösa problemen, försök igen om en stund.</string> - <string name="clipboard_copy_ok">Kopierat till urklipp.</string> - <plurals name="days_ago"> - <item quantity="one">igår</item> - <item quantity="other">%d dagar sedan</item> - </plurals> + <!-- text-to-speech for compass view --> <string name="tts_service">Talande kompass</string> <string name="tts_start">Starta tal</string> <string name="tts_stop">Stoppa tal</string> <string name="tts_kilometers">%s kilometer</string> <string name="tts_meters">%s meter</string> <string name="tts_oclock">Klockan %s</string> + + <!-- various --> + <string name="clipboard_copy_ok">Kopierat till urklipp.</string> + <plurals name="days_ago"> + <item quantity="one">igår</item> + <item quantity="other">%d dagar sedan</item> + </plurals> </resources> diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml index 54038d0..dd0f937 100644 --- a/main/res/values/strings.xml +++ b/main/res/values/strings.xml @@ -1075,11 +1075,7 @@ <string name="status_geocaching_change" tools:ignore="UnusedResources">Recent changes on geocaching.com broke c:geo.\nWe are working on it, check again soon.</string> <string name="status_geocaching_livemap" tools:ignore="UnusedResources">Recent changes on geocaching.com broke the live map feature.\nWe are working on it, check again soon.</string> - <string name="clipboard_copy_ok">Copied to clipboard</string> - <plurals name="days_ago"> - <item quantity="one">yesterday</item> - <item quantity="other">%d days ago</item> - </plurals> + <!-- text-to-speech for compass view --> <string name="tts_service">Talking compass</string> <string name="tts_start">Start talking</string> <string name="tts_stop">Stop talking</string> @@ -1088,4 +1084,11 @@ <string name="tts_miles">%s miles</string> <string name="tts_feet">%s feet</string> <string name="tts_oclock">%s o\'clock</string> + + <!-- various --> + <string name="clipboard_copy_ok">Copied to clipboard</string> + <plurals name="days_ago"> + <item quantity="one">yesterday</item> + <item quantity="other">%d days ago</item> + </plurals> </resources> diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java index 11c4b4f..273aa8c 100644 --- a/main/src/cgeo/geocaching/CacheDetailActivity.java +++ b/main/src/cgeo/geocaching/CacheDetailActivity.java @@ -198,6 +198,9 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState, R.layout.cacheview); + // set title in code, as the activity needs a hard coded title due to the intent filters + setTitle(res.getString(R.string.cache)); + String geocode = null; // TODO Why can it happen that search is not null? onCreate should be called only once and it is not set before. @@ -664,6 +667,8 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc } ((TextView) findViewById(R.id.actionbar_title)).setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(cache.getType().markerId), null, null, null); + // reset imagesList so Images view page will be redrawn + imagesList = null; reinitializeViewPager(); // rendering done! remove progress popup if any there diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index 2c9ba32..5286d1c 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -194,15 +194,19 @@ public class Geocache implements ICache, IWaypoint { cacheType = other.cacheType; zoomlevel = other.zoomlevel; // boolean values must be enumerated here. Other types are assigned outside this if-statement + // TODO: check whether a search or a live map systematically returns those, in which case + // we want to keep the most recent one instead of getting information from the previously + // stored data. This is the case for "archived" for example which has been taken out of this + // list. premiumMembersOnly = other.premiumMembersOnly; reliableLatLon = other.reliableLatLon; - archived = other.archived; found = other.found; disabled = other.disabled; favorite = other.favorite; onWatchlist = other.onWatchlist; logOffline = other.logOffline; finalDefined = other.finalDefined; + // archived is kept from the most recent data } /* @@ -829,8 +833,7 @@ public class Geocache implements ICache, IWaypoint { } public boolean isVirtual() { - return CacheType.VIRTUAL == cacheType || CacheType.WEBCAM == cacheType - || CacheType.EARTH == cacheType; + return cacheType.isVirtual(); } public boolean showSize() { diff --git a/main/src/cgeo/geocaching/SearchActivity.java b/main/src/cgeo/geocaching/SearchActivity.java index 73459e5..cfd6ea9 100644 --- a/main/src/cgeo/geocaching/SearchActivity.java +++ b/main/src/cgeo/geocaching/SearchActivity.java @@ -60,6 +60,9 @@ public class SearchActivity extends AbstractActivity { setTheme(); setContentView(R.layout.search); + // set title in code, as the activity needs a hard coded title due to the intent filters + setTitle(res.getString(R.string.search)); + init(); } diff --git a/main/src/cgeo/geocaching/TrackableActivity.java b/main/src/cgeo/geocaching/TrackableActivity.java index 9b6f491..55d693e 100644 --- a/main/src/cgeo/geocaching/TrackableActivity.java +++ b/main/src/cgeo/geocaching/TrackableActivity.java @@ -110,6 +110,9 @@ public class TrackableActivity extends AbstractViewPagerActivity<TrackableActivi public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState, R.layout.trackable_activity); + // set title in code, as the activity needs a hard coded title due to the intent filters + setTitle(res.getString(R.string.trackable)); + // get parameters Bundle extras = getIntent().getExtras(); Uri uri = getIntent().getData(); diff --git a/main/src/cgeo/geocaching/Waypoint.java b/main/src/cgeo/geocaching/Waypoint.java index 6112986..e39d26a 100644 --- a/main/src/cgeo/geocaching/Waypoint.java +++ b/main/src/cgeo/geocaching/Waypoint.java @@ -278,4 +278,5 @@ public class Waypoint implements IWaypoint, Comparable<Waypoint> { hash ^= waypointType.markerId; return (int) hash; } + } diff --git a/main/src/cgeo/geocaching/enumerations/CacheType.java b/main/src/cgeo/geocaching/enumerations/CacheType.java index fc8a867..8dbadfd 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheType.java +++ b/main/src/cgeo/geocaching/enumerations/CacheType.java @@ -113,4 +113,12 @@ public enum CacheType { } return cache.getType() == this; } + + public boolean applyDistanceRule() { + return !isVirtual() && !isEvent(); + } + + public boolean isVirtual() { + return VIRTUAL == this || WEBCAM == this || EARTH == this; + } } diff --git a/main/src/cgeo/geocaching/enumerations/WaypointType.java b/main/src/cgeo/geocaching/enumerations/WaypointType.java index 748c432..79c8106 100644 --- a/main/src/cgeo/geocaching/enumerations/WaypointType.java +++ b/main/src/cgeo/geocaching/enumerations/WaypointType.java @@ -72,4 +72,8 @@ public enum WaypointType { public final String toString() { return getL10n(); } + + public boolean applyDistanceRule() { + return (this == FINAL || this == STAGE); + } } diff --git a/main/src/cgeo/geocaching/export/GpxExport.java b/main/src/cgeo/geocaching/export/GpxExport.java index c17448f..66345da 100644 --- a/main/src/cgeo/geocaching/export/GpxExport.java +++ b/main/src/cgeo/geocaching/export/GpxExport.java @@ -326,7 +326,8 @@ class GpxExport extends AbstractExport { "type", log.type.type); gpx.startTag(PREFIX_GROUNDSPEAK, "finder"); - gpx.attribute("", "id", log.author); + gpx.attribute("", "id", ""); + gpx.text(log.author); gpx.endTag(PREFIX_GROUNDSPEAK, "finder"); gpx.startTag(PREFIX_GROUNDSPEAK, "text"); diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 89d1cdc..0af0e6c 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -1606,7 +1606,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto } private CachesOverlayItemImpl getCacheItem(final Geocache cache) { - final CachesOverlayItemImpl item = mapItemFactory.getCachesOverlayItem(cache, cache.getType()); + final CachesOverlayItemImpl item = mapItemFactory.getCachesOverlayItem(cache, cache.getType().applyDistanceRule()); final int hashcode = new HashCodeBuilder() .append(cache.isReliableLatLon()) @@ -1686,7 +1686,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto } private CachesOverlayItemImpl getWaypointItem(final Waypoint waypoint) { - final CachesOverlayItemImpl item = mapItemFactory.getCachesOverlayItem(waypoint, null); + final CachesOverlayItemImpl item = mapItemFactory.getCachesOverlayItem(waypoint, waypoint.getWaypointType().applyDistanceRule()); Drawable marker = getResources().getDrawable(!waypoint.isVisited() ? R.drawable.marker : R.drawable.marker_transparent); final Drawable[] layers = new Drawable[] { marker, diff --git a/main/src/cgeo/geocaching/maps/CachesOverlay.java b/main/src/cgeo/geocaching/maps/CachesOverlay.java index 9bb4cef..74c92eb 100644 --- a/main/src/cgeo/geocaching/maps/CachesOverlay.java +++ b/main/src/cgeo/geocaching/maps/CachesOverlay.java @@ -1,11 +1,11 @@ package cgeo.geocaching.maps; import cgeo.geocaching.CachePopup; +import cgeo.geocaching.Geocache; import cgeo.geocaching.IWaypoint; import cgeo.geocaching.R; import cgeo.geocaching.Settings; import cgeo.geocaching.WaypointPopup; -import cgeo.geocaching.Geocache; import cgeo.geocaching.cgData; import cgeo.geocaching.activity.Progress; import cgeo.geocaching.connector.gc.GCMap; @@ -58,14 +58,14 @@ public class CachesOverlay extends AbstractItemizedOverlay { mapItemFactory = mapProvider.getMapItemFactory(); } - public void updateItems(CachesOverlayItemImpl item) { + void updateItems(CachesOverlayItemImpl item) { List<CachesOverlayItemImpl> itemsPre = new ArrayList<CachesOverlayItemImpl>(); itemsPre.add(item); updateItems(itemsPre); } - public void updateItems(List<CachesOverlayItemImpl> itemsPre) { + void updateItems(List<CachesOverlayItemImpl> itemsPre) { if (itemsPre == null) { return; } @@ -86,11 +86,11 @@ public class CachesOverlay extends AbstractItemizedOverlay { } } - public boolean getCircles() { + boolean getCircles() { return displayCircles; } - public void switchCircles() { + void switchCircles() { displayCircles = !displayCircles; } @@ -130,12 +130,7 @@ public class CachesOverlay extends AbstractItemizedOverlay { final GeoPointImpl itemGeo = mapItemFactory.getGeoPointBase(itemCoord); projection.toPixels(itemGeo, center); - final CacheType type = item.getType(); - if (type == null || type == CacheType.MULTI || type == CacheType.MYSTERY || type == CacheType.VIRTUAL || type.isEvent()) { - blockedCircle.setColor(0x66000000); - blockedCircle.setStyle(Style.STROKE); - canvas.drawCircle(center.x, center.y, radius, blockedCircle); - } else { + if (item.applyDistanceRule()) { blockedCircle.setColor(0x66BB0000); blockedCircle.setStyle(Style.STROKE); canvas.drawCircle(center.x, center.y, radius, blockedCircle); @@ -143,6 +138,10 @@ public class CachesOverlay extends AbstractItemizedOverlay { blockedCircle.setColor(0x44BB0000); blockedCircle.setStyle(Style.FILL); canvas.drawCircle(center.x, center.y, radius, blockedCircle); + } else { + blockedCircle.setColor(0x66000000); + blockedCircle.setStyle(Style.STROKE); + canvas.drawCircle(center.x, center.y, radius, blockedCircle); } } canvas.setDrawFilter(removeFilter); @@ -209,9 +208,9 @@ public class CachesOverlay extends AbstractItemizedOverlay { progress.show(context, context.getResources().getString(R.string.map_live), context.getResources().getString(R.string.cache_dialog_loading_details), true, null); + CachesOverlayItemImpl item = null; // prevent concurrent changes getOverlayImpl().lock(); - CachesOverlayItemImpl item = null; try { if (index < items.size()) { item = items.get(index); diff --git a/main/src/cgeo/geocaching/maps/google/GoogleCacheOverlayItem.java b/main/src/cgeo/geocaching/maps/google/GoogleCacheOverlayItem.java index 2ac66af..b26654a 100644 --- a/main/src/cgeo/geocaching/maps/google/GoogleCacheOverlayItem.java +++ b/main/src/cgeo/geocaching/maps/google/GoogleCacheOverlayItem.java @@ -1,21 +1,20 @@ package cgeo.geocaching.maps.google; import cgeo.geocaching.IWaypoint; -import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import com.google.android.maps.GeoPoint; import com.google.android.maps.OverlayItem; public class GoogleCacheOverlayItem extends OverlayItem implements CachesOverlayItemImpl { - final private CacheType cacheType; final private IWaypoint coord; + final private boolean applyDistanceRule; - public GoogleCacheOverlayItem(final IWaypoint coordinate, final CacheType type) { + public GoogleCacheOverlayItem(final IWaypoint coordinate, boolean applyDistanceRule) { super(new GeoPoint(coordinate.getCoords().getLatitudeE6(), coordinate.getCoords().getLongitudeE6()), coordinate.getName(), ""); - this.cacheType = type; this.coord = coordinate; + this.applyDistanceRule = applyDistanceRule; } @Override @@ -24,8 +23,8 @@ public class GoogleCacheOverlayItem extends OverlayItem implements CachesOverlay } @Override - public CacheType getType() { - return cacheType; + public boolean applyDistanceRule() { + return applyDistanceRule; } } diff --git a/main/src/cgeo/geocaching/maps/google/GoogleMapItemFactory.java b/main/src/cgeo/geocaching/maps/google/GoogleMapItemFactory.java index f40c799..c708dc5 100644 --- a/main/src/cgeo/geocaching/maps/google/GoogleMapItemFactory.java +++ b/main/src/cgeo/geocaching/maps/google/GoogleMapItemFactory.java @@ -1,7 +1,6 @@ package cgeo.geocaching.maps.google; import cgeo.geocaching.IWaypoint; -import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import cgeo.geocaching.maps.interfaces.GeoPointImpl; @@ -15,7 +14,7 @@ public class GoogleMapItemFactory implements MapItemFactory { } @Override - public CachesOverlayItemImpl getCachesOverlayItem(final IWaypoint coordinate, final CacheType type) { - return new GoogleCacheOverlayItem(coordinate, type); + public CachesOverlayItemImpl getCachesOverlayItem(final IWaypoint coordinate, boolean applyDistanceRule) { + return new GoogleCacheOverlayItem(coordinate, applyDistanceRule); } } diff --git a/main/src/cgeo/geocaching/maps/interfaces/CachesOverlayItemImpl.java b/main/src/cgeo/geocaching/maps/interfaces/CachesOverlayItemImpl.java index 5bf3ed2..03fa21f 100644 --- a/main/src/cgeo/geocaching/maps/interfaces/CachesOverlayItemImpl.java +++ b/main/src/cgeo/geocaching/maps/interfaces/CachesOverlayItemImpl.java @@ -1,7 +1,6 @@ package cgeo.geocaching.maps.interfaces; import cgeo.geocaching.IWaypoint; -import cgeo.geocaching.enumerations.CacheType; /** * Covers the common functions of the provider-specific @@ -11,6 +10,5 @@ public interface CachesOverlayItemImpl extends OverlayItemImpl { public IWaypoint getCoord(); - public CacheType getType(); - + public boolean applyDistanceRule(); } diff --git a/main/src/cgeo/geocaching/maps/interfaces/MapItemFactory.java b/main/src/cgeo/geocaching/maps/interfaces/MapItemFactory.java index e02d472..22c6698 100644 --- a/main/src/cgeo/geocaching/maps/interfaces/MapItemFactory.java +++ b/main/src/cgeo/geocaching/maps/interfaces/MapItemFactory.java @@ -1,13 +1,12 @@ package cgeo.geocaching.maps.interfaces; import cgeo.geocaching.IWaypoint; -import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; public interface MapItemFactory { public GeoPointImpl getGeoPointBase(final Geopoint coords); - public CachesOverlayItemImpl getCachesOverlayItem(final IWaypoint iWaypoint, final CacheType type); + public CachesOverlayItemImpl getCachesOverlayItem(final IWaypoint iWaypoint, final boolean applyDistanceRule); } diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlayItem.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlayItem.java index 29f13b3..27ca664 100644 --- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlayItem.java +++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlayItem.java @@ -1,7 +1,6 @@ package cgeo.geocaching.maps.mapsforge; import cgeo.geocaching.IWaypoint; -import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import org.mapsforge.android.maps.overlay.OverlayItem; @@ -10,14 +9,14 @@ import org.mapsforge.core.GeoPoint; import android.graphics.drawable.Drawable; public class MapsforgeCacheOverlayItem extends OverlayItem implements CachesOverlayItemImpl { - final private CacheType cacheType; final private IWaypoint coord; + final private boolean applyDistanceRule; - public MapsforgeCacheOverlayItem(IWaypoint coordinate, final CacheType type) { + public MapsforgeCacheOverlayItem(IWaypoint coordinate, boolean applyDistanceRule) { super(new GeoPoint(coordinate.getCoords().getLatitudeE6(), coordinate.getCoords().getLongitudeE6()), coordinate.getName(), ""); - this.cacheType = type; this.coord = coordinate; + this.applyDistanceRule = applyDistanceRule; } @Override @@ -26,13 +25,13 @@ public class MapsforgeCacheOverlayItem extends OverlayItem implements CachesOver } @Override - public CacheType getType() { - return cacheType; + public Drawable getMarker(int index) { + return getMarker(); } @Override - public Drawable getMarker(int index) { - return getMarker(); + public boolean applyDistanceRule() { + return applyDistanceRule; } } diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapItemFactory.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapItemFactory.java index 10fcb03..4ade09c 100644 --- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapItemFactory.java +++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapItemFactory.java @@ -1,7 +1,6 @@ package cgeo.geocaching.maps.mapsforge; import cgeo.geocaching.IWaypoint; -import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import cgeo.geocaching.maps.interfaces.GeoPointImpl; @@ -15,8 +14,8 @@ public class MapsforgeMapItemFactory implements MapItemFactory { } @Override - public CachesOverlayItemImpl getCachesOverlayItem(final IWaypoint coordinate, final CacheType type) { - return new MapsforgeCacheOverlayItem(coordinate, type); + public CachesOverlayItemImpl getCachesOverlayItem(final IWaypoint coordinate, boolean applyDistanceRule) { + return new MapsforgeCacheOverlayItem(coordinate, applyDistanceRule); } } diff --git a/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeCacheOverlayItem.java b/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeCacheOverlayItem.java index 6b74de5..4e4a358 100644 --- a/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeCacheOverlayItem.java +++ b/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeCacheOverlayItem.java @@ -1,7 +1,6 @@ package cgeo.geocaching.maps.mapsforge.v024; import cgeo.geocaching.IWaypoint; -import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import org.mapsforge.android.mapsold.GeoPoint; @@ -10,14 +9,14 @@ import org.mapsforge.android.mapsold.OverlayItem; import android.graphics.drawable.Drawable; public class MapsforgeCacheOverlayItem extends OverlayItem implements CachesOverlayItemImpl { - final private CacheType cacheType; final private IWaypoint coord; + final private boolean applyDistanceRule; - public MapsforgeCacheOverlayItem(IWaypoint coordinate, final CacheType type) { + public MapsforgeCacheOverlayItem(IWaypoint coordinate, boolean applyDistanceRule) { super(new GeoPoint(coordinate.getCoords().getLatitudeE6(), coordinate.getCoords().getLongitudeE6()), coordinate.getName(), ""); - this.cacheType = type; this.coord = coordinate; + this.applyDistanceRule = applyDistanceRule; } @Override @@ -26,13 +25,13 @@ public class MapsforgeCacheOverlayItem extends OverlayItem implements CachesOver } @Override - public CacheType getType() { - return cacheType; + public Drawable getMarker(int index) { + return getMarker(); } @Override - public Drawable getMarker(int index) { - return getMarker(); + public boolean applyDistanceRule() { + return applyDistanceRule; } } diff --git a/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapItemFactory024.java b/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapItemFactory024.java index 5c64592..4f1d34c 100644 --- a/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapItemFactory024.java +++ b/main/src/cgeo/geocaching/maps/mapsforge/v024/MapsforgeMapItemFactory024.java @@ -1,7 +1,6 @@ package cgeo.geocaching.maps.mapsforge.v024; import cgeo.geocaching.IWaypoint; -import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.geopoint.Geopoint; import cgeo.geocaching.maps.interfaces.CachesOverlayItemImpl; import cgeo.geocaching.maps.interfaces.GeoPointImpl; @@ -15,7 +14,7 @@ public class MapsforgeMapItemFactory024 implements MapItemFactory { } @Override - public CachesOverlayItemImpl getCachesOverlayItem(final IWaypoint coordinate, final CacheType type) { - return new MapsforgeCacheOverlayItem(coordinate, type); + public CachesOverlayItemImpl getCachesOverlayItem(final IWaypoint coordinate, boolean applyDistanceRule) { + return new MapsforgeCacheOverlayItem(coordinate, applyDistanceRule); } } |
