aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching
diff options
context:
space:
mode:
authorMarco Jacob <mjacob@union06.de>2012-01-25 21:47:44 +0100
committerMarco Jacob <mjacob@union06.de>2012-01-25 21:47:44 +0100
commit4c787164a8b4ccfdb754858f76e18440aecc03ff (patch)
tree2dd01b57963a1a283af599f1c1fa1acf41515221 /main/src/cgeo/geocaching
parentf20f7bc3fabac198248fa3047014890aba81df14 (diff)
parent6dea5724d4115e98c3b10524e9edc6c0017d24b3 (diff)
downloadcgeo-4c787164a8b4ccfdb754858f76e18440aecc03ff.zip
cgeo-4c787164a8b4ccfdb754858f76e18440aecc03ff.tar.gz
cgeo-4c787164a8b4ccfdb754858f76e18440aecc03ff.tar.bz2
Merge branch 'master' into issue#290
Diffstat (limited to 'main/src/cgeo/geocaching')
-rw-r--r--main/src/cgeo/geocaching/CacheDetailActivity.java4
-rw-r--r--main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java18
-rw-r--r--main/src/cgeo/geocaching/cgCache.java19
3 files changed, 28 insertions, 13 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java
index 1f7edb9..58ec393 100644
--- a/main/src/cgeo/geocaching/CacheDetailActivity.java
+++ b/main/src/cgeo/geocaching/CacheDetailActivity.java
@@ -2339,7 +2339,9 @@ public class CacheDetailActivity extends AbstractActivity {
}
((TextView) rowView.findViewById(R.id.author)).setOnClickListener(new UserActionsClickListener());
- ((TextView) logLayout.findViewById(R.id.log)).setOnClickListener(new DecryptLogClickListener());
+ TextView logView = (TextView) logLayout.findViewById(R.id.log);
+ logView.setMovementMethod(LinkMovementMethod.getInstance());
+ logView.setOnClickListener(new DecryptLogClickListener());
loglist.add(rowView);
}
diff --git a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
index ac1cd8a..75001f3 100644
--- a/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
+++ b/main/src/cgeo/geocaching/apps/cache/navi/NavigationAppFactory.java
@@ -65,11 +65,11 @@ public final class NavigationAppFactory extends AbstractAppFactory {
}
public static void showNavigationMenu(final cgGeo geo, final Activity activity, final cgCache cache, final SearchResult search) {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+ final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.cache_menu_navigate);
builder.setIcon(android.R.drawable.ic_menu_mapmode);
final List<NavigationAppsEnum> installed = getInstalledNavigationApps(activity);
- String[] items = new String[installed.size()];
+ final String[] items = new String[installed.size()];
for (int i = 0; i < installed.size(); i++) {
items[i] = installed.get(i).app.getName();
}
@@ -78,7 +78,7 @@ public final class NavigationAppFactory extends AbstractAppFactory {
installed.get(item).app.invoke(geo, activity, cache, search, null, null);
}
});
- AlertDialog alert = builder.create();
+ final AlertDialog alert = builder.create();
alert.show();
}
@@ -124,7 +124,7 @@ public final class NavigationAppFactory extends AbstractAppFactory {
public static void startDefaultNavigationApplication(final cgGeo geo, Activity activity, cgCache cache,
final SearchResult search, cgWaypoint waypoint, final Geopoint destination) {
- NavigationApp app = getDefaultNavigationApplication(activity);
+ final NavigationApp app = getDefaultNavigationApplication(activity);
if (app != null) {
try {
@@ -144,21 +144,15 @@ public final class NavigationAppFactory extends AbstractAppFactory {
public static NavigationApp getDefaultNavigationApplication(Activity activity) {
final int defaultNavigationTool = Settings.getDefaultNavigationTool();
- NavigationApp app = null;
final List<NavigationAppsEnum> installedNavigationApps = getInstalledNavigationApps(activity);
for (NavigationAppsEnum navigationApp : installedNavigationApps) {
if (navigationApp.id == defaultNavigationTool) {
- app = navigationApp.app;
- break;
+ return navigationApp.app;
}
}
// default navigation tool wasn't set already or couldn't be found (not installed any more for example)
- if (app == null) {
- // assume that 0 is the compass-app
- app = installedNavigationApps.get(0).app;
- }
- return app;
+ return NavigationAppsEnum.COMPASS.app;
}
}
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java
index 933b0ad..edabc0c 100644
--- a/main/src/cgeo/geocaching/cgCache.java
+++ b/main/src/cgeo/geocaching/cgCache.java
@@ -1234,4 +1234,23 @@ public class cgCache implements ICache {
public String toString() {
return this.geocode + " " + this.name;
}
+
+ @Override
+ public int hashCode() {
+ return geocode.hashCode() * name.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ return isEqualTo((cgCache) obj);
+ }
}