diff options
| -rw-r--r-- | main/res/values/strings.xml | 8 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/CacheDetailActivity.java | 24 |
2 files changed, 29 insertions, 3 deletions
diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml index 8e7d6ed..f64ea4d 100644 --- a/main/res/values/strings.xml +++ b/main/res/values/strings.xml @@ -774,7 +774,7 @@ <string name="helper_manual_title">Manual</string> <string name="helper_manual_description">Comprehensive manual for c:geo that contains description of all possibilities of this application (even hidden ones).</string> <string name="helper_calendar_title">c:geo calendar add-on</string> - <string name="helper_calendar_missing">c:geo calendar add-on not installed</string> + <string name="helper_calendar_missing">c:geo calendar add-on not installed.</string> <string name="helper_calendar_description">Enables you to export event caches into the calendar on your device.</string> <string name="helper_locus_title">Locus</string> <string name="helper_locus_description">Simple usable application showing Online maps and allowing to download them directly into Offline mode (raster maps only). Also support track recording, POI handling and many other useful functions.</string> @@ -784,7 +784,11 @@ <string name="helper_bluetoothgps_description">Allows you to use external GPS device to get better reception, more precise location and can spare battery of your phone.</string> <string name="helper_barcode_title">Barcode Scanner</string> <string name="helper_barcode_description">There are Greasemonkey scripts and websites which allow to display a geocode as barcode. With this app c:geo can read that geocode directly from the screen of your computer.</string> - + + <!-- add-ons --> + <string name="addon_missing_title">Missing Add-On</string> + <string name="addon_download_prompt">Get it now from Google Play.</string> + <!-- attributes (permissions -> allowed, not allowed) --> <string name="attribute_dogs_yes">Dogs allowed</string> <string name="attribute_dogs_no">Dogs not allowed</string> diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java index 4649477..349a73f 100644 --- a/main/src/cgeo/geocaching/CacheDetailActivity.java +++ b/main/src/cgeo/geocaching/CacheDetailActivity.java @@ -121,6 +121,8 @@ public class CacheDetailActivity extends AbstractActivity { private static final int CONTEXT_MENU_WAYPOINT_CACHES_AROUND = 1239; private static final int CONTEXT_MENU_WAYPOINT_DEFAULT_NAVIGATION = 1240; + private static final String CALENDAR_ADDON_URI = "market://details?id=cgeo.calendar"; + private cgGeo geolocation; private cgCache cache; private final Progress progress = new Progress(); @@ -814,7 +816,27 @@ public class CacheDetailActivity extends AbstractActivity { startActivity(new Intent(ICalendar.INTENT, Uri.parse(ICalendar.URI_SCHEME + "://" + ICalendar.URI_HOST + "?" + params.toString()))); } else { - showToast(res.getString(R.string.helper_calendar_missing)); + // Inform user the calendar add-on is not installed and let them get it from Google Play + new AlertDialog.Builder(this) + .setTitle(res.getString(R.string.addon_missing_title)) + .setMessage(new StringBuilder(res.getString(R.string.helper_calendar_missing)) + .append(" ") + .append(res.getString(R.string.addon_download_prompt)) + .toString()) + .setPositiveButton(getString(android.R.string.yes), new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setData(Uri.parse(CALENDAR_ADDON_URI)); + startActivity(intent); + } + }) + .setNegativeButton(getString(android.R.string.no), new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + dialog.cancel(); + } + }) + .create() + .show(); } } |
