diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index 112e6b52ad..8c0d09f150 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -58,7 +58,7 @@ import net.osmand.plus.views.layers.PointLocationLayer; import net.osmand.plus.views.layers.PointNavigationLayer; import net.osmand.plus.views.layers.RouteLayer; import net.osmand.plus.views.layers.RadiusRulerControlLayer; -import net.osmand.plus.views.layers.RulerByTapControlLayer; +import net.osmand.plus.views.layers.DistanceRulerControlLayer; import net.osmand.plus.views.layers.TransportStopsLayer; import net.osmand.plus.views.mapwidgets.MapWidgetRegistry; @@ -84,7 +84,7 @@ public class MapActivityLayers { private TransportStopsLayer transportStopsLayer; private PointLocationLayer locationLayer; private RadiusRulerControlLayer radiusRulerControlLayer; - private RulerByTapControlLayer rulerByTapControlLayer; + private DistanceRulerControlLayer distanceRulerControlLayer; private PointNavigationLayer navigationLayer; private MapMarkersLayer mapMarkersLayer; private ImpassableRoadsLayer impassableRoadsLayer; @@ -174,8 +174,8 @@ public class MapActivityLayers { radiusRulerControlLayer = new RadiusRulerControlLayer(activity); mapView.addLayer(radiusRulerControlLayer, 7.8f); // 7.9 ruler by tap control layer - rulerByTapControlLayer = new RulerByTapControlLayer(activity); - mapView.addLayer(rulerByTapControlLayer, 7.9f); + distanceRulerControlLayer = new DistanceRulerControlLayer(activity); + mapView.addLayer(distanceRulerControlLayer, 7.9f); // 8. context menu layer // 9. map info layer mapInfoLayer = new MapInfoLayer(activity, routeLayer); @@ -621,8 +621,8 @@ public class MapActivityLayers { return radiusRulerControlLayer; } - public RulerByTapControlLayer getRulerByTapControlLayer() { - return rulerByTapControlLayer; + public DistanceRulerControlLayer getDistanceRulerControlLayer() { + return distanceRulerControlLayer; } public MapInfoLayer getMapInfoLayer() { diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index db06175bb8..50c55e316c 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -700,9 +700,9 @@ public class OsmandSettings { return false; } - public final CommonPreference RADIUS_RULER_MODE = new EnumStringPreference<>(this, "radius_ruler_mode", RadiusRulerMode.FIRST, RadiusRulerMode.values()).makeGlobal().makeShared(); + public final CommonPreference RADIUS_RULER_MODE = new EnumStringPreference<>(this, "ruler_mode", RadiusRulerMode.FIRST, RadiusRulerMode.values()).makeGlobal().makeShared(); public final OsmandPreference SHOW_COMPASS_CONTROL_RULER = new BooleanPreference(this, "show_compass_ruler", true).makeGlobal().makeShared(); - public final OsmandPreference SHOW_RULER_BY_TAP = new BooleanPreference(this, "show_ruler_by_tap", false).makeProfile(); + public final OsmandPreference SHOW_DISTANCE_RULER = new BooleanPreference(this, "show_distance_ruler", false).makeProfile(); public final CommonPreference SHOW_LINES_TO_FIRST_MARKERS = new BooleanPreference(this, "show_lines_to_first_markers", false).makeProfile(); public final CommonPreference SHOW_ARROWS_TO_FIRST_MARKERS = new BooleanPreference(this, "show_arrows_to_first_markers", false).makeProfile(); diff --git a/OsmAnd/src/net/osmand/plus/views/layers/RulerByTapControlLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/DistanceRulerControlLayer.java similarity index 98% rename from OsmAnd/src/net/osmand/plus/views/layers/RulerByTapControlLayer.java rename to OsmAnd/src/net/osmand/plus/views/layers/DistanceRulerControlLayer.java index 582c862b02..e509ae335a 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/RulerByTapControlLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/DistanceRulerControlLayer.java @@ -28,7 +28,7 @@ import net.osmand.util.MapUtils; import java.util.ArrayList; import java.util.List; -public class RulerByTapControlLayer extends OsmandMapLayer { +public class DistanceRulerControlLayer extends OsmandMapLayer { private static final int VERTICAL_OFFSET = 15; private static final long DRAW_TIME = 2000; @@ -65,7 +65,7 @@ public class RulerByTapControlLayer extends OsmandMapLayer { private Handler handler; - public RulerByTapControlLayer(MapActivity mapActivity) { + public DistanceRulerControlLayer(MapActivity mapActivity) { this.mapActivity = mapActivity; } @@ -176,7 +176,7 @@ public class RulerByTapControlLayer extends OsmandMapLayer { } public boolean rulerModeOn() { - return app.getSettings().SHOW_RULER_BY_TAP.get(); + return app.getSettings().SHOW_DISTANCE_RULER.get(); } private void refreshMapDelayed() { diff --git a/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java index e1dc78c1ed..8fa3f2bf50 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/MapControlsLayer.java @@ -780,8 +780,7 @@ public class MapControlsLayer extends OsmandMapLayer { if (app.getRoutingHelper().isFollowingMode() || app.getRoutingHelper().isPauseNavigation() || mapActivity.getMeasurementToolFragment() != null || mapActivity.getPlanRouteFragment() != null - || mapActivity.getMapLayers().getRadiusRulerControlLayer().rulerModeOn() - || mapActivity.getMapLayers().getRulerByTapControlLayer().rulerModeOn()) { + || mapActivity.getMapLayers().getDistanceRulerControlLayer().rulerModeOn()) { return; } if (isMapControlsVisible()) { @@ -894,7 +893,7 @@ public class MapControlsLayer extends OsmandMapLayer { layersHud.update(app, isNight); } boolean showTopButtons = !routeDialogOpened && !trackDialogOpened && !shouldHideTopControls - && !isInMeasurementToolMode() && !isInPlanRouteMode() && !isInChoosingRoutesMode() + && !isInMeasurementToolMode() && !isInPlanRouteMode() && !isInChoosingRoutesMode() && !isInTrackAppearanceMode() && !isInWaypointsChoosingMode() && !isInFollowTrackMode(); layersHud.updateVisibility(showTopButtons); quickSearchHud.updateVisibility(showTopButtons); @@ -1070,7 +1069,7 @@ public class MapControlsLayer extends OsmandMapLayer { } } - public void updateTransparencySlider () { + public void updateTransparencySlider() { LayerTransparencySeekbarMode seekbarMode = settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get(); if (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null) { if (seekbarMode == LayerTransparencySeekbarMode.OVERLAY && settings.MAP_OVERLAY.get() != null) { @@ -1082,7 +1081,7 @@ public class MapControlsLayer extends OsmandMapLayer { } public void showTransparencyBar(CommonPreference transparenPreference, - boolean isTransparencyBarEnabled) { + boolean isTransparencyBarEnabled) { this.isTransparencyBarEnabled = isTransparencyBarEnabled; ApplicationMode appMode = app.getSettings().getApplicationMode(); if (MapControlsLayer.transparencySetting != transparenPreference) { @@ -1358,7 +1357,7 @@ public class MapControlsLayer extends OsmandMapLayer { } private boolean isInFollowTrackMode() { - return MapRouteInfoMenu.followTrackVisible; + return MapRouteInfoMenu.followTrackVisible; } public static View.OnLongClickListener getOnClickMagnifierListener(final OsmandMapTileView view) { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java index b6c53d076b..a1fc44b90b 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java @@ -372,8 +372,8 @@ public class MapWidgetRegistry { cm.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.map_widget_distance_by_tap, map) .setIcon(R.drawable.ic_action_ruler_line) - .setSelected(settings.SHOW_RULER_BY_TAP.get()) - .setListener(new AppearanceItemClickListener(settings.SHOW_RULER_BY_TAP, map)) + .setSelected(settings.SHOW_DISTANCE_RULER.get()) + .setListener(new AppearanceItemClickListener(settings.SHOW_DISTANCE_RULER, map)) .setLayout(R.layout.list_item_icon_and_switch).createItem()); cm.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.map_markers, map)