diff --git a/OsmAnd/res/layout/map_hud_bottom.xml b/OsmAnd/res/layout/map_hud_bottom.xml index 3e87cac00f..52dbd1cf8e 100644 --- a/OsmAnd/res/layout/map_hud_bottom.xml +++ b/OsmAnd/res/layout/map_hud_bottom.xml @@ -220,7 +220,13 @@ - + + + - - - - - - - - - - - - - - - - + xmlns:tools="http://schemas.android.com/tools"> publicTransportTypes; @@ -240,6 +241,10 @@ public class ContextMenuLayer extends OsmandMapLayer { return mInChangeMarkerPositionMode; } + public boolean isInGpxDetailsMode() { + return mInGpxDetailsMode; + } + public boolean isObjectMoveable(Object o) { if (o == null) { return true; @@ -305,6 +310,34 @@ public class ContextMenuLayer extends OsmandMapLayer { }); } + public void enterGpxDetailsMode() { + menu.updateMapCenter(null); + menu.hide(); + + mInGpxDetailsMode = true; + mark(View.INVISIBLE, R.id.map_ruler_layout, + R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info); + + View collapseButton = activity.findViewById(R.id.map_collapse_button); + if (collapseButton != null && collapseButton.getVisibility() == View.VISIBLE) { + wasCollapseButtonVisible = true; + collapseButton.setVisibility(View.INVISIBLE); + } else { + wasCollapseButtonVisible = false; + } + } + + public void exitGpxDetailsMode() { + mInGpxDetailsMode = false; + mark(View.VISIBLE, R.id.map_ruler_layout, + R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info); + + View collapseButton = activity.findViewById(R.id.map_collapse_button); + if (collapseButton != null && wasCollapseButtonVisible) { + collapseButton.setVisibility(View.VISIBLE); + } + } + private void quitMovingMarker() { mInChangeMarkerPositionMode = false; mark(View.VISIBLE, R.id.map_ruler_layout, @@ -314,7 +347,6 @@ public class ContextMenuLayer extends OsmandMapLayer { if (collapseButton != null && wasCollapseButtonVisible) { collapseButton.setVisibility(View.VISIBLE); } - } private void enterMovingMode(RotatedTileBox tileBox) { @@ -500,7 +532,7 @@ public class ContextMenuLayer extends OsmandMapLayer { } public boolean disableLongPressOnMap() { - if (mInChangeMarkerPositionMode) { + if (mInChangeMarkerPositionMode || mInGpxDetailsMode) { return true; } boolean res = false; @@ -574,7 +606,7 @@ public class ContextMenuLayer extends OsmandMapLayer { @Override public boolean onSingleTap(PointF point, RotatedTileBox tileBox) { - if (mInChangeMarkerPositionMode) { + if (mInChangeMarkerPositionMode || mInGpxDetailsMode) { return true; } @@ -673,7 +705,7 @@ public class ContextMenuLayer extends OsmandMapLayer { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: - if (!mInChangeMarkerPositionMode) { + if (!mInChangeMarkerPositionMode && !mInGpxDetailsMode) { selectObjectsForContextMenu(tileBox, new PointF(event.getX(), event.getY()), true); if (pressedLatLonFull.size() > 0 || pressedLatLonSmall.size() > 0) { view.refreshMap(); diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index a8111503ce..37b443410f 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -632,11 +632,12 @@ public class MapControlsLayer extends OsmandMapLayer { routePlanningMode = true; } boolean routeFollowingMode = !routePlanningMode && rh.isFollowingMode(); - boolean dialogOpened = MapRouteInfoMenu.isVisible(); + boolean routeDialogOpened = MapRouteInfoMenu.isVisible(); boolean showRouteCalculationControls = routePlanningMode || ((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode); - updateMyLocation(rh, dialogOpened); - boolean showButtons = (showRouteCalculationControls || !routeFollowingMode) && !isInChangeMarkerPositionMode(); + updateMyLocation(rh, routeDialogOpened); + boolean showButtons = (showRouteCalculationControls || !routeFollowingMode) + && !isInChangeMarkerPositionMode() && !isInGpxDetailsMode(); //routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions); if (rh.isFollowingMode()) { routePlanningBtn.setIconResId(R.drawable.map_start_navigation); @@ -651,15 +652,15 @@ public class MapControlsLayer extends OsmandMapLayer { routePlanningBtn.updateVisibility(showButtons); menuControl.updateVisibility(showButtons); - mapZoomIn.updateVisibility(!dialogOpened); - mapZoomOut.updateVisibility(!dialogOpened); - compassHud.updateVisibility(!dialogOpened && shouldShowCompass()); + mapZoomIn.updateVisibility(!routeDialogOpened); + mapZoomOut.updateVisibility(!routeDialogOpened); + compassHud.updateVisibility(!routeDialogOpened && shouldShowCompass()); if (layersHud.setIconResId(settings.getApplicationMode().getSmallIconDark())) { layersHud.update(app, isNight); } - layersHud.updateVisibility(!dialogOpened); - quickSearchHud.updateVisibility(!dialogOpened); + layersHud.updateVisibility(!routeDialogOpened); + quickSearchHud.updateVisibility(!routeDialogOpened); if (!routePlanningMode && !routeFollowingMode) { if (mapView.isZooming()) { @@ -1046,6 +1047,10 @@ public class MapControlsLayer extends OsmandMapLayer { mapQuickActionLayer.isInChangeMarkerPositionMode() || contextMenuLayer.isInChangeMarkerPositionMode(); } + private boolean isInGpxDetailsMode() { + return contextMenuLayer.isInGpxDetailsMode(); + } + public static View.OnLongClickListener getOnClickMagnifierListener(final OsmandMapTileView view) { return new View.OnLongClickListener() { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index 63f707d6ee..fa71f38c54 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -48,6 +48,7 @@ public class MapInfoWidgetsFactory { public enum TopToolbarControllerType { QUICK_SEARCH, CONTEXT_MENU, + TRACK_DETAILS, DISCOUNT, } @@ -291,6 +292,7 @@ public class MapInfoWidgetsFactory { } else { view.updateVisibility(descrView, false); } + view.getShadowView().setVisibility(View.VISIBLE); } } @@ -305,6 +307,7 @@ public class MapInfoWidgetsFactory { private TextView titleView; private TextView descrView; private ImageButton closeButton; + private View shadowView; private boolean nightMode; public TopToolbarView(final MapActivity map) { @@ -317,6 +320,7 @@ public class MapInfoWidgetsFactory { closeButton = (ImageButton) map.findViewById(R.id.widget_top_bar_close_button); titleView = (TextView) map.findViewById(R.id.widget_top_bar_title); descrView = (TextView) map.findViewById(R.id.widget_top_bar_description); + shadowView = map.findViewById(R.id.widget_top_bar_shadow); updateVisibility(false); } @@ -348,6 +352,10 @@ public class MapInfoWidgetsFactory { return closeButton; } + public View getShadowView() { + return shadowView; + } + public TopToolbarController getTopController() { if (controllers.size() > 0) { return controllers.get(controllers.size() - 1);