From 4c554f8fa27a9b2e9eb239334e5f9113fdb4233d Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Wed, 1 Aug 2018 16:40:18 +0300 Subject: [PATCH] Show separator for all types of context menu (cherry picked from commit 5fe78fa) --- .../src/net/osmand/plus/mapcontextmenu/MapContextMenu.java | 7 ------- .../osmand/plus/mapcontextmenu/MapContextMenuFragment.java | 6 ++++-- .../src/net/osmand/plus/mapcontextmenu/MenuController.java | 4 ---- .../controllers/AMapPointMenuController.java | 5 ----- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index d104605c34..e850dd4db9 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -1279,13 +1279,6 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL return 0; } - public boolean isShowInfoCompassSeparator() { - if (menuController != null) { - return menuController.isShowInfoCompassSeparator(); - } - return false; - } - public boolean isMapDownloaded() { return menuController != null && menuController.isMapDownloaded(); } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 97fc71894c..d0e2256821 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -1479,7 +1479,8 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo TextView additionalInfoTextView = (TextView) view.findViewById(R.id.additional_info_text_view); CharSequence additionalInfoStr = menu.getAdditionalInfo(); boolean showAdditionalImage = false; - if (!TextUtils.isEmpty(additionalInfoStr)) { + boolean showAdditionalInfo = !TextUtils.isEmpty(additionalInfoStr); + if (showAdditionalInfo) { int colorId = menu.getAdditionalInfoColor(); int additionalInfoIconRes = menu.getAdditionalInfoIconRes(); if (colorId != 0) { @@ -1497,8 +1498,9 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo } additionalInfoImageView.setVisibility(showAdditionalImage ? View.VISIBLE : View.GONE); + boolean showSeparator = showAdditionalInfo && menu.displayDistanceDirection(); view.findViewById(R.id.info_compass_separator) - .setVisibility(menu.isShowInfoCompassSeparator() ? View.VISIBLE : View.GONE); + .setVisibility(showSeparator ? View.VISIBLE : View.GONE); } updateCompassVisibility(); updateAdditionalInfoVisibility(); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 5ba1bb986c..5ba197428b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -528,10 +528,6 @@ public abstract class MenuController extends BaseMenuController implements Colla return 0; } - public boolean isShowInfoCompassSeparator() { - return false; - } - private boolean shouldShowMapSize() { return indexItem != null && !downloaded; } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AMapPointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AMapPointMenuController.java index afd78683e9..1dfe9d3e82 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AMapPointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/AMapPointMenuController.java @@ -133,11 +133,6 @@ public class AMapPointMenuController extends MenuController { return super.getAdditionalInfoIconRes(); } - @Override - public boolean isShowInfoCompassSeparator() { - return getPointSpeed() != NO_SPEED; - } - @Override public boolean needStreetName() { return false;