aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/apps
diff options
context:
space:
mode:
authorTorsten Keil <github@torsten-keil.net>2012-01-02 20:34:56 +0100
committerTorsten Keil <github@torsten-keil.net>2012-01-02 20:34:56 +0100
commit9c7e6cdd942515dea532bced4fb7cccff7fea6ad (patch)
tree4e03f8ec4275653855cba94d6c32dc55e9473572 /main/src/cgeo/geocaching/apps
parent0187e02d39a89600963f0c6ee28e9e9f307cb3d3 (diff)
downloadcgeo-9c7e6cdd942515dea532bced4fb7cccff7fea6ad.zip
cgeo-9c7e6cdd942515dea532bced4fb7cccff7fea6ad.tar.gz
cgeo-9c7e6cdd942515dea532bced4fb7cccff7fea6ad.tar.bz2
Small changes for the pull request.
Diffstat (limited to 'main/src/cgeo/geocaching/apps')
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
index b761fc1..03541d0 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
@@ -41,16 +41,16 @@ public final class NavigationAppFactory extends AbstractAppFactory {
public static void addMenuItems(final Menu menu, final Activity activity,
final Resources res) {
- addMenuItems(menu, activity, res, true);
+ addMenuItems(menu, activity, res, true, false);
}
public static void addMenuItems(final Menu menu, final Activity activity,
- final Resources res, final boolean showInternalMap) {
- for (NavigationApp app : getNavigationApps(res)) {
- if (app.isInstalled(activity)) {
- if (showInternalMap || !(app instanceof InternalMap)) {
- menu.add(0, app.getId(), 0, app.getName());
- }
+ final Resources res, final boolean showInternalMap, final boolean showDefaultNavigation) {
+ int defaultNavigationTool = Settings.getDefaultNavigationTool();
+ for (NavigationApp app : getInstalledNavigationApps(activity, res)) {
+ if ((showInternalMap || !(app instanceof InternalMap)) &&
+ (showDefaultNavigation || defaultNavigationTool != app.getId())) {
+ menu.add(0, app.getId(), 0, app.getName());
}
}
}
@@ -67,13 +67,11 @@ public final class NavigationAppFactory extends AbstractAppFactory {
public static int getOrdinalFromId(final Activity activity, final Resources res, final int id) {
int ordinal = 0;
- for (NavigationApp app : getNavigationApps(res)) {
- if (app.isInstalled(activity)) {
- if (app.getId() == id) {
- return ordinal;
- }
- ordinal++;
+ for (NavigationApp app : getInstalledNavigationApps(activity, res)) {
+ if (app.getId() == id) {
+ return ordinal;
}
+ ordinal++;
}
return 0;
}