diff options
| author | YraFyra <yrafyra@gmail.com> | 2013-01-11 15:43:53 +0100 |
|---|---|---|
| committer | YraFyra <yrafyra@gmail.com> | 2013-01-11 15:43:53 +0100 |
| commit | ae5b7cfd8c9e4e20e46b3ba3eb876f54af6ef906 (patch) | |
| tree | fa11630152437fc01eecb477c2bfdf4bd2055cef /main/src | |
| parent | 884a60814d1a72ca30e9e9b0e31d59e895b2aca0 (diff) | |
| download | cgeo-ae5b7cfd8c9e4e20e46b3ba3eb876f54af6ef906.zip cgeo-ae5b7cfd8c9e4e20e46b3ba3eb876f54af6ef906.tar.gz cgeo-ae5b7cfd8c9e4e20e46b3ba3eb876f54af6ef906.tar.bz2 | |
Possibility to copy gc-code and cache name
Added possibility to long-click on cache name or gc-code to copy (or share)
those strings.
Diffstat (limited to 'main/src')
| -rw-r--r-- | main/src/cgeo/geocaching/CacheDetailActivity.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java index 634eea6..7c6f0b9 100644 --- a/main/src/cgeo/geocaching/CacheDetailActivity.java +++ b/main/src/cgeo/geocaching/CacheDetailActivity.java @@ -337,9 +337,10 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc final int viewId = view.getId(); contextMenuWPIndex = -1; switch (viewId) { - case R.id.value: // coordinates + case R.id.value: // coordinates, gc-code, name clickedItemText = ((TextView) view).getText(); - buildOptionsContextmenu(menu, viewId, res.getString(R.string.cache_coordinates), true); + String itemTitle = (String) ((TextView) ((View) view.getParent()).findViewById(R.id.name)).getText(); + buildOptionsContextmenu(menu, viewId, itemTitle, true); break; case R.id.shortdesc: clickedItemText = ((TextView) view).getText(); @@ -1121,10 +1122,10 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc span.setSpan(new ForegroundColorSpan(res.getColor(R.color.archived_cache_color)), 0, span.toString().length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } - details.add(R.string.cache_name, span); + registerForContextMenu(details.add(R.string.cache_name, span)); details.add(R.string.cache_type, cache.getType().getL10n()); details.addSize(cache); - details.add(R.string.cache_geocode, cache.getGeocode()); + registerForContextMenu(details.add(R.string.cache_geocode, cache.getGeocode())); details.addCacheState(cache); details.addDistance(cache, cacheDistanceView); |
