diff options
| -rw-r--r-- | cgeo-calendar/AndroidManifest.xml | 4 | ||||
| -rw-r--r-- | main/res/values-cs/strings.xml | 4 | ||||
| -rw-r--r-- | main/res/values/strings.xml | 29 | ||||
| -rw-r--r-- | main/res/xml/searchable.xml | 4 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/apps/cache/CacheBeaconApp.java | 21 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java | 7 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/cgCache.java | 19 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/cgeotrackable.java | 2 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/enumerations/CacheAttribute.java | 4 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 2 |
10 files changed, 64 insertions, 32 deletions
diff --git a/cgeo-calendar/AndroidManifest.xml b/cgeo-calendar/AndroidManifest.xml index cd9da52..b76a6d4 100644 --- a/cgeo-calendar/AndroidManifest.xml +++ b/cgeo-calendar/AndroidManifest.xml @@ -2,8 +2,8 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" name="c:geo - calendar (add-on)" package="cgeo.calendar" - android:versionCode="1" - android:versionName="1.0" > + android:versionCode="2" + android:versionName="1.1" > <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8"/> diff --git a/main/res/values-cs/strings.xml b/main/res/values-cs/strings.xml index a253313..d798658 100644 --- a/main/res/values-cs/strings.xml +++ b/main/res/values-cs/strings.xml @@ -52,13 +52,14 @@ <string name="log_attend">Zúčastní se</string> <string name="log_attended">Účastnil se</string> <string name="log_retrieved">Vytažen z keše</string> + <string name="log_placed">Umístěn</string> <string name="log_grabbed">Převzat</string> <string name="log_maintained">Udržována</string> <string name="log_maintenance_needed">Vyžaduje údržbu</string> <string name="log_update">Změna souřadnic</string> <string name="log_archived">Archivace</string> <string name="log_needs_archived">Vyžaduje archivaci</string> - <string name="log_discovered">Nalezen</string> + <string name="log_discovered">Viděn</string> <string name="log_reviewed">Poznámka kontroly</string> <string name="log_tb_nothing">Beze změny</string> <string name="log_tb_visit">Návštěva</string> @@ -598,6 +599,7 @@ <string name="trackable_origin">Původ</string> <string name="trackable_unknown">Neznámý</string> <string name="trackable_released">Vypuštění</string> + <string name="trackable_distance">Nacestoval</string> <string name="trackable_touch">Dotyk</string> <!-- navigation --> diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml index 8c3a343..17a12e4 100644 --- a/main/res/values/strings.xml +++ b/main/res/values/strings.xml @@ -577,6 +577,7 @@ <string name="cache_menu_gcc">GCC</string> <string name="cache_menu_whereyougo">WhereYouGo</string> <string name="cache_menu_oruxmaps">OruxMaps</string> + <string name="cache_menu_cachebeacon">Cache Beacon</string> <string name="cache_status">Status</string> <string name="cache_status_offline_log">Saved Log</string> <string name="cache_status_found">Found</string> @@ -1078,34 +1079,12 @@ <string name="changelog">\n <b>Next release</b>\n\n <b>New Features/Functions:</b>\n - · Sort by found date in lists\n - · Title of archived caches now shown in red\n - · Display cache size and D/T-rating in compass\n - · Try to get event cache starting time and use it for calendar entry\n - · Titlebar in lists also shows number of filtered caches\n - · Selectable GPX export directory\n - · Live mode can now be activated after mapping search results\n - This allows to start the live map at an user defined location\n + · If static maps are enabled, batch update of caches will now update caches without static maps first\n \n <b>Bugfixing:</b>\n - · Show as list from live map corrected to display the correct caches\n - · GPX import/export improvements\n - · Export URLs in GPX export\n - · Use last known location on startup\n - · Show spoiler images for owned caches\n - · Sort file names in GPX import list\n - · Corrected owner name display with special characters\n - · Cancel operations only if cancel is clicked\n - · Corrected logbook statistic for event caches\n - · Coordinate conversion to DMS corrected\n - · Use last known location if no GPS-signal is present\n - · Store for offline from map always available\n - · Do not show waypoints on map if the relevant cache is filtered out\n - · Limit for waypoints on live map now applied correctly\n - · Link to spoiler pictures was missing if the extension is jpeg\n - · Adapted to changes on geocaching.com regarding login problems\n + · Improvement for cache description translation\n \n - <a href="https://github.com/cgeo/c-geo-opensource/issues?milestone=7&state=closed">Detailed list of all changes</a>\n + <a href="https://github.com/cgeo/c-geo-opensource/issues?milestone=8&state=closed">Detailed list of all changes</a>\n \n <b>Known Limitations/Bugs:</b>\n · Live map:\n diff --git a/main/res/xml/searchable.xml b/main/res/xml/searchable.xml index b11d6bc..b2696b6 100644 --- a/main/res/xml/searchable.xml +++ b/main/res/xml/searchable.xml @@ -4,5 +4,7 @@ android:hint="@string/search_bar_hint" android:searchSettingsDescription="@string/search_bar_desc" android:includeInGlobalSearch="true" - android:voiceSearchMode="showVoiceSearchButton|launchRecognizer" > + android:voiceSearchMode="showVoiceSearchButton|launchRecognizer" + android:inputType="textNoSuggestions" + android:imeOptions="actionSearch"> </searchable>
\ No newline at end of file diff --git a/main/src/cgeo/geocaching/apps/cache/CacheBeaconApp.java b/main/src/cgeo/geocaching/apps/cache/CacheBeaconApp.java new file mode 100644 index 0000000..6e7cdca --- /dev/null +++ b/main/src/cgeo/geocaching/apps/cache/CacheBeaconApp.java @@ -0,0 +1,21 @@ +package cgeo.geocaching.apps.cache; + +import cgeo.geocaching.R; +import cgeo.geocaching.cgCache; +import cgeo.geocaching.enumerations.CacheAttribute; + +public class CacheBeaconApp extends AbstractGeneralApp { + + protected CacheBeaconApp() { + super(getString(R.string.cache_menu_cachebeacon), "de.fun2code.android.cachebeacon"); + } + + @Override + public boolean isEnabled(cgCache cache) { + if (cache == null) { + return false; + } + return cache.hasAttribute(CacheAttribute.WIRELESS_BEACON, true); + } + +} diff --git a/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java b/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java index 98e7db8..57eb957 100644 --- a/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java +++ b/main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java @@ -15,8 +15,11 @@ public final class GeneralAppsFactory extends AbstractAppFactory { private static GeneralApp[] getGeneralApps() { if (ArrayUtils.isEmpty(apps)) { - apps = new GeneralApp[] { new GccApp(), - new WhereYouGoApp() }; + apps = new GeneralApp[] { + new CacheBeaconApp(), + new GccApp(), + new WhereYouGoApp() + }; } return apps; } diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java index b8590e5..cd4e15c 100644 --- a/main/src/cgeo/geocaching/cgCache.java +++ b/main/src/cgeo/geocaching/cgCache.java @@ -10,9 +10,11 @@ import cgeo.geocaching.connector.capability.ISearchByGeocode; import cgeo.geocaching.connector.gc.GCConnector; import cgeo.geocaching.connector.gc.GCConstants; import cgeo.geocaching.connector.gc.Tile; +import cgeo.geocaching.enumerations.CacheAttribute; import cgeo.geocaching.enumerations.CacheSize; import cgeo.geocaching.enumerations.CacheType; import cgeo.geocaching.enumerations.LoadFlags; +import cgeo.geocaching.enumerations.LoadFlags.LoadFlag; import cgeo.geocaching.enumerations.LoadFlags.RemoveFlag; import cgeo.geocaching.enumerations.LoadFlags.SaveFlag; import cgeo.geocaching.enumerations.LogType; @@ -1591,4 +1593,21 @@ public class cgCache implements ICache, IWaypoint { } return null; } + + /** + * check whether the cache has a given attribute + * + * @param attribute + * @param yes + * true if we are looking for the attribute_yes version, false for the attribute_no version + * @return + */ + public boolean hasAttribute(CacheAttribute attribute, boolean yes) { + // lazy loading of attributes + cgCache fullCache = cgeoapplication.getInstance().loadCache(getGeocode(), EnumSet.of(LoadFlag.LOAD_ATTRIBUTES)); + if (fullCache == null) { + fullCache = this; + } + return fullCache.getAttributes().contains(attribute.getAttributeName(yes)); + } }
\ No newline at end of file diff --git a/main/src/cgeo/geocaching/cgeotrackable.java b/main/src/cgeo/geocaching/cgeotrackable.java index acd351d..3cdc58d 100644 --- a/main/src/cgeo/geocaching/cgeotrackable.java +++ b/main/src/cgeo/geocaching/cgeotrackable.java @@ -395,7 +395,7 @@ public class cgeotrackable extends AbstractActivity { @Override public boolean onPrepareOptionsMenu(Menu menu) { - menu.findItem(MENU_LOG_TOUCH).setEnabled(trackable.isLoggable()); + menu.findItem(MENU_LOG_TOUCH).setEnabled(StringUtils.isNotBlank(geocode) && trackable.isLoggable()); menu.findItem(MENU_BROWSER_TRACKABLE).setEnabled(StringUtils.isNotBlank(trackable.getUrl())); return super.onPrepareOptionsMenu(menu); } diff --git a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java index 6456f71..a31b0cc 100644 --- a/main/src/cgeo/geocaching/enumerations/CacheAttribute.java +++ b/main/src/cgeo/geocaching/enumerations/CacheAttribute.java @@ -137,4 +137,8 @@ public enum CacheAttribute { public static boolean isEnabled(final String attributeName) { return !StringUtils.endsWithIgnoreCase(attributeName, INTERNAL_NO); } + + public String getAttributeName(final boolean yes) { + return gcRawName + (yes ? INTERNAL_YES : INTERNAL_NO); + } } diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index c4d2192..d2910c4 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -389,6 +389,8 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto waypointTypeIntent = WaypointType.findById(extras.getString(EXTRAS_WPTTYPE)); mapStateIntent = extras.getIntArray(EXTRAS_MAPSTATE); mapTitle = extras.getString(EXTRAS_MAP_TITLE); + + Settings.setLiveMap(mapMode == MapMode.LIVE_ONLINE ? true : false); } else { mapMode = Settings.isLiveMap() ? MapMode.LIVE_ONLINE : MapMode.LIVE_OFFLINE; |
