aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-04-01 19:53:45 +0200
committerSamuel Tardieu <sam@rfc1149.net>2012-04-01 20:00:55 +0200
commite14bda126b991d711ebba4aad0bdba35ea24eb70 (patch)
tree0d18f68db06cd7bb5429be7a993e43c4893b6c93 /main
parent90020ac88804c297bee7cc88bafc47dc99e071bb (diff)
parentc544c021d9e8455fa64874dc8f443f8bcbce2b34 (diff)
downloadcgeo-e14bda126b991d711ebba4aad0bdba35ea24eb70.zip
cgeo-e14bda126b991d711ebba4aad0bdba35ea24eb70.tar.gz
cgeo-e14bda126b991d711ebba4aad0bdba35ea24eb70.tar.bz2
Merge remote-tracking branch 'upstream/release' into upstream
Fixes and features have been implemented on the release branch. Merge them early enough to avoid dealing with huge conflicts later. Conflicts: main/src/cgeo/geocaching/Settings.java main/src/cgeo/geocaching/compatibility/Compatibility.java main/src/cgeo/geocaching/maps/CGeoMap.java
Diffstat (limited to 'main')
-rw-r--r--main/AndroidManifest.xml12
-rw-r--r--main/res/layout/livemapinfo.xml56
-rw-r--r--main/res/values-de/strings.xml7
-rw-r--r--main/res/values-fr/strings.xml3
-rw-r--r--main/res/values-it/strings.xml2
-rw-r--r--main/res/values/strings.xml8
-rw-r--r--main/src/cgeo/geocaching/LiveMapInfo.java55
-rw-r--r--main/src/cgeo/geocaching/Settings.java29
-rw-r--r--main/src/cgeo/geocaching/connector/gc/GCBase.java5
-rw-r--r--main/src/cgeo/geocaching/files/GPXParser.java4
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java12
11 files changed, 173 insertions, 20 deletions
diff --git a/main/AndroidManifest.xml b/main/AndroidManifest.xml
index bcb4fa7..083d59d 100644
--- a/main/AndroidManifest.xml
+++ b/main/AndroidManifest.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- android:versionName="04.01.2012"
- android:versionCode="20120104"
+ android:versionName="RC1 03.2012"
+ android:versionCode="20120323"
package="cgeo.geocaching"
name="c:geo"
android:installLocation="auto">
@@ -227,7 +227,13 @@
android:label="@string/app_name"
android:configChanges="keyboardHidden|orientation" >
</activity>
- <provider android:name="cgeo.geocaching.apps.LocusDataStorageProvider"
+ <activity
+ android:name=".LiveMapInfo"
+ android:label="@string/app_name"
+ android:theme="@style/cgeo_transparent"
+ android:configChanges="keyboardHidden|orientation" >
+ </activity>
+ <provider android:name="cgeo.geocaching.apps.LocusDataStorageProvider"
android:authorities="cgeo.geocaching.apps.locusdatastorageprovider" />
</application>
</manifest>
diff --git a/main/res/layout/livemapinfo.xml b/main/res/layout/livemapinfo.xml
new file mode 100644
index 0000000..66f9da4
--- /dev/null
+++ b/main/res/layout/livemapinfo.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="?background_color_transparent"
+ android:orientation="vertical" >
+
+ <LinearLayout style="@style/action_bar" >
+
+ <TextView style="@style/action_bar_title" />
+ </LinearLayout>
+
+ <ScrollView
+ android:id="@+id/live_map_scroll"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:padding="4dip" >
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/live_map_text"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/live_map_notification"
+ android:textColor="?text_color"
+ android:textSize="14dip" />
+
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" >
+
+ <CheckBox
+ android:id="@+id/live_map_hint_hide"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="left"
+ android:text="@string/live_map_note_dontshow"
+ android:visibility="gone" />
+
+ <Button
+ android:id="@+id/live_map_hint_ok"
+ style="@style/button_small"
+ android:layout_width="60dip"
+ android:layout_alignParentRight="true"
+ android:layout_marginRight="1dip"
+ android:text="@string/live_map_note_close" />
+ </RelativeLayout>
+ </LinearLayout>
+ </ScrollView>
+
+</LinearLayout> \ No newline at end of file
diff --git a/main/res/values-de/strings.xml b/main/res/values-de/strings.xml
index 9f13828..6b8937c 100644
--- a/main/res/values-de/strings.xml
+++ b/main/res/values-de/strings.xml
@@ -657,8 +657,11 @@
<string name="map_strategy_fast">Schnell</string>
<string name="map_strategy_auto">Geschwindigkeitsabhängig</string>
<string name="map_strategy_detailed">Detailliert</string>
-
- <!-- search -->
+ <string name="live_map_notification">Auf der neuen Live-Karte sind die Koordinaten nicht immer genau. Eventuell ungenaue Koordinaten sind mit einem orangen Kreis markiert.\nDas Öffnen der Cache-Details oder das Speichern des Cache liefert immer genaue Koordinaten.\n\nMehr Informationen über alle Änderungen findet ihr auf der \"Über c:geo\"-Seite in der App.</string>
+ <string name="live_map_note_close">Schließen</string>
+ <string name="live_map_note_dontshow">Nicht mehr anzeigen</string>
+
+<!-- search -->
<string name="search_bar_hint">Suche nach Caches</string>
<string name="search_bar_desc">Caches (GC-Code, Stichwort), Trackables (TB-Code)</string>
<string name="search_coordinates">Koordinaten</string>
diff --git a/main/res/values-fr/strings.xml b/main/res/values-fr/strings.xml
index b406ab2..c61d317 100644
--- a/main/res/values-fr/strings.xml
+++ b/main/res/values-fr/strings.xml
@@ -664,6 +664,9 @@
<string name="map_strategy_fast">Rapide</string>
<string name="map_strategy_auto">En fonction du déplacement</string>
<string name="map_strategy_detailed">Détaillée</string>
+ <string name="live_map_notification">Lors de l\'affichage de la carte active, certaines coordonnées de géocaches peuvent être imprécises et sont indiquées par un cercle orange.\nDemander les détails d\'une géocache ou la sauver pour une utilisation hors-ligne récupérera les coordonnées exactes.\n\nVous trouverez plus d\'informations sur les changements sur la page \"À propos de c:geo\".</string>
+ <string name="live_map_note_close">Fermer</string>
+ <string name="live_map_note_dontshow">Ne plus afficher</string>
<!-- search -->
<string name="search_bar_hint">Recherche de caches</string>
diff --git a/main/res/values-it/strings.xml b/main/res/values-it/strings.xml
index 90cde36..81fe7fb 100644
--- a/main/res/values-it/strings.xml
+++ b/main/res/values-it/strings.xml
@@ -908,4 +908,4 @@
<item quantity="one">un minuto fa</item>
<item quantity="other">%d minuti fa</item>
</plurals>
-</resources> \ No newline at end of file
+</resources>
diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml
index 7cdf974..4f4739b 100644
--- a/main/res/values/strings.xml
+++ b/main/res/values/strings.xml
@@ -691,6 +691,10 @@
<string name="map_strategy_fast">Fast</string>
<string name="map_strategy_auto">Speed dependent</string>
<string name="map_strategy_detailed">Detailed</string>
+ <string name="live_map_notification">On the new live map coordinates may not always be precise. Possibly imprecise coordinates are marked by an orange circle.\nOpening the cache details or saving the cache for offline use will always obtain precise coordinates.\n\nMore information on all changes can be found on the \"About c:geo\" page inside the app.</string>
+ <string name="live_map_note_close">Close</string>
+ <string name="live_map_note_dontshow">Do not show again</string>
+
<!-- search -->
<string name="search_bar_hint">Search for caches</string>
@@ -1042,10 +1046,12 @@
<b>Known Limitations/Bugs:</b>\n
· Live map:\n
Approximated coords due to limitations on the GC-website\n
+ Be aware: If navigation is started directly from live map it may also use the approximated coords!\n
In fast mode the cache type might be wrong in rare cases\n
Fast mode only detectes Tradi, Multi, Mystery, Event caches\n
· Other:\n
- Log images with huge size will cause a long loading time\n\n\n
+ Log images with huge size will cause a long loading time\n
+ OSM:Offline does only support map-files with version 0.2.4\n\n\n
<b>Old releases</b>\n
· Please refer to the release notes on the <a href="http://www.cgeo.org">c:geo-website</a>.\n
\n</string>
diff --git a/main/src/cgeo/geocaching/LiveMapInfo.java b/main/src/cgeo/geocaching/LiveMapInfo.java
new file mode 100644
index 0000000..10d14e0
--- /dev/null
+++ b/main/src/cgeo/geocaching/LiveMapInfo.java
@@ -0,0 +1,55 @@
+package cgeo.geocaching;
+
+import cgeo.geocaching.activity.AbstractActivity;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.CheckBox;
+
+public class LiveMapInfo extends AbstractActivity {
+
+ private int showCount;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setTheme(R.style.transparent);
+ setContentView(R.layout.livemapinfo);
+
+ showCount = Settings.getLiveMapHintShowCount();
+
+ if (showCount > 0) {
+ final CheckBox cb = (CheckBox) findViewById(R.id.live_map_hint_hide);
+ cb.setVisibility(View.VISIBLE);
+ }
+
+ final Button closeButton = (Button) findViewById(R.id.live_map_hint_ok);
+ closeButton.setOnClickListener(new View.OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ final CheckBox cb = (CheckBox) findViewById(R.id.live_map_hint_hide);
+ if (cb.isChecked()) {
+ Settings.setHideLiveHint(true);
+ }
+ finish();
+ }
+ });
+
+ Settings.setLiveMapHintShowCount(showCount + 1);
+ }
+
+ @Override
+ protected void onStop() {
+
+ final CheckBox cb = (CheckBox) findViewById(R.id.live_map_hint_hide);
+ if (cb.isChecked()) {
+ Settings.setHideLiveHint(true);
+ }
+
+ super.onStop();
+ }
+
+}
diff --git a/main/src/cgeo/geocaching/Settings.java b/main/src/cgeo/geocaching/Settings.java
index 0f1cbcf..65bae84 100644
--- a/main/src/cgeo/geocaching/Settings.java
+++ b/main/src/cgeo/geocaching/Settings.java
@@ -80,6 +80,8 @@ public final class Settings {
private static final String KEY_DEFAULT_NAVIGATION_TOOL_2 = "defaultNavigationTool2";
private static final String KEY_LIVE_MAP_STRATEGY = "livemapstrategy";
private static final String KEY_DEBUG = "debug";
+ private static final String KEY_HIDE_LIVE_MAP_HINT = "hidelivemaphint";
+ private static final String KEY_LIVE_MAP_HINT_SHOW_COUNT = "livemaphintshowcount";
private final static int unitsMetric = 1;
private final static int unitsImperial = 2;
@@ -1029,4 +1031,31 @@ public final class Settings {
});
}
+ public static boolean getHideLiveMapHint() {
+ return sharedPrefs.getInt(KEY_HIDE_LIVE_MAP_HINT, 0) == 0 ? false : true;
+ }
+
+ public static void setHideLiveHint(final boolean hide) {
+ editSharedSettings(new PrefRunnable() {
+
+ @Override
+ public void edit(Editor edit) {
+ edit.putInt(KEY_HIDE_LIVE_MAP_HINT, hide ? 1 : 0);
+ }
+ });
+ }
+
+ public static int getLiveMapHintShowCount() {
+ return sharedPrefs.getInt(KEY_LIVE_MAP_HINT_SHOW_COUNT, 0);
+ }
+
+ public static void setLiveMapHintShowCount(final int showCount) {
+ editSharedSettings(new PrefRunnable() {
+
+ @Override
+ public void edit(Editor edit) {
+ edit.putInt(KEY_LIVE_MAP_HINT_SHOW_COUNT, showCount);
+ }
+ });
+ }
}
diff --git a/main/src/cgeo/geocaching/connector/gc/GCBase.java b/main/src/cgeo/geocaching/connector/gc/GCBase.java
index cf768b8..871e75a 100644
--- a/main/src/cgeo/geocaching/connector/gc/GCBase.java
+++ b/main/src/cgeo/geocaching/connector/gc/GCBase.java
@@ -110,11 +110,6 @@ public class GCBase {
for (Tile tile : tiles) {
- // testing purpose
- {
- searchResult.setUrl("Zoom=" + tile.getZoomlevel());
- }
-
StringBuilder url = new StringBuilder();
url.append("?x=").append(tile.getX()) // x tile
.append("&y=").append(tile.getY()) // y tile
diff --git a/main/src/cgeo/geocaching/files/GPXParser.java b/main/src/cgeo/geocaching/files/GPXParser.java
index d8d01fe..0a8137e 100644
--- a/main/src/cgeo/geocaching/files/GPXParser.java
+++ b/main/src/cgeo/geocaching/files/GPXParser.java
@@ -278,7 +278,7 @@ public abstract class GPXParser extends FileParser {
// take the name as code, if nothing else is available
if (StringUtils.isBlank(cache.getGeocode())) {
if (StringUtils.isNotBlank(name)) {
- cache.setGeocode(name.trim());
+ cache.setGeocode(name.trim().toUpperCase());
}
}
@@ -312,7 +312,7 @@ public abstract class GPXParser extends FileParser {
fixCache(cache);
if (cache.getName().length() > 2) {
- final String cacheGeocodeForWaypoint = "GC" + cache.getName().substring(2);
+ final String cacheGeocodeForWaypoint = "GC" + cache.getName().substring(2).toUpperCase();
// lookup cache for waypoint in already parsed caches
final cgCache cacheForWaypoint = result.get(cacheGeocodeForWaypoint);
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index 12021db..e424bcc 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -1,6 +1,7 @@
package cgeo.geocaching.maps;
import cgeo.geocaching.IWaypoint;
+import cgeo.geocaching.LiveMapInfo;
import cgeo.geocaching.R;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.Settings;
@@ -225,12 +226,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
}
title.append(']');
}
- // testing purpose
- {
- if (search != null && StringUtils.isNotBlank(search.getUrl())) {
- title.append("[" + search.getUrl() + "]");
- }
- }
ActivityMixin.setTitle(activity, title.toString());
break;
@@ -467,6 +462,11 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
switchMyLocationButton();
prepareFilterBar();
+
+ if (!Settings.getHideLiveMapHint()) {
+ Intent hintIntent = new Intent(activity, LiveMapInfo.class);
+ activity.startActivity(hintIntent);
+ }
}
private void prepareFilterBar() {