Disable red arrow setting (no arrow when no route)

This commit is contained in:
vshcherb 2014-04-28 01:00:37 +02:00
parent 9ed2f34264
commit b55a971f8a
3 changed files with 14 additions and 14 deletions

View file

@ -894,10 +894,10 @@ public class OsmandSettings {
public final CommonPreference<Boolean> MAP_ONLINE_DATA = new BooleanPreference("map_online_data", false).makeGlobal(); public final CommonPreference<Boolean> MAP_ONLINE_DATA = new BooleanPreference("map_online_data", false).makeGlobal();
// this value string is synchronized with settings_pref.xml preference name // this value string is synchronized with settings_pref.xml preference name
public final CommonPreference<Boolean> SHOW_DESTINATION_ARROW = new BooleanPreference("show_destination_arrow", true).makeProfile(); // public final CommonPreference<Boolean> SHOW_DESTINATION_ARROW = new BooleanPreference("show_destination_arrow", true).makeProfile();
{ // {
SHOW_DESTINATION_ARROW.setModeDefaultValue(ApplicationMode.CAR, false); // SHOW_DESTINATION_ARROW.setModeDefaultValue(ApplicationMode.CAR, false);
} // }
// this value string is synchronized with settings_pref.xml preference name // this value string is synchronized with settings_pref.xml preference name
public final CommonPreference<String> MAP_OVERLAY = new StringPreference("map_overlay", null).makeGlobal(); public final CommonPreference<String> MAP_OVERLAY = new StringPreference("map_overlay", null).makeGlobal();

View file

@ -110,7 +110,7 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu
int locationY = tb.getPixYFromLatNoRot(pointToNavigate.getLatitude()); int locationY = tb.getPixYFromLatNoRot(pointToNavigate.getLatitude());
canvas.rotate(-tb.getRotate(), locationX, locationY); canvas.rotate(-tb.getRotate(), locationX, locationY);
canvas.drawBitmap(targetPoint, locationX - marginX, locationY - marginY, bitmapPaint); canvas.drawBitmap(targetPoint, locationX - marginX, locationY - marginY, bitmapPaint);
} else if (pointToNavigate != null && view.getSettings().SHOW_DESTINATION_ARROW.get()) { } else if (pointToNavigate != null && !view.getApplication().getRoutingHelper().isRouteCalculated()) {
net.osmand.Location.distanceBetween(view.getLatitude(), view.getLongitude(), pointToNavigate.getLatitude(), net.osmand.Location.distanceBetween(view.getLatitude(), view.getLongitude(), pointToNavigate.getLatitude(),
pointToNavigate.getLongitude(), calculations); pointToNavigate.getLongitude(), calculations);
float bearing = calculations[1] - 90; float bearing = calculations[1] - 90;

View file

@ -53,15 +53,15 @@ public class AppearanceWidgetsFactory {
} }
}); });
final MapWidgetRegistry.MapWidgetRegInfo showDestinationArrow = mapInfoControls.registerAppearanceWidget(R.drawable.widget_show_destination_arrow, R.string.map_widget_show_destination_arrow, // final MapWidgetRegistry.MapWidgetRegInfo showDestinationArrow = mapInfoControls.registerAppearanceWidget(R.drawable.widget_show_destination_arrow, R.string.map_widget_show_destination_arrow,
"show_destination_arrow", view.getSettings().SHOW_DESTINATION_ARROW); // "show_destination_arrow", view.getSettings().SHOW_DESTINATION_ARROW);
showDestinationArrow.setStateChangeListener(new Runnable() { // showDestinationArrow.setStateChangeListener(new Runnable() {
@Override // @Override
public void run() { // public void run() {
view.getSettings().SHOW_DESTINATION_ARROW.set(!view.getSettings().SHOW_DESTINATION_ARROW.get()); // view.getSettings().SHOW_DESTINATION_ARROW.set(!view.getSettings().SHOW_DESTINATION_ARROW.get());
mapInfoLayer.recreateControls(); // mapInfoLayer.recreateControls();
} // }
}); // });
final MapWidgetRegistry.MapWidgetRegInfo transparent = mapInfoControls.registerAppearanceWidget(R.drawable.widget_transparent_skin, R.string.map_widget_transparent, final MapWidgetRegistry.MapWidgetRegInfo transparent = mapInfoControls.registerAppearanceWidget(R.drawable.widget_transparent_skin, R.string.map_widget_transparent,
"transparent", view.getSettings().TRANSPARENT_MAP_THEME); "transparent", view.getSettings().TRANSPARENT_MAP_THEME);