diff options
author | Bananeweizen <Bananeweizen@gmx.de> | 2012-08-19 08:14:37 +0200 |
---|---|---|
committer | Bananeweizen <Bananeweizen@gmx.de> | 2012-08-19 11:47:17 +0200 |
commit | 59a962c3c92bba382295b3b7df055d18bed3e827 (patch) | |
tree | 4798ac36fc48262e4aa6adf49ddad47a74e04a59 /main/src/cgeo/geocaching/apps/cache | |
parent | b95a66609cef2ae0e80514702385f9333d8be929 (diff) | |
download | cgeo-59a962c3c92bba382295b3b7df055d18bed3e827.zip cgeo-59a962c3c92bba382295b3b7df055d18bed3e827.tar.gz cgeo-59a962c3c92bba382295b3b7df055d18bed3e827.tar.bz2 |
fix #1963: Include "Cache Beacon" in apps
Diffstat (limited to 'main/src/cgeo/geocaching/apps/cache')
-rw-r--r-- | main/src/cgeo/geocaching/apps/cache/CacheBeaconApp.java | 21 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/apps/cache/GeneralAppsFactory.java | 7 |
2 files changed, 26 insertions, 2 deletions
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; } |