From 3ca1d689f049ca166cdac40ac284b6be29e6f9c0 Mon Sep 17 00:00:00 2001 From: rsudev Date: Thu, 26 Mar 2015 15:08:28 +0100 Subject: Fixes #4757, Add menu icon for showing hint in compass/cache map --- main/project/rawimages/new-idea-modified.svg | 76 ++++++++++++++++++++++++++ main/project/rawimages/noun_104277_cc.svg | 26 +++++++++ main/res/drawable-hdpi/ic_menu_hint.png | Bin 0 -> 1228 bytes main/res/drawable-mdpi/ic_menu_hint.png | Bin 0 -> 795 bytes main/res/drawable-xhdpi/ic_menu_hint.png | Bin 0 -> 1686 bytes main/res/drawable-xxhdpi/ic_menu_hint.png | Bin 0 -> 2547 bytes main/res/menu/compass_activity_options.xml | 11 ++-- main/res/menu/map_activity.xml | 1 + main/res/values/strings.xml | 2 + main/res/values/strings_not_translatable.xml | 1 + main/src/cgeo/geocaching/CompassActivity.java | 12 ++++ 11 files changed, 124 insertions(+), 5 deletions(-) create mode 100644 main/project/rawimages/new-idea-modified.svg create mode 100644 main/project/rawimages/noun_104277_cc.svg create mode 100644 main/res/drawable-hdpi/ic_menu_hint.png create mode 100644 main/res/drawable-mdpi/ic_menu_hint.png create mode 100644 main/res/drawable-xhdpi/ic_menu_hint.png create mode 100644 main/res/drawable-xxhdpi/ic_menu_hint.png (limited to 'main') 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 @@ + +image/svg+xml \ 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +Created by Artem Korotkikhfrom the Noun Project \ 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 Binary files /dev/null and b/main/res/drawable-hdpi/ic_menu_hint.png 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 Binary files /dev/null and b/main/res/drawable-mdpi/ic_menu_hint.png 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 Binary files /dev/null and b/main/res/drawable-xhdpi/ic_menu_hint.png 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 Binary files /dev/null and b/main/res/drawable-xxhdpi/ic_menu_hint.png 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" > 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 @@ 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. Switching lists You can switch between your geocache lists by clicking the title of the list. + Show the hint + This new menu item might give you an idea where to find the cache - it shows the hint, if available. Unusual log type You want to log \'%s\'. Are you sure? 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 @@ · Mapsforge (OSM-rendering)\n · The Noun Project (basis for attribute icons):\n    · USB by Kenneth Von Alt from The Noun Project\n +    · new-idea by Artem Korotkikh from The Noun Project\n · The Apache Commons Project\n · Android Icons (CC-BY 3.0)\n · RRZE Icon set (CC-BY-SA 3.0)\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); -- cgit v1.1