aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching')
-rw-r--r--main/src/cgeo/geocaching/CacheDetailActivity.java9
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/AbstractPointNavigationApp.java3
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/CompassApp.java3
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java4
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/InternalMap.java9
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/LocusApp.java4
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/NavigationApp.java4
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java18
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java4
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java4
-rw-r--r--main/src/cgeo/geocaching/apps/cachelist/InternalCacheListMap.java2
-rw-r--r--main/src/cgeo/geocaching/cgeocaches.java6
-rw-r--r--main/src/cgeo/geocaching/cgeopoint.java6
-rw-r--r--main/src/cgeo/geocaching/cgeopopup.java16
-rw-r--r--main/src/cgeo/geocaching/cgeowaypoint.java4
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java14
-rw-r--r--main/src/cgeo/geocaching/maps/CachesOverlay.java5
-rw-r--r--main/src/cgeo/geocaching/maps/google/GoogleCacheOverlay.java4
-rw-r--r--main/src/cgeo/geocaching/maps/google/GoogleMapView.java4
-rw-r--r--main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java5
-rw-r--r--main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlay.java4
-rw-r--r--main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java4
22 files changed, 52 insertions, 84 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java
index aa36223..c159cb7 100644
--- a/main/src/cgeo/geocaching/CacheDetailActivity.java
+++ b/main/src/cgeo/geocaching/CacheDetailActivity.java
@@ -481,7 +481,7 @@ public class CacheDetailActivity extends AbstractActivity {
{
final cgWaypoint waypoint = cache.getWaypoint(index);
if (waypoint != null) {
- NavigationAppFactory.startDefaultNavigationApplication(geolocation, this, null, null, waypoint, null);
+ NavigationAppFactory.startDefaultNavigationApplication(geolocation, this, null, waypoint, null);
}
}
break;
@@ -489,7 +489,7 @@ public class CacheDetailActivity extends AbstractActivity {
{
final cgWaypoint waypoint = cache.getWaypoint(contextMenuWPIndex);
if (waypoint != null) {
- NavigationAppFactory.showNavigationMenu(geolocation, this, null, null, waypoint, null);
+ NavigationAppFactory.showNavigationMenu(geolocation, this, null, waypoint, null);
}
}
break;
@@ -834,7 +834,8 @@ public class CacheDetailActivity extends AbstractActivity {
return;
}
- NavigationAppFactory.startDefaultNavigationApplication(geolocation, this, cache, search, null, null);
+ //TODO: previously this used also the search argument "search". check if still needed
+ NavigationAppFactory.startDefaultNavigationApplication(geolocation, this, cache, null, null);
}
/**
@@ -852,7 +853,7 @@ public class CacheDetailActivity extends AbstractActivity {
}
private void showNavigationMenu() {
- NavigationAppFactory.showNavigationMenu(geolocation, this, cache, search, null, null);
+ NavigationAppFactory.showNavigationMenu(geolocation, this, cache, null, null);
}
/**
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/AbstractPointNavigationApp.java b/main/src/cgeo/geocaching/apps/cache/navi/AbstractPointNavigationApp.java
index dc51a15..bf7ebb1 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/AbstractPointNavigationApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/AbstractPointNavigationApp.java
@@ -1,6 +1,5 @@
package cgeo.geocaching.apps.cache.navi;
-import cgeo.geocaching.SearchResult;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgWaypoint;
@@ -25,7 +24,7 @@ abstract class AbstractPointNavigationApp extends AbstractNavigationApp {
}
@Override
- public final boolean invoke(cgGeo geo, Activity activity, cgCache cache, SearchResult search, cgWaypoint waypoint, Geopoint coords) {
+ public final boolean invoke(cgGeo geo, Activity activity, cgCache cache, cgWaypoint waypoint, Geopoint coords) {
if (cache == null && waypoint == null && coords == null) {
return false;
}
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/CompassApp.java b/main/src/cgeo/geocaching/apps/cache/navi/CompassApp.java
index 3442f9a..b741175 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/CompassApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/CompassApp.java
@@ -1,7 +1,6 @@
package cgeo.geocaching.apps.cache.navi;
import cgeo.geocaching.R;
-import cgeo.geocaching.SearchResult;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgWaypoint;
@@ -24,7 +23,7 @@ class CompassApp extends AbstractNavigationApp {
@Override
public boolean invoke(cgGeo geo, Activity activity, cgCache cache,
- final SearchResult search, cgWaypoint waypoint, final Geopoint coords) {
+ cgWaypoint waypoint, final Geopoint coords) {
if (cache != null && cache.getGeocode() != null) {
cgeonavigate.startActivity(activity, cache.getGeocode(), cache.getName(), cache.getCoords(), null);
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java b/main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java
index 84bfa41..f94a623 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/GoogleNavigationApp.java
@@ -1,7 +1,6 @@
package cgeo.geocaching.apps.cache.navi;
import cgeo.geocaching.R;
-import cgeo.geocaching.SearchResult;
import cgeo.geocaching.Settings;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
@@ -27,8 +26,7 @@ class GoogleNavigationApp extends AbstractNavigationApp {
}
@Override
- public boolean invoke(final cgGeo geo, final Activity activity, final cgCache cache,
- final SearchResult search, final cgWaypoint waypoint, final Geopoint coords) {
+ public boolean invoke(final cgGeo geo, final Activity activity, final cgCache cache, final cgWaypoint waypoint, final Geopoint coords) {
if (activity == null) {
return false;
}
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/InternalMap.java b/main/src/cgeo/geocaching/apps/cache/navi/InternalMap.java
index f8d5c0f..44f151e 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/InternalMap.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/InternalMap.java
@@ -1,7 +1,6 @@
package cgeo.geocaching.apps.cache.navi;
import cgeo.geocaching.R;
-import cgeo.geocaching.SearchResult;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgWaypoint;
@@ -20,12 +19,10 @@ class InternalMap extends AbstractNavigationApp {
@Override
public boolean invoke(cgGeo geo, Activity activity, cgCache cache,
- final SearchResult search, cgWaypoint waypoint, final Geopoint coords) {
- if (search != null) {
- CGeoMap.startActivitySearch(activity, search, cache != null ? cache.getGeocode() : null, true);
- }
- else if (cache != null) {
+ cgWaypoint waypoint, final Geopoint coords) {
+ if (cache != null) {
CGeoMap.startActivityGeoCode(activity, cache.getGeocode());
+ // may need some code from CGeoMap.startActivitySearch(activity, search, cache != null ? cache.getGeocode() : null, true);
}
else if (waypoint != null) {
CGeoMap.startActivityCoords(activity, waypoint.getCoords(), waypoint.getWaypointType(), waypoint.getName());
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/LocusApp.java b/main/src/cgeo/geocaching/apps/cache/navi/LocusApp.java
index 976292b..260d933 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/LocusApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/LocusApp.java
@@ -1,6 +1,5 @@
package cgeo.geocaching.apps.cache.navi;
-import cgeo.geocaching.SearchResult;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgWaypoint;
@@ -21,8 +20,7 @@ class LocusApp extends AbstractLocusApp implements NavigationApp {
* @author koem
*/
@Override
- public boolean invoke(cgGeo geo, Activity activity, cgCache cache,
- final SearchResult search, cgWaypoint waypoint, final Geopoint coords) {
+ public boolean invoke(cgGeo geo, Activity activity, cgCache cache, cgWaypoint waypoint, final Geopoint coords) {
final ArrayList<Object> points = new ArrayList<Object>();
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationApp.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationApp.java
index 333d1b5..119d27b 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationApp.java
@@ -1,6 +1,5 @@
package cgeo.geocaching.apps.cache.navi;
-import cgeo.geocaching.SearchResult;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgWaypoint;
@@ -11,7 +10,6 @@ import android.app.Activity;
public interface NavigationApp extends App {
public boolean invoke(final cgGeo geo, final Activity activity,
- final cgCache cache,
- final SearchResult search, final cgWaypoint waypoint,
+ final cgCache cache, final cgWaypoint waypoint,
final Geopoint coords);
}
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
index 0ec3a0a..dfef8fa 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
@@ -79,13 +79,12 @@ public final class NavigationAppFactory extends AbstractAppFactory {
* @param geo
* @param activity
* @param cache
- * @param search
* @param waypoint
* @param destination
*/
public static void showNavigationMenu(final cgGeo geo, final Activity activity,
- final cgCache cache, final SearchResult search, final cgWaypoint waypoint, final Geopoint destination) {
- showNavigationMenu(geo, activity, cache, search, waypoint, destination, true, false);
+ final cgCache cache, final cgWaypoint waypoint, final Geopoint destination) {
+ showNavigationMenu(geo, activity, cache, waypoint, destination, true, false);
}
/**
@@ -96,8 +95,6 @@ public final class NavigationAppFactory extends AbstractAppFactory {
* @param activity
* @param cache
* may be <code>null</code>
- * @param search
- * may be <code>null</code>
* @param waypoint
* may be <code>null</code>
* @param destination
@@ -110,7 +107,7 @@ public final class NavigationAppFactory extends AbstractAppFactory {
* @see #showNavigationMenu(cgGeo, Activity, cgCache, SearchResult, cgWaypoint, Geopoint)
*/
public static void showNavigationMenu(final cgGeo geo, final Activity activity,
- final cgCache cache, final SearchResult search, final cgWaypoint waypoint, final Geopoint destination,
+ final cgCache cache, final cgWaypoint waypoint, final Geopoint destination,
final boolean showInternalMap, final boolean showDefaultNavigation) {
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.cache_menu_navigate);
@@ -152,7 +149,7 @@ public final class NavigationAppFactory extends AbstractAppFactory {
builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
NavigationAppsEnum selectedItem = adapter.getItem(item);
- selectedItem.app.invoke(geo, activity, cache, search, waypoint, destination);
+ selectedItem.app.invoke(geo, activity, cache, waypoint, destination);
}
});
final AlertDialog alert = builder.create();
@@ -260,8 +257,7 @@ public final class NavigationAppFactory extends AbstractAppFactory {
final NavigationApp app = getAppFromMenuItem(item);
if (app != null) {
try {
- return app.invoke(geo, activity, cache,
- search, waypoint, destination);
+ return app.invoke(geo, activity, cache, waypoint, destination);
} catch (Exception e) {
Log.e(Settings.tag, "NavigationAppFactory.onMenuItemSelected: " + e.toString());
}
@@ -290,12 +286,12 @@ public final class NavigationAppFactory extends AbstractAppFactory {
* @param destination
*/
public static void startDefaultNavigationApplication(final cgGeo geo, Activity activity, cgCache cache,
- final SearchResult search, cgWaypoint waypoint, final Geopoint destination) {
+ cgWaypoint waypoint, final Geopoint destination) {
final NavigationApp app = getDefaultNavigationApplication(activity);
if (app != null) {
try {
- app.invoke(geo, activity, cache, search, waypoint, destination);
+ app.invoke(geo, activity, cache, waypoint, destination);
} catch (Exception e) {
Log.e(Settings.tag, "NavigationAppFactory.startDefaultNavigationApplication: " + e.toString());
}
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java b/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java
index 4fa73c7..a87e61b 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/RMapsApp.java
@@ -1,7 +1,6 @@
package cgeo.geocaching.apps.cache.navi;
import cgeo.geocaching.R;
-import cgeo.geocaching.SearchResult;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
import cgeo.geocaching.cgWaypoint;
@@ -22,8 +21,7 @@ class RMapsApp extends AbstractNavigationApp {
}
@Override
- public boolean invoke(cgGeo geo, Activity activity, cgCache cache,
- final SearchResult search, cgWaypoint waypoint, final Geopoint coords) {
+ public boolean invoke(cgGeo geo, Activity activity, cgCache cache, cgWaypoint waypoint, final Geopoint coords) {
try {
final ArrayList<String> locations = new ArrayList<String>();
if (cache != null && cache.getCoords() != null) {
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java b/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java
index 0bf2f56..a0eb5a1 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/StaticMapApp.java
@@ -1,7 +1,6 @@
package cgeo.geocaching.apps.cache.navi;
import cgeo.geocaching.R;
-import cgeo.geocaching.SearchResult;
import cgeo.geocaching.StaticMapsActivity;
import cgeo.geocaching.cgCache;
import cgeo.geocaching.cgGeo;
@@ -25,8 +24,7 @@ class StaticMapApp extends AbstractNavigationApp {
}
@Override
- public boolean invoke(cgGeo geo, Activity activity, cgCache cache,
- final SearchResult search, cgWaypoint waypoint, final Geopoint coords) {
+ public boolean invoke(cgGeo geo, Activity activity, cgCache cache, cgWaypoint waypoint, final Geopoint coords) {
String geocode = null;
if (cache != null && cache.getListId() != 0) {
diff --git a/main/src/cgeo/geocaching/apps/cachelist/InternalCacheListMap.java b/main/src/cgeo/geocaching/apps/cachelist/InternalCacheListMap.java
index e3cbb4b..5eaefc9 100644
--- a/main/src/cgeo/geocaching/apps/cachelist/InternalCacheListMap.java
+++ b/main/src/cgeo/geocaching/apps/cachelist/InternalCacheListMap.java
@@ -25,7 +25,7 @@ class InternalCacheListMap extends AbstractApp implements CacheListApp {
@Override
public boolean invoke(cgGeo geo, List<cgCache> caches, Activity activity, final SearchResult search) {
- CGeoMap.startActivitySearch(activity, search, null, false);
+ CGeoMap.startActivitySearch(activity, search, null);
return true;
}
}
diff --git a/main/src/cgeo/geocaching/cgeocaches.java b/main/src/cgeo/geocaching/cgeocaches.java
index 7d3a057..a7fe4ec 100644
--- a/main/src/cgeo/geocaching/cgeocaches.java
+++ b/main/src/cgeo/geocaching/cgeocaches.java
@@ -1218,11 +1218,11 @@ public class cgeocaches extends AbstractListActivity {
if (id == MENU_DEFAULT_NAVIGATION) {
final cgCache cache = getCacheFromAdapter(adapterInfo);
- NavigationAppFactory.startDefaultNavigationApplication(geo, this, cache, null, null, null);
+ NavigationAppFactory.startDefaultNavigationApplication(geo, this, cache, null, null);
return true;
} else if (id == MENU_NAVIGATION) {
final cgCache cache = getCacheFromAdapter(adapterInfo);
- NavigationAppFactory.showNavigationMenu(geo, this, cache, null, null, null);
+ NavigationAppFactory.showNavigationMenu(geo, this, cache, null, null);
return true;
} else if (id == MENU_LOG_VISIT) {
return getCacheFromAdapter(adapterInfo).logVisit(this);
@@ -2556,7 +2556,7 @@ public class cgeocaches extends AbstractListActivity {
if (count > 0) {
mapTitle = title + " [" + count + "]";
}
- CGeoMap.startActivitySearch(this, searchToUse, mapTitle, false);
+ CGeoMap.startActivitySearch(this, searchToUse, mapTitle);
}
@Override
diff --git a/main/src/cgeo/geocaching/cgeopoint.java b/main/src/cgeo/geocaching/cgeopoint.java
index 56e5866..c567ad9 100644
--- a/main/src/cgeo/geocaching/cgeopoint.java
+++ b/main/src/cgeo/geocaching/cgeopoint.java
@@ -160,7 +160,7 @@ public class cgeopoint extends AbstractActivity {
case CONTEXT_MENU_NAVIGATE:
contextMenuItemPosition = position;
if (destination instanceof cgDestination) {
- NavigationAppFactory.showNavigationMenu(geo, this, null, null, null, ((cgDestination) destination).getCoords());
+ NavigationAppFactory.showNavigationMenu(geo, this, null, null, ((cgDestination) destination).getCoords());
return true;
}
break;
@@ -359,7 +359,7 @@ public class cgeopoint extends AbstractActivity {
return true;
case MENU_NAVIGATE:
- NavigationAppFactory.showNavigationMenu(geo, this, null, null, null, coords);
+ NavigationAppFactory.showNavigationMenu(geo, this, null, null, coords);
return true;
default:
return false;
@@ -430,7 +430,7 @@ public class cgeopoint extends AbstractActivity {
return;
}
- NavigationAppFactory.startDefaultNavigationApplication(geo, this, null, null, null, geopoint);
+ NavigationAppFactory.startDefaultNavigationApplication(geo, this, null, null, geopoint);
}
private void cachesAround() {
diff --git a/main/src/cgeo/geocaching/cgeopopup.java b/main/src/cgeo/geocaching/cgeopopup.java
index 0e0f1b2..6e1af49 100644
--- a/main/src/cgeo/geocaching/cgeopopup.java
+++ b/main/src/cgeo/geocaching/cgeopopup.java
@@ -34,7 +34,6 @@ import android.widget.TextView;
public class cgeopopup extends AbstractActivity {
- private boolean fromDetail = false;
private LayoutInflater inflater = null;
private String geocode = null;
private cgCache cache = null;
@@ -119,7 +118,6 @@ public class cgeopopup extends AbstractActivity {
// get parameters
Bundle extras = getIntent().getExtras();
if (extras != null) {
- fromDetail = extras.getBoolean("fromdetail");
geocode = extras.getString("geocode");
}
@@ -157,8 +155,7 @@ public class cgeopopup extends AbstractActivity {
menu.findItem(5).setVisible(false);
}
- boolean visitPossible = !fromDetail && Settings.isLogin();
- menu.findItem(MENU_LOG_VISIT).setEnabled(visitPossible);
+ menu.findItem(MENU_LOG_VISIT).setEnabled(Settings.isLogin());
} catch (Exception e) {
// nothing
}
@@ -174,7 +171,7 @@ public class cgeopopup extends AbstractActivity {
navigateTo();
return true;
} else if (menuItem == 3) {
- NavigationAppFactory.showNavigationMenu(geo, this, cache, null, null, null);
+ NavigationAppFactory.showNavigationMenu(geo, this, cache, null, null);
return true;
} else if (menuItem == 5) {
cachesAround();
@@ -376,8 +373,9 @@ public class cgeopopup extends AbstractActivity {
}
}
+ final boolean moreDetails = cache.isDetailed();
// more details
- if (!fromDetail) {
+ if (moreDetails) {
((LinearLayout) findViewById(R.id.more_details_box)).setVisibility(View.VISIBLE);
Button buttonMore = (Button) findViewById(R.id.more_details);
@@ -396,7 +394,7 @@ public class cgeopopup extends AbstractActivity {
((LinearLayout) findViewById(R.id.more_details_box)).setVisibility(View.GONE);
}
- if (!fromDetail) {
+ if (moreDetails) {
((LinearLayout) findViewById(R.id.offline_box)).setVisibility(View.VISIBLE);
// offline use
@@ -519,7 +517,7 @@ public class cgeopopup extends AbstractActivity {
return;
}
- NavigationAppFactory.startDefaultNavigationApplication(geo, this, cache, null, null, null);
+ NavigationAppFactory.startDefaultNavigationApplication(geo, this, cache, null, null);
}
private void cachesAround() {
@@ -629,7 +627,7 @@ public class cgeopopup extends AbstractActivity {
showToast(res.getString(R.string.cache_coordinates_no));
return;
}
- NavigationAppFactory.startDefaultNavigationApplication(geo, this, cache, null, null, null);
+ NavigationAppFactory.startDefaultNavigationApplication(geo, this, cache, null, null);
finish();
}
diff --git a/main/src/cgeo/geocaching/cgeowaypoint.java b/main/src/cgeo/geocaching/cgeowaypoint.java
index f5ba7a8..190c54d 100644
--- a/main/src/cgeo/geocaching/cgeowaypoint.java
+++ b/main/src/cgeo/geocaching/cgeowaypoint.java
@@ -251,7 +251,7 @@ public class cgeowaypoint extends AbstractActivity {
goToGeocache();
return true;
} else if (menuItem == MENU_ID_NAVIGATION) {
- NavigationAppFactory.showNavigationMenu(geo, this, null, null, waypoint, null);
+ NavigationAppFactory.showNavigationMenu(geo, this, null, waypoint, null);
return true;
}
return false;
@@ -332,7 +332,7 @@ public class cgeowaypoint extends AbstractActivity {
return;
}
- NavigationAppFactory.startDefaultNavigationApplication(geo, this, null, null, waypoint, null);
+ NavigationAppFactory.startDefaultNavigationApplication(geo, this, null, waypoint, null);
}
private boolean navigationPossible() {
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index 5d8c0db..b15d54c 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -87,7 +87,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
private static final String EXTRAS_WPTTYPE = "wpttype";
private static final String EXTRAS_MAPSTATE = "mapstate";
private static final String EXTRAS_SEARCH = "search";
- private static final String EXTRAS_DETAIL = "detail";
private static final int MENU_SELECT_MAPVIEW = 1;
private static final int MENU_MAP_LIVE = 2;
private static final int MENU_STORE_CACHES = 3;
@@ -107,8 +106,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
private cgDirection dir = null;
private UpdateLocationCallback geoUpdate = new UpdateLoc();
private UpdateDirectionCallback dirUpdate = new UpdateDir();
- // from intent
- private boolean fromDetailIntent = false;
private SearchResult searchIntent = null;
private String geocodeIntent = null;
private Geopoint coordsIntent = null;
@@ -345,7 +342,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
}
if (overlayCaches == null) {
- overlayCaches = mapView.createAddMapOverlay(mapView.getContext(), getResources().getDrawable(R.drawable.marker), fromDetailIntent);
+ overlayCaches = mapView.createAddMapOverlay(mapView.getContext(), getResources().getDrawable(R.drawable.marker));
}
if (overlayScale == null) {
@@ -368,7 +365,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
// get parameters
Bundle extras = activity.getIntent().getExtras();
if (extras != null) {
- fromDetailIntent = extras.getBoolean(EXTRAS_DETAIL);
searchIntent = (SearchResult) extras.getParcelable(EXTRAS_SEARCH);
geocodeIntent = extras.getString(EXTRAS_GEOCODE);
final double latitudeIntent = extras.getDouble(EXTRAS_LATITUDE);
@@ -715,7 +711,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
// prepare information to restart a similar view
Intent mapIntent = new Intent(activity, Settings.getMapProvider().getMapClass());
- mapIntent.putExtra(EXTRAS_DETAIL, fromDetailIntent);
mapIntent.putExtra(EXTRAS_SEARCH, searchIntent);
mapIntent.putExtra(EXTRAS_GEOCODE, geocodeIntent);
if (coordsIntent != null) {
@@ -1154,7 +1149,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
// stage 1 - pull and render from the DB only for live map
- if (fromDetailIntent || searchIntent != null || geocodeIntent != null) {
+ if (searchIntent != null || geocodeIntent != null) {
// map started from another activity
search = new SearchResult(searchIntent);
if (geocodeIntent != null) {
@@ -1794,9 +1789,8 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
return new Intent(context, Settings.getMapProvider().getMapClass());
}
- public static void startActivitySearch(final Activity fromActivity, final SearchResult search, final String title, boolean detail) {
+ public static void startActivitySearch(final Activity fromActivity, final SearchResult search, final String title) {
final Intent mapIntent = newIntent(fromActivity);
- mapIntent.putExtra(EXTRAS_DETAIL, detail);
mapIntent.putExtra(EXTRAS_SEARCH, search);
if (StringUtils.isNotBlank(title)) {
mapIntent.putExtra(CGeoMap.EXTRAS_MAP_TITLE, title);
@@ -1810,7 +1804,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
public static void startActivityCoords(final Activity fromActivity, final Geopoint coords, final WaypointType type, final String title) {
final Intent mapIntent = newIntent(fromActivity);
- mapIntent.putExtra(EXTRAS_DETAIL, false);
mapIntent.putExtra(EXTRAS_LATITUDE, coords.getLatitude());
mapIntent.putExtra(EXTRAS_LONGITUDE, coords.getLongitude());
if (type != null) {
@@ -1824,7 +1817,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
public static void startActivityGeoCode(final Activity fromActivity, final String geocode) {
final Intent mapIntent = newIntent(fromActivity);
- mapIntent.putExtra(EXTRAS_DETAIL, false);
mapIntent.putExtra(EXTRAS_GEOCODE, geocode);
mapIntent.putExtra(EXTRAS_MAP_TITLE, geocode);
fromActivity.startActivity(mapIntent);
diff --git a/main/src/cgeo/geocaching/maps/CachesOverlay.java b/main/src/cgeo/geocaching/maps/CachesOverlay.java
index 607a595..deda643 100644
--- a/main/src/cgeo/geocaching/maps/CachesOverlay.java
+++ b/main/src/cgeo/geocaching/maps/CachesOverlay.java
@@ -34,7 +34,6 @@ public class CachesOverlay extends AbstractItemizedOverlay {
private List<CachesOverlayItemImpl> items = new ArrayList<CachesOverlayItemImpl>();
private Context context = null;
- private boolean fromDetail = false;
private boolean displayCircles = false;
private ProgressDialog waitDialog = null;
private Point center = new Point();
@@ -44,13 +43,12 @@ public class CachesOverlay extends AbstractItemizedOverlay {
private PaintFlagsDrawFilter remfil = null;
private MapProvider mapProvider = null;
- public CachesOverlay(ItemizedOverlayImpl ovlImpl, Context contextIn, boolean fromDetailIn) {
+ public CachesOverlay(ItemizedOverlayImpl ovlImpl, Context contextIn) {
super(ovlImpl);
populate();
context = contextIn;
- fromDetail = fromDetailIn;
mapProvider = Settings.getMapProvider();
}
@@ -207,7 +205,6 @@ public class CachesOverlay extends AbstractItemizedOverlay {
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);
diff --git a/main/src/cgeo/geocaching/maps/google/GoogleCacheOverlay.java b/main/src/cgeo/geocaching/maps/google/GoogleCacheOverlay.java
index 3ce7543..67fe997 100644
--- a/main/src/cgeo/geocaching/maps/google/GoogleCacheOverlay.java
+++ b/main/src/cgeo/geocaching/maps/google/GoogleCacheOverlay.java
@@ -27,9 +27,9 @@ public class GoogleCacheOverlay extends ItemizedOverlay<GoogleCacheOverlayItem>
private CachesOverlay base;
private Lock lock = new ReentrantLock();
- public GoogleCacheOverlay(Context contextIn, Drawable markerIn, boolean fromDetailIn) {
+ public GoogleCacheOverlay(Context contextIn, Drawable markerIn) {
super(boundCenterBottom(markerIn));
- base = new CachesOverlay(this, contextIn, fromDetailIn);
+ base = new CachesOverlay(this, contextIn);
}
@Override
diff --git a/main/src/cgeo/geocaching/maps/google/GoogleMapView.java b/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
index 9d9f3c9..766c941 100644
--- a/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
+++ b/main/src/cgeo/geocaching/maps/google/GoogleMapView.java
@@ -105,9 +105,9 @@ public class GoogleMapView extends MapView implements MapViewImpl {
}
@Override
- public CachesOverlay createAddMapOverlay(Context context, Drawable drawable, boolean fromDetailIntent) {
+ public CachesOverlay createAddMapOverlay(Context context, Drawable drawable) {
- GoogleCacheOverlay ovl = new GoogleCacheOverlay(context, drawable, fromDetailIntent);
+ GoogleCacheOverlay ovl = new GoogleCacheOverlay(context, drawable);
getOverlays().add(ovl);
return ovl.getBase();
}
diff --git a/main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java b/main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java
index 08eaaf4..08e04f1 100644
--- a/main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java
+++ b/main/src/cgeo/geocaching/maps/interfaces/MapViewImpl.java
@@ -48,8 +48,7 @@ public interface MapViewImpl {
Context getContext();
- CachesOverlay createAddMapOverlay(Context context,
- Drawable drawable, boolean fromDetailIntent);
+ CachesOverlay createAddMapOverlay(Context context, Drawable drawable);
OtherCachersOverlay createAddUsersOverlay(Context context, Drawable markerIn);
@@ -63,7 +62,7 @@ public interface MapViewImpl {
* Map-library unspecific method to request a repaint of either
* a specific overlay, that changed, or the mapview as a whole
* (if overlay is null)
- *
+ *
* @param overlay
* Overlay to repaint or null if the mapview has changed
*/
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlay.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlay.java
index 8520ac7..6ea4478 100644
--- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlay.java
+++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeCacheOverlay.java
@@ -21,9 +21,9 @@ public class MapsforgeCacheOverlay extends ItemizedOverlay<MapsforgeCacheOverlay
private CachesOverlay base;
private Lock lock = new ReentrantLock();
- public MapsforgeCacheOverlay(Context contextIn, Drawable markerIn, boolean fromDetailIn) {
+ public MapsforgeCacheOverlay(Context contextIn, Drawable markerIn) {
super(boundCenterBottom(markerIn));
- base = new CachesOverlay(this, contextIn, fromDetailIn);
+ base = new CachesOverlay(this, contextIn);
}
@Override
diff --git a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
index bcb6e61..165a79c 100644
--- a/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
+++ b/main/src/cgeo/geocaching/maps/mapsforge/MapsforgeMapView.java
@@ -85,9 +85,9 @@ public class MapsforgeMapView extends MapView implements MapViewImpl {
}
@Override
- public CachesOverlay createAddMapOverlay(Context context, Drawable drawable, boolean fromDetailIntent) {
+ public CachesOverlay createAddMapOverlay(Context context, Drawable drawable) {
- MapsforgeCacheOverlay ovl = new MapsforgeCacheOverlay(context, drawable, fromDetailIntent);
+ MapsforgeCacheOverlay ovl = new MapsforgeCacheOverlay(context, drawable);
getOverlays().add(ovl);
return ovl.getBase();
}