From ee37e9c390ece13b1c158c34e8748cd297205a1c Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Thu, 12 Oct 2017 17:45:49 +0300 Subject: [PATCH] Don't show destination arrow --- .../src/net/osmand/plus/OsmandSettings.java | 7 ------ .../plus/views/PointNavigationLayer.java | 23 ------------------- .../views/mapwidgets/MapWidgetRegistry.java | 4 +--- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index d47e86a15c..73d25f1563 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1280,13 +1280,6 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public final CommonPreference MAP_ONLINE_DATA = new BooleanPreference("map_online_data", false).makeGlobal(); - // this value string is synchronized with settings_pref.xml preference name - public final CommonPreference SHOW_DESTINATION_ARROW = new BooleanPreference("show_destination_arrow", false).makeProfile(); - - { - SHOW_DESTINATION_ARROW.setModeDefaultValue(ApplicationMode.PEDESTRIAN, true); - } - public final CommonPreference CONTOUR_LINES_ZOOM = new StringPreference("contour_lines_zoom", null).makeGlobal().cache(); // this value string is synchronized with settings_pref.xml preference name diff --git a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java index a523ee4e73..65910cccc5 100644 --- a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java @@ -38,7 +38,6 @@ public class PointNavigationLayer extends OsmandMapLayer implements private Bitmap mStartPoint; private Bitmap mTargetPoint; private Bitmap mIntermediatePoint; - private Bitmap mArrowToDestination; private Paint mTextPaint; @@ -68,7 +67,6 @@ public class PointNavigationLayer extends OsmandMapLayer implements mStartPoint = BitmapFactory.decodeResource(mView.getResources(), R.drawable.map_start_point); mTargetPoint = BitmapFactory.decodeResource(mView.getResources(), R.drawable.map_target_point); mIntermediatePoint = BitmapFactory.decodeResource(mView.getResources(), R.drawable.map_intermediate_point); - mArrowToDestination = BitmapFactory.decodeResource(mView.getResources(), R.drawable.map_arrow_to_destination); } @Override @@ -126,27 +124,6 @@ public class PointNavigationLayer extends OsmandMapLayer implements canvas.rotate(tb.getRotate(), locationX, locationY); } - Iterator it = targetPoints.getIntermediatePoints().iterator(); - if (it.hasNext()) { - pointToNavigate = it.next(); - } - if (pointToNavigate != null && !isLocationVisible(tb, pointToNavigate)) { - boolean show = !mView.getApplication().getRoutingHelper().isRouteCalculated(); - if (mView.getSettings().SHOW_DESTINATION_ARROW.isSet()) { - show = mView.getSettings().SHOW_DESTINATION_ARROW.get(); - } - if (show) { - net.osmand.Location.distanceBetween(mView.getLatitude(), mView.getLongitude(), - pointToNavigate.getLatitude(), pointToNavigate.getLongitude(), mCalculations); - float bearing = mCalculations[1] - 90; - float radiusBearing = DIST_TO_SHOW * tb.getDensity(); - final QuadPoint cp = tb.getCenterPixelPoint(); - canvas.rotate(bearing, cp.x, cp.y); - canvas.translate(-24 * tb.getDensity() + radiusBearing, -22 * tb.getDensity()); - canvas.drawBitmap(mArrowToDestination, cp.x, cp.y, mBitmapPaint); - } - } - } private float getPointX(RotatedTileBox tileBox, TargetPoint point) { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java index db172d577f..0735984144 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapWidgetRegistry.java @@ -311,8 +311,7 @@ public class MapWidgetRegistry { } private void resetDefaultAppearance(ApplicationMode appMode) { -// settings.SHOW_RULER.resetToDefault(); - settings.SHOW_DESTINATION_ARROW.resetToDefault(); +// settings.SHOW_RULER.resetToDefault(); settings.TRANSPARENT_MAP_THEME.resetToDefault(); settings.SHOW_STREET_NAME.resetToDefault(); settings.CENTER_POSITION_ON_MAP.resetToDefault(); @@ -320,7 +319,6 @@ public class MapWidgetRegistry { } public void addControlsAppearance(final MapActivity map, final ContextMenuAdapter cm, ApplicationMode mode) { - addControlId(map, cm, R.string.map_widget_show_destination_arrow, settings.SHOW_DESTINATION_ARROW); addControlId(map, cm, R.string.map_widget_transparent, settings.TRANSPARENT_MAP_THEME); addControlId(map, cm, R.string.always_center_position_on_map, settings.CENTER_POSITION_ON_MAP); if (mode != ApplicationMode.DEFAULT) {