diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2011-09-20 21:51:07 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2011-09-20 21:51:07 +0200 |
commit | b3da6401d9b51c9526c821b0e0907c63f4fddc67 (patch) | |
tree | b216bc06fdb53a789470973649487115e55ff7b2 /main/src/cgeo/geocaching/cgeodetail.java | |
parent | 383e20e40cb6c22d9fc124386abf3d9f83972a66 (diff) | |
download | cgeo-b3da6401d9b51c9526c821b0e0907c63f4fddc67.zip cgeo-b3da6401d9b51c9526c821b0e0907c63f4fddc67.tar.gz cgeo-b3da6401d9b51c9526c821b0e0907c63f4fddc67.tar.bz2 |
initial support of OpenCaching.DE/.PL/.US
* search for geocode can fetch online from those sites (but no other
search method!) when testing, search for codes like OU0001, OP0001,
OC0001.
* show CC license for those caches
* disable user actions, disable caches around for non GC caches
open issues:
* other search methods not yet implemented (but available in API)
* CC license and mentioning of the OpenCaching network in about dialog
Diffstat (limited to 'main/src/cgeo/geocaching/cgeodetail.java')
-rw-r--r-- | main/src/cgeo/geocaching/cgeodetail.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/cgeodetail.java b/main/src/cgeo/geocaching/cgeodetail.java index 16af323..0c5a252 100644 --- a/main/src/cgeo/geocaching/cgeodetail.java +++ b/main/src/cgeo/geocaching/cgeodetail.java @@ -4,6 +4,8 @@ import cgeo.geocaching.activity.AbstractActivity; import cgeo.geocaching.apps.cache.GeneralAppsFactory; import cgeo.geocaching.apps.cache.navi.NavigationAppFactory; import cgeo.geocaching.compatibility.Compatibility; +import cgeo.geocaching.connector.ConnectorFactory; +import cgeo.geocaching.connector.IConnector; import cgeo.geocaching.enumerations.CacheSize; import cgeo.geocaching.utils.CollectionUtils; import cgeo.geocaching.utils.CryptUtils; @@ -50,6 +52,7 @@ import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.ScrollView; import android.widget.TextView; +import android.widget.TextView.BufferType; import java.net.URLEncoder; import java.util.ArrayList; @@ -512,7 +515,7 @@ public class cgeodetail extends AbstractActivity { menu.add(1, 5, 0, res.getString(R.string.cache_menu_spoilers)).setIcon(android.R.drawable.ic_menu_gallery); // spoiler images } - if (cache != null && cache.coords != null) { + if (cache != null && cache.coords != null && cache.supportsCachesAround()) { menu.add(0, 10, 0, res.getString(R.string.cache_menu_around)).setIcon(android.R.drawable.ic_menu_rotate); // caches around } @@ -1083,6 +1086,21 @@ public class cgeodetail extends AbstractActivity { displayLogs(); + // data license + IConnector connector = ConnectorFactory.getConnector(cache); + if (connector != null) { + String license = connector.getLicenseText(cache); + if (StringUtils.isNotBlank(license)) { + ((LinearLayout) findViewById(R.id.license_box)).setVisibility(View.VISIBLE); + TextView licenseView = ((TextView) findViewById(R.id.license)); + licenseView.setText(Html.fromHtml(license), BufferType.SPANNABLE); + licenseView.setClickable(true); + licenseView.setMovementMethod(LinkMovementMethod.getInstance()); + } else { + ((LinearLayout) findViewById(R.id.license_box)).setVisibility(View.GONE); + } + } + if (geo != null) geoUpdate.updateLoc(geo); } @@ -1904,6 +1922,9 @@ public class cgeodetail extends AbstractActivity { if (view == null) { return; } + if (!cache.supportsUserActions()) { + return; + } try { registerForContextMenu(view); |