aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2012-03-30 23:38:39 +0200
committerrsudev <rasch@munin-soft.de>2012-03-30 23:38:39 +0200
commitef0ca671bf6be797c1863df923ab4e1de5ccdbcc (patch)
tree5aba1a1a8e960e341428a54f6b0d7876af095eea /main
parent5da34a1b4ae61d7fd34cd32f56a0eaa88caad4c5 (diff)
downloadcgeo-ef0ca671bf6be797c1863df923ab4e1de5ccdbcc.zip
cgeo-ef0ca671bf6be797c1863df923ab4e1de5ccdbcc.tar.gz
cgeo-ef0ca671bf6be797c1863df923ab4e1de5ccdbcc.tar.bz2
Live map info popup
Diffstat (limited to 'main')
-rw-r--r--main/AndroidManifest.xml8
-rw-r--r--main/res/layout/livemapinfo.xml56
-rw-r--r--main/res/values/strings.xml4
-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/maps/CGeoMap.java6
6 files changed, 157 insertions, 1 deletions
diff --git a/main/AndroidManifest.xml b/main/AndroidManifest.xml
index 45307be..5bde2c7 100644
--- a/main/AndroidManifest.xml
+++ b/main/AndroidManifest.xml
@@ -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/strings.xml b/main/res/values/strings.xml
index 727a8fa..4f95004 100644
--- a/main/res/values/strings.xml
+++ b/main/res/values/strings.xml
@@ -687,6 +687,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 are not always precise.\nPossibly imprecise coordinates are marked by an orange circle. Opening the cache details will always obtain precise coordinates.\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>
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 4949b62..cfce499 100644
--- a/main/src/cgeo/geocaching/Settings.java
+++ b/main/src/cgeo/geocaching/Settings.java
@@ -79,6 +79,8 @@ public final class Settings {
private static final String KEY_DEFAULT_NAVIGATION_TOOL = "defaultNavigationTool";
private static final String KEY_DEFAULT_NAVIGATION_TOOL_2 = "defaultNavigationTool2";
private static final String KEY_LIVE_MAP_STRATEGY = "livemapstrategy";
+ 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;
@@ -1015,4 +1017,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/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index 73c5673..d106f02 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -1,5 +1,6 @@
package cgeo.geocaching.maps;
+import cgeo.geocaching.LiveMapInfo;
import cgeo.geocaching.R;
import cgeo.geocaching.SearchResult;
import cgeo.geocaching.Settings;
@@ -461,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() {