aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/apps/cache
diff options
context:
space:
mode:
authorMarco Jacob <mjacob@union06.de>2012-06-08 22:46:12 +0200
committerMarco Jacob <mjacob@union06.de>2012-06-08 22:46:12 +0200
commit40a31725135be73d9f850d83857ca6771135ed70 (patch)
tree0db12face9dfcd009224b3d2b421e5014457d84d /main/src/cgeo/geocaching/apps/cache
parentb335983a2a9ceef86af0d60ced2cd84397899281 (diff)
downloadcgeo-40a31725135be73d9f850d83857ca6771135ed70.zip
cgeo-40a31725135be73d9f850d83857ca6771135ed70.tar.gz
cgeo-40a31725135be73d9f850d83857ca6771135ed70.tar.bz2
fixes #1725: no static maps apps as default nav app
Diffstat (limited to 'main/src/cgeo/geocaching/apps/cache')
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/AbstractStaticMapsApp.java5
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java15
2 files changed, 20 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/AbstractStaticMapsApp.java b/main/src/cgeo/geocaching/apps/cache/navi/AbstractStaticMapsApp.java
index 3716f0c..dacb03f 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/AbstractStaticMapsApp.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/AbstractStaticMapsApp.java
@@ -24,6 +24,11 @@ abstract class AbstractStaticMapsApp extends AbstractApp implements CacheNavigat
return true;
}
+ @Override
+ public boolean isDefaultNavigationApp() {
+ return false;
+ }
+
protected static boolean hasStaticMap(cgCache cache) {
String geocode = cache.getGeocode();
if (StringUtils.isNotEmpty(geocode) && cgeoapplication.getInstance().isOffline(geocode, null)) {
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
index cd8fea4..bf0517f 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
@@ -178,6 +178,21 @@ public final class NavigationAppFactory extends AbstractAppFactory {
}
/**
+ * Returns all installed navigation apps for default navigation.
+ *
+ * @return
+ */
+ public static List<NavigationAppsEnum> getInstalledDefaultNavigationApps() {
+ final List<NavigationAppsEnum> installedNavigationApps = new ArrayList<NavigationAppsEnum>();
+ for (NavigationAppsEnum appEnum : NavigationAppsEnum.values()) {
+ if (appEnum.app.isInstalled() && appEnum.app.isDefaultNavigationApp()) {
+ installedNavigationApps.add(appEnum);
+ }
+ }
+ return installedNavigationApps;
+ }
+
+ /**
* This offset is used to build unique menu ids to avoid collisions of ids in menus
*/
private static final int MENU_ITEM_OFFSET = 12345;