diff --git a/OsmAnd/res/layout/point_editor_fragment.xml b/OsmAnd/res/layout/point_editor_fragment.xml index 47b7bb7868..39d511e1ce 100644 --- a/OsmAnd/res/layout/point_editor_fragment.xml +++ b/OsmAnd/res/layout/point_editor_fragment.xml @@ -29,6 +29,9 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="right" + android:drawableLeft="@drawable/ic_action_done" + android:paddingLeft="10dp" + android:paddingRight="10dp" android:background="@android:color/transparent" android:text="@string/shared_string_save"/> diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ParkingPositionMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ParkingPositionMenuController.java index c974bda33c..d901221df1 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ParkingPositionMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/ParkingPositionMenuController.java @@ -39,7 +39,8 @@ public class ParkingPositionMenuController extends MenuController { } } }; - leftTitleButtonController.caption = getMapActivity().getString(R.string.osmand_parking_delete); + leftTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete); + leftTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark; } @Override diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java index 908a7c6bf6..ddc0b534d5 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/TargetPointMenuController.java @@ -30,7 +30,8 @@ public class TargetPointMenuController extends MenuController { getMapActivity().getContextMenu().close(); } }; - leftTitleButtonController.caption = getMapActivity().getString(R.string.delete_target_point); + leftTitleButtonController.caption = getMapActivity().getString(R.string.shared_string_delete); + leftTitleButtonController.leftIconId = R.drawable.ic_action_delete_dark; } @Override diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java index 7db5e4925e..0cddf2ae78 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java @@ -298,10 +298,7 @@ public class ParkingPositionPlugin extends OsmandPlugin { @Override public void onClick(DialogInterface dialog, int which) { showDeleteEventWarning(activity); - if (parkingLayer != null) { - parkingLayer.refresh(); - } - clearParkingPosition(); + cancelParking(); if (activity instanceof MapActivity) { ((MapActivity) activity).getContextMenu().close(); } @@ -323,7 +320,12 @@ public class ParkingPositionPlugin extends OsmandPlugin { Builder setTime = new AlertDialog.Builder(mapActivity); setTime.setView(setTimeParking); setTime.setTitle(mapActivity.getString(R.string.osmand_parking_time_limit_title)); - setTime.setNegativeButton(R.string.shared_string_cancel, null); + setTime.setNegativeButton(R.string.shared_string_cancel, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + cancelParking(); + } + }); final TextView textView = (TextView) setTimeParking.findViewById(R.id.parkTime); final TimePicker timePicker = (TimePicker) setTimeParking.findViewById(R.id.parking_time_picker); @@ -433,7 +435,14 @@ public class ParkingPositionPlugin extends OsmandPlugin { parkingLayer.refresh(); } } - + + private void cancelParking() { + if (parkingLayer != null) { + parkingLayer.refresh(); + } + clearParkingPosition(); + } + @Override public void registerOptionsMenuItems(final MapActivity mapActivity, ContextMenuAdapter helper) { }