aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-12-08 11:06:36 +0100
committerBananeweizen <bananeweizen@gmx.de>2013-12-08 11:06:36 +0100
commit2da59992fc2af8d1fb4f9da28fbd5641a2b2b665 (patch)
tree562f0ae7b496057e0bb6c50f62a6d889a8859b91
parent9d4929006421bf225e0f564ad25d1cf78aa63b06 (diff)
downloadcgeo-2da59992fc2af8d1fb4f9da28fbd5641a2b2b665.zip
cgeo-2da59992fc2af8d1fb4f9da28fbd5641a2b2b665.tar.gz
cgeo-2da59992fc2af8d1fb4f9da28fbd5641a2b2b665.tar.bz2
new: have send2cgeo in usefull apps
-rw-r--r--main/res/values/strings.xml2
-rw-r--r--main/src/cgeo/geocaching/UsefulAppsActivity.java8
2 files changed, 8 insertions, 2 deletions
diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml
index 817ff77..da7699a 100644
--- a/main/res/values/strings.xml
+++ b/main/res/values/strings.xml
@@ -912,6 +912,8 @@
<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_description">Enables you to export event caches to the calendar on your device.</string>
+ <string name="helper_sendtocgeo_title">Send to c:geo</string>
+ <string name="helper_sendtocgeo_description">Send to c:geo is a browser extension <strong>for your PC</strong>. When browsing geocaching.com, you can send caches to your smartphone with the click of a button directly inside the browser.</string>
<string name="helper_locus_title">Locus</string>
<string name="helper_locus_description">Simple, usable application which shows online maps and allows you to download them directly into Offline mode (raster maps only). Also supports track recording, POI handling and many other useful functions.</string>
<string name="helper_gpsstatus_title">GPS Status</string>
diff --git a/main/src/cgeo/geocaching/UsefulAppsActivity.java b/main/src/cgeo/geocaching/UsefulAppsActivity.java
index c0f2d6f..c70143f 100644
--- a/main/src/cgeo/geocaching/UsefulAppsActivity.java
+++ b/main/src/cgeo/geocaching/UsefulAppsActivity.java
@@ -10,6 +10,7 @@ import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
+import android.text.Html;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
@@ -46,7 +47,9 @@ public class UsefulAppsActivity extends AbstractActivity {
private void installFromMarket(Activity activity) {
try {
- Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
+ // allow also opening pure http URLs in addition to market packages
+ final String url = (packageName.startsWith("http:")) ? packageName : "market://details?id=" + packageName;
+ final Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
marketIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
activity.startActivity(marketIntent);
@@ -58,6 +61,7 @@ public class UsefulAppsActivity extends AbstractActivity {
private static final HelperApp[] HELPER_APPS = {
new HelperApp(R.string.helper_calendar_title, R.string.helper_calendar_description, R.drawable.cgeo, "cgeo.calendar"),
+ new HelperApp(R.string.helper_sendtocgeo_title, R.string.helper_sendtocgeo_description, R.drawable.cgeo, "http://send2.cgeo.org"),
new HelperApp(R.string.helper_pocketquery_title, R.string.helper_pocketquery_description, R.drawable.helper_pocketquery, "org.pquery"),
new HelperApp(R.string.helper_locus_title, R.string.helper_locus_description, R.drawable.helper_locus, "menion.android.locus"),
new HelperApp(R.string.helper_google_translate_title, R.string.helper_google_translate_description, R.drawable.helper_google_translate, "com.google.android.apps.translate"),
@@ -92,7 +96,7 @@ public class UsefulAppsActivity extends AbstractActivity {
private void fillViewHolder(ViewHolder holder, HelperApp app) {
holder.title.setText(res.getString(app.titleId));
holder.image.setImageDrawable(res.getDrawable(app.iconId));
- holder.description.setText(res.getString(app.descriptionId));
+ holder.description.setText(Html.fromHtml(res.getString(app.descriptionId)));
}
});