diff --git a/OsmAnd/res/layout-land/map_hud_top.xml b/OsmAnd/res/layout-land/map_hud_top.xml index 1772881368..f901e5444f 100644 --- a/OsmAnd/res/layout-land/map_hud_top.xml +++ b/OsmAnd/res/layout-land/map_hud_top.xml @@ -7,186 +7,186 @@ android:orientation="vertical"> - - + android:clickable="true" + android:minHeight="@dimen/map_address_height" + android:visibility="gone" + tools:visibility="visible"> + android:orientation="vertical"> - + android:orientation="horizontal"> - - - + android:layout_weight="1" + android:background="@color/markers_top_bar_background" + android:minHeight="50dp"> - - - - - - - - - - - - - - - - - - - - - - - - + android:orientation="horizontal"> - + - + android:layout_marginBottom="6dp" + android:layout_marginTop="6dp" + android:layout_weight="1" + android:orientation="vertical"> + + + + + + + + + + - - + - + - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + - - - - - - - - - - - - - + android:background="@drawable/btn_round" + android:minHeight="@dimen/map_address_height"> - - - + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp" + > - - - - - - - - - + android:textSize="@dimen/map_widget_text_size" + tools:text="Long Street Name"> + + android:textSize="@dimen/map_widget_text_size" + tools:text="Long Street Name"> + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + android:background="@drawable/btn_flat" + android:minHeight="@dimen/map_address_height"> - - - + + android:layout_marginLeft="5dp" + android:layout_marginRight="5dp"> + - - - - - - - - + android:textSize="@dimen/map_widget_text_size" + tools:text="Long Street Name"> + - + android:textSize="@dimen/map_widget_text_size" + tools:text="Long Street Name"> + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + android:clickable="true" + android:minHeight="@dimen/map_address_height" + android:visibility="gone" + tools:visibility="visible"> - + android:orientation="vertical"> - - - + android:minHeight="60dp" + android:background="@color/markers_top_bar_background"> + android:background="?attr/selectableItemBackground" + android:layout_gravity="center_vertical" + android:gravity="center_vertical" + android:layout_marginTop="5dp" + android:layout_marginBottom="5dp" + android:orientation="horizontal"> - + - + android:layout_weight="1" + android:orientation="vertical"> + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - + diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 86e41c349e..3afdfbdf74 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -368,6 +368,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL fragmentRef.get().centerMarkerLocation(); } } + updateWidgetsVisibility(false); } public void show(@NonNull LatLon latLon, @@ -388,6 +389,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } centerMarker = false; autoHide = false; + updateWidgetsVisibility(false); } public void update(LatLon latLon, PointDescription pointDescription, Object object) { @@ -446,6 +448,15 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL if (fragmentRef != null) { fragmentRef.get().dismissMenu(); } + updateWidgetsVisibility(true); + } + + private void updateWidgetsVisibility(boolean visible) { + int visibility = visible ? View.VISIBLE : View.GONE; + mapActivity.findViewById(R.id.map_center_info).setVisibility(visibility); + mapActivity.findViewById(R.id.map_left_widgets_panel).setVisibility(visibility); + mapActivity.findViewById(R.id.map_right_widgets_panel).setVisibility(visibility); + mapActivity.refreshMap(); } // timeout in msec @@ -638,15 +649,15 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } if (searchDoneAction != null) { - if (searchDoneAction.dlg != null) { - try { - searchDoneAction.dlg.dismiss(); - } catch (Exception e) { - // ignore - } finally { - searchDoneAction.dlg = null; - } + if (searchDoneAction.dlg != null) { + try { + searchDoneAction.dlg.dismiss(); + } catch (Exception e) { + // ignore + } finally { + searchDoneAction.dlg = null; } + } searchDoneAction.run(); searchDoneAction = null; } @@ -713,7 +724,6 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } - public void buttonFavoritePressed() { if (object != null && object instanceof FavouritePoint) { getFavoritePointEditor().edit((FavouritePoint) object); @@ -815,7 +825,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } } - public void addWptPt(LatLon latLon, String title, String categoryName, int categoryColor, boolean skipDialog){ + public void addWptPt(LatLon latLon, String title, String categoryName, int categoryColor, boolean skipDialog) { final List list = mapActivity.getMyApplication().getSelectedGpxHelper().getSelectedGPXFiles(); @@ -833,7 +843,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL } } - public AlertDialog addNewWptToGPXFile(final LatLon latLon, final String title, + public AlertDialog addNewWptToGPXFile(final LatLon latLon, final String title, final String categoryName, final int categoryColor, final boolean skipDialog) { CallbackWithObject callbackWithObject = new CallbackWithObject() { diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index b78c7e2aa5..2f2eb8a3d2 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -708,11 +708,12 @@ public class MapControlsLayer extends OsmandMapLayer { boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode(); boolean routeDialogOpened = MapRouteInfoMenu.isVisible(); boolean trackDialogOpened = TrackDetailsMenu.isVisible(); + boolean contextMenuOpened = mapActivity.getContextMenu().isVisible(); boolean showRouteCalculationControls = routePlanningMode || ((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode); - updateMyLocation(rh, routeDialogOpened || trackDialogOpened); + updateMyLocation(rh, routeDialogOpened || trackDialogOpened || contextMenuOpened); boolean showButtons = (showRouteCalculationControls || !routeFollowingMode) - && !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode() && !isInPlanRouteMode(); + && !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened; //routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions); if (rh.isFollowingMode()) { routePlanningBtn.setIconResId(R.drawable.map_start_navigation); @@ -727,16 +728,16 @@ public class MapControlsLayer extends OsmandMapLayer { routePlanningBtn.updateVisibility(showButtons); menuControl.updateVisibility(showButtons); - mapZoomIn.updateVisibility(!routeDialogOpened); - mapZoomOut.updateVisibility(!routeDialogOpened); + mapZoomIn.updateVisibility(!routeDialogOpened && !contextMenuOpened); + mapZoomOut.updateVisibility(!routeDialogOpened && !contextMenuOpened); compassHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && shouldShowCompass() - && !isInMeasurementToolMode() && !isInPlanRouteMode()); + && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened); if (layersHud.setIconResId(settings.getApplicationMode().getMapIconId())) { layersHud.update(app, isNight); } - layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode()); - quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode()); + layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened); + quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode() && !isInPlanRouteMode() && !contextMenuOpened); if (!routePlanningMode && !routeFollowingMode) { if (mapView.isZooming()) { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index b811242940..05b85c3296 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -577,7 +577,7 @@ public class MapInfoWidgetsFactory { initToolbar(defaultController); defaultController.updateToolbar(this); } - updateVisibility(controller != null); + updateVisibility(controller != null && (!map.getContextMenu().isVisible() || controller.getType() == TopToolbarControllerType.CONTEXT_MENU)); } public void updateColors(TopToolbarController controller) { @@ -801,7 +801,7 @@ public class MapInfoWidgetsFactory { } } } - if (map.isTopToolbarActive()) { + if (map.isTopToolbarActive() || map.getContextMenu().isVisible()) { updateVisibility(false); } else if (!showNextTurn && updateWaypoint()) { updateVisibility(true); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java index c294f3d18b..c8d4602d85 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapMarkersWidgetsFactory.java @@ -197,7 +197,8 @@ public class MapMarkersWidgetsFactory { || map.getMyApplication().getRoutingHelper().isRoutePlanningMode() || MapRouteInfoMenu.isVisible() || addressTopBar.getVisibility() == View.VISIBLE - || map.isTopToolbarActive()) { + || map.isTopToolbarActive() + || map.getContextMenu().isVisible()) { updateVisibility(false); return; }