aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2015-03-26 15:08:28 +0100
committerrsudev <rasch@munin-soft.de>2015-03-26 15:08:28 +0100
commit3ca1d689f049ca166cdac40ac284b6be29e6f9c0 (patch)
treea864c97089a0087a217887e385d2c7eee7e0b5c2 /main
parent630df8f8bf9678b8d616ec6389e10a1b1bf8f23b (diff)
downloadcgeo-3ca1d689f049ca166cdac40ac284b6be29e6f9c0.zip
cgeo-3ca1d689f049ca166cdac40ac284b6be29e6f9c0.tar.gz
cgeo-3ca1d689f049ca166cdac40ac284b6be29e6f9c0.tar.bz2
Fixes #4757, Add menu icon for showing hint in compass/cache map
Diffstat (limited to 'main')
-rw-r--r--main/project/rawimages/new-idea-modified.svg76
-rw-r--r--main/project/rawimages/noun_104277_cc.svg26
-rw-r--r--main/res/drawable-hdpi/ic_menu_hint.pngbin0 -> 1228 bytes
-rw-r--r--main/res/drawable-mdpi/ic_menu_hint.pngbin0 -> 795 bytes
-rw-r--r--main/res/drawable-xhdpi/ic_menu_hint.pngbin0 -> 1686 bytes
-rw-r--r--main/res/drawable-xxhdpi/ic_menu_hint.pngbin0 -> 2547 bytes
-rw-r--r--main/res/menu/compass_activity_options.xml11
-rw-r--r--main/res/menu/map_activity.xml1
-rw-r--r--main/res/values/strings.xml2
-rw-r--r--main/res/values/strings_not_translatable.xml1
-rw-r--r--main/src/cgeo/geocaching/CompassActivity.java12
11 files changed, 124 insertions, 5 deletions
diff --git a/main/project/rawimages/new-idea-modified.svg b/main/project/rawimages/new-idea-modified.svg
new file mode 100644
index 0000000..71e0966
--- /dev/null
+++ b/main/project/rawimages/new-idea-modified.svg
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ x="0px"
+ y="0px"
+ viewBox="4.5 -9.0 90.0 121.5"
+ enable-background="new 0 0 90 90"
+ xml:space="preserve"
+ height="100px"
+ width="100px"
+ id="svg2"
+ inkscape:version="0.48.5 r10040"
+ sodipodi:docname="new-idea-modified.svg"
+ inkscape:export-filename="/home/rainer/Desktop/dev/android/cgeo_os/c-geo-opensource/main/project/rawimages/ic_menu_hint.png"
+ inkscape:export-xdpi="39.369999"
+ inkscape:export-ydpi="39.369999"><metadata
+ id="metadata37"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs35" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1878"
+ inkscape:window-height="1060"
+ id="namedview33"
+ showgrid="false"
+ inkscape:zoom="2.36"
+ inkscape:cx="-0.42372881"
+ inkscape:cy="50"
+ inkscape:window-x="-2"
+ inkscape:window-y="-3"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2" /><switch
+ id="switch4"
+ transform="translate(6.1779661,6.1779661)"><foreignObject
+ requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/"
+ x="0"
+ y="0"
+ width="1"
+ height="1"
+ id="foreignObject6" /><g
+ i:extraneous="self"
+ id="g8"><g
+ id="Слой_1"><g
+ id="g11"><path
+ d="M 39,68.1 C 23.9,68.1 11.7,55.2 11.7,39.3 11.7,23.4 23.9,10.5 39,10.5 c 15.1,0 27.3,12.9 27.3,28.8 0,15.9 -12.2,28.8 -27.3,28.8 z m 0,-52.6 c -12.3,0 -22.3,10.7 -22.3,23.8 0,13.1 10,23.8 22.3,23.8 12.3,0 22.3,-10.7 22.3,-23.8 0,-13.1 -10,-23.8 -22.3,-23.8 z"
+ id="path13"
+ inkscape:connector-curvature="0" /></g><g
+ id="g15"><path
+ d="M 2.8,89.7 C 2.5,89.7 2.2,89.6 1.9,89.5 0.6,89 0,87.5 0.5,86.3 3.6,78.5 8.9,72 15.8,67.3 l 1.5,-1 1.4,1.1 c 6.3,4.6 13.7,7.1 21.6,7.1 7.3,0 14.4,-2.2 20.4,-6.3 l 1.5,-1 1.4,1.1 c 6.3,4.6 11.1,10.9 14,18.1 0.5,1.3 -0.1,2.7 -1.4,3.2 -1.3,0.5 -2.7,-0.1 -3.2,-1.4 -2.3,-5.8 -6.1,-11 -10.9,-14.9 -6.5,4 -14,6.2 -21.7,6.2 -8.3,0 -16.2,-2.4 -23,-7 C 12,76.5 7.9,82 5.3,88.3 4.7,89.1 3.8,89.7 2.8,89.7 z"
+ id="path17"
+ inkscape:connector-curvature="0" /></g><g
+ id="g19"><path
+ d="M 81.6,37.5 H 74.5 C 73.7,37.5 73,36.8 73,36 c 0,-0.8 0.7,-1.5 1.5,-1.5 h 7.1 c 0.8,0 1.5,0.7 1.5,1.5 0,0.8 -0.7,1.5 -1.5,1.5 z"
+ id="path21"
+ inkscape:connector-curvature="0" /></g><g
+ id="g23"><path
+ d="m 79.3,31.9 h -2 c -2.7,0 -4.8,-2.2 -4.8,-4.8 V 22.4 C 68.9,20.3 67,17.1 67,13 67,6.4 72,1 78.1,1 c 6.1,0 11.1,5.4 11.1,12 0,3.8 -1.7,6.9 -5,9.1 v 5.1 c -0.1,2.5 -2.3,4.7 -4.9,4.7 z M 78,4.9 c -3.9,0 -7.1,3.6 -7.1,8 0,3 1.4,5 4.3,6.4 l 1.1,0.5 V 27 c 0,0.4 0.4,0.8 0.8,0.8 h 2 c 0.4,0 0.8,-0.4 0.8,-0.8 v -7.3 l 1,-0.6 c 2.7,-1.5 3.9,-3.4 3.9,-6.2 0.3,-4.4 -2.9,-8 -6.8,-8 z"
+ id="path25"
+ inkscape:connector-curvature="0" /></g></g><g
+ id="Слой_2" /><g
+ id="Слой_3" /></g></switch></svg> \ No newline at end of file
diff --git a/main/project/rawimages/noun_104277_cc.svg b/main/project/rawimages/noun_104277_cc.svg
new file mode 100644
index 0000000..cf0efbb
--- /dev/null
+++ b/main/project/rawimages/noun_104277_cc.svg
@@ -0,0 +1,26 @@
+<svg xmlns:x="http://ns.adobe.com/Extensibility/1.0/" xmlns:i="http://ns.adobe.com/AdobeIllustrator/10.0/" xmlns:graph="http://ns.adobe.com/Graphs/1.0/" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="4.5 -9.0 90.0 121.5" enable-background="new 0 0 90 90" xml:space="preserve" height="100px" width="100px">
+<switch>
+ <foreignObject requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/" x="0" y="0" width="1" height="1">
+ </foreignObject>
+ <g i:extraneous="self">
+ <g id="&#1057;&#1083;&#1086;&#1081;_1">
+ <g>
+ <path d="M39,68.1c-15.1,0-27.3-12.9-27.3-28.8S23.9,10.5,39,10.5c15.1,0,27.3,12.9,27.3,28.8S54.1,68.1,39,68.1z M39,15.5 c-12.3,0-22.3,10.7-22.3,23.8c0,13.1,10,23.8,22.3,23.8c12.3,0,22.3-10.7,22.3-23.8C61.3,26.2,51.3,15.5,39,15.5z"/>
+ </g>
+ <g>
+ <path d="M2.8,89.7c-0.3,0-0.6-0.1-0.9-0.2c-1.3-0.5-1.9-2-1.4-3.2c3.1-7.8,8.4-14.3,15.3-19l1.5-1l1.4,1.1 c6.3,4.6,13.7,7.1,21.6,7.1c7.3,0,14.4-2.2,20.4-6.3l1.5-1l1.4,1.1c6.3,4.6,11.1,10.9,14,18.1c0.5,1.3-0.1,2.7-1.4,3.2 c-1.3,0.5-2.7-0.1-3.2-1.4c-2.3-5.8-6.1-11-10.9-14.9c-6.5,4-14,6.2-21.7,6.2c-8.3,0-16.2-2.4-23-7c-5.4,4-9.5,9.5-12.1,15.8 C4.7,89.1,3.8,89.7,2.8,89.7z"/>
+ </g>
+ <g>
+ <path d="M81.6,37.5h-7.1c-0.8,0-1.5-0.7-1.5-1.5s0.7-1.5,1.5-1.5h7.1c0.8,0,1.5,0.7,1.5,1.5S82.4,37.5,81.6,37.5z"/>
+ </g>
+ <g>
+ <path d="M79.3,31.9h-2c-2.7,0-4.8-2.2-4.8-4.8v-4.7c-3.6-2.1-5.5-5.3-5.5-9.4c0-6.6,5-12,11.1-12s11.1,5.4,11.1,12 c0,3.8-1.7,6.9-5,9.1v5.1C84.1,29.7,81.9,31.9,79.3,31.9z M78,4.9c-3.9,0-7.1,3.6-7.1,8c0,3,1.4,5,4.3,6.4l1.1,0.5v7.2 c0,0.4,0.4,0.8,0.8,0.8h2c0.4,0,0.8-0.4,0.8-0.8v-7.3l1-0.6c2.7-1.5,3.9-3.4,3.9-6.2C85.1,8.5,81.9,4.9,78,4.9z"/>
+ </g>
+ </g>
+ <g id="&#1057;&#1083;&#1086;&#1081;_2">
+ </g>
+ <g id="&#1057;&#1083;&#1086;&#1081;_3">
+ </g>
+ </g>
+</switch>
+<text x="0.0" y="105.75" font-size="4.5" font-weight="bold" font-family="Helvetica Neue, Helvetica, Arial-Unicode, Arial, Sans-serif" fill="#000000">Created by Artem Korotkikh</text><text x="0.0" y="110.25" font-size="4.5" font-weight="bold" font-family="Helvetica Neue, Helvetica, Arial-Unicode, Arial, Sans-serif" fill="#000000">from the Noun Project</text></svg> \ No newline at end of file
diff --git a/main/res/drawable-hdpi/ic_menu_hint.png b/main/res/drawable-hdpi/ic_menu_hint.png
new file mode 100644
index 0000000..1b3c7ad
--- /dev/null
+++ b/main/res/drawable-hdpi/ic_menu_hint.png
Binary files differ
diff --git a/main/res/drawable-mdpi/ic_menu_hint.png b/main/res/drawable-mdpi/ic_menu_hint.png
new file mode 100644
index 0000000..e9cfcd6
--- /dev/null
+++ b/main/res/drawable-mdpi/ic_menu_hint.png
Binary files differ
diff --git a/main/res/drawable-xhdpi/ic_menu_hint.png b/main/res/drawable-xhdpi/ic_menu_hint.png
new file mode 100644
index 0000000..0c39096
--- /dev/null
+++ b/main/res/drawable-xhdpi/ic_menu_hint.png
Binary files differ
diff --git a/main/res/drawable-xxhdpi/ic_menu_hint.png b/main/res/drawable-xxhdpi/ic_menu_hint.png
new file mode 100644
index 0000000..c0c2ce3
--- /dev/null
+++ b/main/res/drawable-xxhdpi/ic_menu_hint.png
Binary files differ
diff --git a/main/res/menu/compass_activity_options.xml b/main/res/menu/compass_activity_options.xml
index d3887af..742ebad 100644
--- a/main/res/menu/compass_activity_options.xml
+++ b/main/res/menu/compass_activity_options.xml
@@ -3,14 +3,15 @@
xmlns:app="http://schemas.android.com/apk/res-auto" >
<item
- android:id="@+id/menu_map"
- android:icon="@drawable/ic_menu_mapmode"
- android:title="@string/caches_on_map"
+ android:id="@+id/menu_hint"
+ android:icon="@drawable/ic_menu_hint"
+ android:title="@string/cache_hint"
app:showAsAction="ifRoom|withText">
</item>
<item
- android:id="@+id/menu_hint"
- android:title="@string/cache_hint"
+ android:id="@+id/menu_map"
+ android:icon="@drawable/ic_menu_mapmode"
+ android:title="@string/caches_on_map"
app:showAsAction="ifRoom|withText">
</item>
<item
diff --git a/main/res/menu/map_activity.xml b/main/res/menu/map_activity.xml
index 4a97c0a..27e3840 100644
--- a/main/res/menu/map_activity.xml
+++ b/main/res/menu/map_activity.xml
@@ -31,6 +31,7 @@
</item>
<item
android:id="@+id/menu_hint"
+ android:icon="@drawable/ic_menu_hint"
android:title="@string/cache_hint"
android:visible="false"
app:showAsAction="ifRoom|withText">
diff --git a/main/res/values/strings.xml b/main/res/values/strings.xml
index 68f2014..1d551e9 100644
--- a/main/res/values/strings.xml
+++ b/main/res/values/strings.xml
@@ -1319,6 +1319,8 @@
<string name="showcase_main_text">c:geo now places menu items in the title bar like other modern apps. Some items are hidden behind the dotted symbol. Long press a button to see its description.</string>
<string name="showcase_cachelist_title">Switching lists</string>
<string name="showcase_cachelist_text">You can switch between your geocache lists by clicking the title of the list.</string>
+ <string name="showcase_compass_hint_title">Show the hint</string>
+ <string name="showcase_compass_hint_text">This new menu item might give you an idea where to find the cache - it shows the hint, if available.</string>
<string name="confirm_log_title">Unusual log type</string>
<string name="confirm_log_message">You want to log \'%s\'. Are you sure?</string>
</resources>
diff --git a/main/res/values/strings_not_translatable.xml b/main/res/values/strings_not_translatable.xml
index d699f62..d216715 100644
--- a/main/res/values/strings_not_translatable.xml
+++ b/main/res/values/strings_not_translatable.xml
@@ -76,6 +76,7 @@
· <a href="http://code.google.com/p/mapsforge/">Mapsforge</a> (OSM-rendering)\n
· <a href="http://thenounproject.com/">The Noun Project</a> (basis for attribute icons):\n
&#160;&#160;&#160;· USB by Kenneth Von Alt from The Noun Project\n
+ &#160;&#160;&#160;· new-idea by Artem Korotkikh from The Noun Project\n
· <a href="http://commons.apache.org/">The Apache Commons Project</a>\n
· <a href="http://androidicons.com/">Android Icons</a> (<a href="https://creativecommons.org/licenses/by/3.0/">CC-BY 3.0</a>)\n
· <a href="http://rrze-icon-set.berlios.de/index.html">RRZE Icon set</a> (<a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA 3.0</a>)\n
diff --git a/main/src/cgeo/geocaching/CompassActivity.java b/main/src/cgeo/geocaching/CompassActivity.java
index d481d58..912ca5c 100644
--- a/main/src/cgeo/geocaching/CompassActivity.java
+++ b/main/src/cgeo/geocaching/CompassActivity.java
@@ -4,6 +4,7 @@ import butterknife.ButterKnife;
import butterknife.InjectView;
import cgeo.geocaching.activity.AbstractActionBarActivity;
+import cgeo.geocaching.activity.ShowcaseViewBuilder;
import cgeo.geocaching.enumerations.LoadFlags;
import cgeo.geocaching.location.Geopoint;
import cgeo.geocaching.location.Units;
@@ -20,6 +21,8 @@ import cgeo.geocaching.utils.AngleUtils;
import cgeo.geocaching.utils.Formatter;
import cgeo.geocaching.utils.Log;
+import com.github.amlcurran.showcaseview.targets.ActionItemTarget;
+
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
@@ -103,6 +106,8 @@ public class CompassActivity extends AbstractActionBarActivity {
// make sure we can control the TTS volume
setVolumeControlStream(AudioManager.STREAM_MUSIC);
+
+ presentShowcase();
}
@Override
@@ -226,6 +231,13 @@ public class CompassActivity extends AbstractActionBarActivity {
return super.onOptionsItemSelected(item);
}
+ @Override
+ public ShowcaseViewBuilder getShowcase() {
+ return new ShowcaseViewBuilder(this)
+ .setTarget(new ActionItemTarget(this, R.id.menu_hint))
+ .setContent(R.string.showcase_compass_hint_title, R.string.showcase_compass_hint_text);
+ }
+
private void setTarget(@NonNull final Geopoint coords, final String newDescription) {
setDestCoords(coords);
setTargetDescription(newDescription);