diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 385b600190..4bda4d120e 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -583,6 +583,16 @@ public abstract class MenuController extends BaseMenuController { return null; } + public void clearIcon(boolean left) { + if (left) { + leftIcon = null; + leftIconId = 0; + } else { + rightIcon = null; + rightIconId = 0; + } + } + public void updateStateListDrawableIcon(@DrawableRes int resId, boolean left) { if (left) { leftIcon = enabled ? getStateListDrawable(resId) : null; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java index a0735a80b2..c46251e66c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java @@ -115,7 +115,7 @@ public class MapDataMenuController extends MenuController { } }; leftDownloadButtonController.caption = getMapActivity().getString(R.string.shared_string_download); - leftDownloadButtonController.leftIconId = R.drawable.ic_action_import; + leftDownloadButtonController.updateStateListDrawableIcon(R.drawable.ic_action_import, true); rightDownloadButtonController = new TitleButtonController() { @Override @@ -142,7 +142,7 @@ public class MapDataMenuController extends MenuController { } }; rightDownloadButtonController.caption = getMapActivity().getString(R.string.download_select_map_types); - rightDownloadButtonController.leftIconId = R.drawable.ic_plugin_srtm; + rightDownloadButtonController.updateStateListDrawableIcon(R.drawable.ic_plugin_srtm, true); bottomTitleButtonController = new TitleButtonController() { @Override @@ -159,7 +159,7 @@ public class MapDataMenuController extends MenuController { } }; bottomTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete); - bottomTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark; + bottomTitleButtonController.updateStateListDrawableIcon(R.drawable.ic_action_delete_dark, true); titleProgressController = new TitleProgressController() { @Override @@ -367,7 +367,7 @@ public class MapDataMenuController extends MenuController { } leftDownloadButtonController.visible = true; - leftDownloadButtonController.leftIconId = R.drawable.ic_action_import; + leftDownloadButtonController.updateStateListDrawableIcon(R.drawable.ic_action_import, true); if (backuped) { leftDownloadButtonController.caption = getMapActivity().getString(R.string.local_index_mi_restore); } else if (indexItem != null) { @@ -375,7 +375,7 @@ public class MapDataMenuController extends MenuController { || indexItem.getType() == DownloadActivityType.HILLSHADE_FILE) && srtmDisabled) { leftDownloadButtonController.caption = getMapActivity().getString(R.string.get_plugin); - leftDownloadButtonController.leftIconId = 0; + leftDownloadButtonController.clearIcon(true); } else if (indexItem.isOutdated()) { leftDownloadButtonController.caption = getMapActivity().getString(R.string.shared_string_update); } else if (!downloaded) {