diff options
author | Marco Jacob <mjacob@union06.de> | 2012-06-08 22:46:12 +0200 |
---|---|---|
committer | Marco Jacob <mjacob@union06.de> | 2012-06-08 22:46:12 +0200 |
commit | 40a31725135be73d9f850d83857ca6771135ed70 (patch) | |
tree | 0db12face9dfcd009224b3d2b421e5014457d84d /main/src/cgeo/geocaching/apps/cache | |
parent | b335983a2a9ceef86af0d60ced2cd84397899281 (diff) | |
download | cgeo-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.java | 5 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java | 15 |
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; |