From 37690180eddb794133a5abe3cd7f46081f80032d Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 17 Nov 2015 22:15:00 +0100 Subject: [PATCH] fix waypoint vs. dest icon behavior on context menu --- .../plus/mapcontextmenu/MapContextMenuFragment.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index a7eae34304..470ed6b338 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -36,6 +36,7 @@ import net.osmand.plus.IconsCache; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; +import net.osmand.plus.TargetPointsHelper.TargetPoint; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dashboard.DashLocationFragment; import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents; @@ -360,8 +361,14 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { }); final ImageButton buttonWaypoint = (ImageButton) view.findViewById(R.id.context_menu_route_button); - buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_flag_dark, + // Correct use of destination vs. waypoit icon on button: + if (getMyApplication().getTargetPointsHelper().getPointToNavigate() == null) { + buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_flag_dark, light ? R.color.icon_color : R.color.dashboard_subheader_text_dark)); + } else { + buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_waypoints, + light ? R.color.icon_color : R.color.dashboard_subheader_text_dark)); + } buttonWaypoint.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {