From faa85cdf54ff28880db09bac45d2574001cfa9e9 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Thu, 11 Feb 2016 17:58:45 +0300 Subject: [PATCH] Added 2 additional marker colors (except map images) --- OsmAnd/res/values/colors.xml | 4 +++- .../src/net/osmand/plus/MapMarkersHelper.java | 2 +- .../plus/helpers/MapMarkerDialogHelper.java | 8 ++++++- .../osmand/plus/views/MapMarkersLayer.java | 22 ++++++++++++++++--- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml index eaa0ea14bd..f3567ad5cc 100644 --- a/OsmAnd/res/values/colors.xml +++ b/OsmAnd/res/values/colors.xml @@ -5,7 +5,9 @@ #73b825 #ff9800 #e53935 - #d7eb23 + #FDD835 + #26a69a + #ab47bc #EE666666 #BBBBBB diff --git a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java index f5e8be75ad..2622babaa2 100644 --- a/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java +++ b/OsmAnd/src/net/osmand/plus/MapMarkersHelper.java @@ -11,7 +11,7 @@ import java.util.ArrayList; import java.util.List; public class MapMarkersHelper { - public static final int MAP_MARKERS_COLORS_COUNT = 5; + public static final int MAP_MARKERS_COLORS_COUNT = 7; private List mapMarkers = new ArrayList<>(); private List mapMarkersHistory = new ArrayList<>(); diff --git a/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java index 6b49245d4a..0a45c67dbc 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/MapMarkerDialogHelper.java @@ -507,7 +507,13 @@ public class MapMarkerDialogHelper { colorId = R.color.marker_red; break; case 4: - colorId = R.color.marker_lt_green; + colorId = R.color.marker_yellow; + break; + case 5: + colorId = R.color.marker_teal; + break; + case 6: + colorId = R.color.marker_purple; break; default: colorId = R.color.marker_blue; diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java index 62831440c7..54d477b485 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java @@ -32,12 +32,16 @@ public class MapMarkersLayer extends OsmandMapLayer implements ContextMenuLayer. private Bitmap markerBitmapOrange; private Bitmap markerBitmapRed; private Bitmap markerBitmapYellow; + private Bitmap markerBitmapTeal; + private Bitmap markerBitmapPurple; private Paint bitmapPaintDestBlue; private Paint bitmapPaintDestGreen; private Paint bitmapPaintDestOrange; private Paint bitmapPaintDestRed; - private Paint bitmapPaintDestLtGreen; + private Paint bitmapPaintDestYellow; + private Paint bitmapPaintDestTeal; + private Paint bitmapPaintDestPurple; private Bitmap arrowToDestination; private float[] calculations = new float[2]; @@ -55,13 +59,17 @@ public class MapMarkersLayer extends OsmandMapLayer implements ContextMenuLayer. markerBitmapOrange = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_orange); markerBitmapRed = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_red); markerBitmapYellow = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_yellow); + markerBitmapTeal = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_red); + markerBitmapPurple = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_marker_green); arrowToDestination = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_arrow_to_destination); bitmapPaintDestBlue = createPaintDest(R.color.marker_blue); bitmapPaintDestGreen = createPaintDest(R.color.marker_green); bitmapPaintDestOrange = createPaintDest(R.color.marker_orange); bitmapPaintDestRed = createPaintDest(R.color.marker_red); - bitmapPaintDestLtGreen = createPaintDest(R.color.marker_lt_green); + bitmapPaintDestYellow = createPaintDest(R.color.marker_yellow); + bitmapPaintDestTeal = createPaintDest(R.color.marker_teal); + bitmapPaintDestPurple = createPaintDest(R.color.marker_purple); } private Paint createPaintDest(int colorId) { @@ -85,7 +93,11 @@ public class MapMarkersLayer extends OsmandMapLayer implements ContextMenuLayer. case 3: return bitmapPaintDestRed; case 4: - return bitmapPaintDestLtGreen; + return bitmapPaintDestYellow; + case 5: + return bitmapPaintDestTeal; + case 6: + return bitmapPaintDestPurple; default: return bitmapPaintDestBlue; } @@ -103,6 +115,10 @@ public class MapMarkersLayer extends OsmandMapLayer implements ContextMenuLayer. return markerBitmapRed; case 4: return markerBitmapYellow; + case 5: + return markerBitmapTeal; + case 6: + return markerBitmapPurple; default: return markerBitmapBlue; }