From 1ab34b31d90a2521426c0269f896814f5d7632a0 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Mon, 30 Oct 2017 19:07:34 +0200 Subject: [PATCH 1/4] Change the button in the context menu of the marker --- OsmAnd/res/drawable/passed_icon_dark.xml | 14 ++++++++++++++ OsmAnd/res/drawable/passed_icon_light.xml | 14 ++++++++++++++ OsmAnd/res/values/strings.xml | 1 + .../osmand/plus/mapcontextmenu/MenuController.java | 7 ++++++- .../controllers/MapMarkerMenuController.java | 5 +++-- 5 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 OsmAnd/res/drawable/passed_icon_dark.xml create mode 100644 OsmAnd/res/drawable/passed_icon_light.xml diff --git a/OsmAnd/res/drawable/passed_icon_dark.xml b/OsmAnd/res/drawable/passed_icon_dark.xml new file mode 100644 index 0000000000..5840e824ef --- /dev/null +++ b/OsmAnd/res/drawable/passed_icon_dark.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/drawable/passed_icon_light.xml b/OsmAnd/res/drawable/passed_icon_light.xml new file mode 100644 index 0000000000..dfd857243c --- /dev/null +++ b/OsmAnd/res/drawable/passed_icon_light.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 5a2cefd2bc..5ee1875254 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,7 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> + Mark passed can be imported as Favorites points, or as track file. Import as GPX file Import as Favorites diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 894018ab7c..bd07191281 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu; import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.support.annotation.NonNull; +import android.support.v4.content.ContextCompat; import android.view.View; import android.view.View.OnClickListener; import android.widget.LinearLayout; @@ -495,10 +496,14 @@ public abstract class MenuController extends BaseMenuController { public boolean needRightText = false; public String rightTextCaption = ""; public boolean visible = true; + public boolean needColorizeIcon = true; public Drawable getLeftIcon() { if (leftIconId != 0) { - return getIcon(leftIconId, isLight() ? R.color.map_widget_blue : R.color.osmand_orange); + if (needColorizeIcon) { + return getIcon(leftIconId, isLight() ? R.color.map_widget_blue : R.color.osmand_orange); + } + return ContextCompat.getDrawable(getMapActivity(), leftIconId); } else { return null; } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java index 875b8f0fdb..ac25b91059 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapMarkerMenuController.java @@ -28,8 +28,9 @@ public class MapMarkerMenuController extends MenuController { getMapActivity().getContextMenu().close(); } }; - leftTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_remove); - leftTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark; + leftTitleButtonController.needColorizeIcon = false; + leftTitleButtonController.caption = getMapActivity().getString(R.string.mark_passed); + leftTitleButtonController.leftIconId = isLight() ? R.drawable.passed_icon_light : R.drawable.passed_icon_dark; } @Override From 381ccc03150fa5989ef1b526c3501e093b3a8d83 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Tue, 31 Oct 2017 12:47:45 +0200 Subject: [PATCH 2/4] Add subtitle button to the context menu; add "Show on Top Bar" button to the context menu of the marker --- .../res/layout/map_context_menu_fragment.xml | 82 +++++++++++++------ OsmAnd/res/values/strings.xml | 1 + .../src/net/osmand/plus/MapMarkersHelper.java | 10 +++ .../plus/mapcontextmenu/MapContextMenu.java | 8 ++ .../MapContextMenuFragment.java | 30 +++++++ .../plus/mapcontextmenu/MenuController.java | 5 ++ .../controllers/MapMarkerMenuController.java | 11 +++ 7 files changed, 120 insertions(+), 27 deletions(-) diff --git a/OsmAnd/res/layout/map_context_menu_fragment.xml b/OsmAnd/res/layout/map_context_menu_fragment.xml index 1924bf56a3..c55c77ca81 100644 --- a/OsmAnd/res/layout/map_context_menu_fragment.xml +++ b/OsmAnd/res/layout/map_context_menu_fragment.xml @@ -166,20 +166,71 @@ + + +