From 45ada5050f48c04336fe85c466a1243ee6f23bfc Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Thu, 12 Nov 2015 20:47:24 +0300 Subject: [PATCH] Fix star icon for wpt context menu --- .../controllers/WptPtMenuController.java | 4 ++-- .../editors/WprPtEditorFragment.java | 15 ++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java index 2bb1784cf7..d98b8208ca 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/WptPtMenuController.java @@ -55,8 +55,8 @@ public class WptPtMenuController extends MenuController { @Override public Drawable getLeftIcon() { - return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(), - wpt.getColor(getMapActivity().getResources().getColor(R.color.gpx_color_point)), false); + return getPaintedIcon(R.drawable.ic_action_fav_dark, + wpt.getColor(getMapActivity().getResources().getColor(R.color.gpx_color_point))); } @Override diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WprPtEditorFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WprPtEditorFragment.java index 6fab8176ba..0b6b38ea77 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WprPtEditorFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/editors/WprPtEditorFragment.java @@ -3,17 +3,14 @@ package net.osmand.plus.mapcontextmenu.editors; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; -import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.os.Bundle; import net.osmand.data.LatLon; import net.osmand.plus.GPXUtilities.WptPt; -import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.SavingTrackHelper; -import net.osmand.plus.base.FavoriteImageDrawable; import net.osmand.plus.mapcontextmenu.MapContextMenu; import net.osmand.util.Algorithms; @@ -144,20 +141,12 @@ public class WprPtEditorFragment extends PointEditorFragment { @Override public Drawable getNameIcon() { int color = wpt.getColor(defaultColor); - return FavoriteImageDrawable.getOrCreate(getMapActivity(), color, false); + return getPaintedIcon(R.drawable.ic_action_fav_dark, color); } @Override public Drawable getCategoryIcon() { int color = wpt.getColor(defaultColor); - return getIcon(R.drawable.ic_action_folder_stroke, color); - } - - public Drawable getIcon(int resId, int color) { - OsmandApplication app = getMyApplication(); - Drawable d = app.getResources().getDrawable(resId).mutate(); - d.clearColorFilter(); - d.setColorFilter(color, PorterDuff.Mode.SRC_IN); - return d; + return getPaintedIcon(R.drawable.ic_action_folder_stroke, color); } }