refactor action

This commit is contained in:
veliymolfar 2020-07-02 18:04:18 +03:00
parent a64ce0b2c9
commit 28ba180f50
2 changed files with 5 additions and 3 deletions

View file

@ -11,6 +11,7 @@
Thx - Hardy
-->
<string name="quick_action_remove_next_destination_descr">The current destination point on the route will be deleted. If it will be the Destination, navigation will stop.</string>
<string name="use_volume_buttons_as_zoom">Volume buttons as zoom</string>
<string name="use_volume_buttons_as_zoom_descr">Enable to control the map zoom level with device volume buttons.</string>
<string name="quick_action_remove_next_destination">Delete next destination point</string>

View file

@ -9,6 +9,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapcontextmenu.other.DestinationReachedMenu;
import net.osmand.plus.quickaction.QuickAction;
import net.osmand.plus.quickaction.QuickActionType;
@ -17,7 +18,7 @@ public class NavRemoveNextDestination extends QuickAction {
public static final QuickActionType TYPE = new QuickActionType(34,
"nav.destination.remove", NavRemoveNextDestination.class)
.nameRes(R.string.quick_action_remove_next_destination)
.iconRes(R.drawable.ic_action_direction_movement)
.iconRes(R.drawable.ic_action_navigation_skip_destination)
.nonEditable()
.category(QuickActionType.NAVIGATION);
@ -35,7 +36,7 @@ public class NavRemoveNextDestination extends QuickAction {
if (targetsHelper.getIntermediatePoints().size() > 0) {
targetsHelper.removeWayPoint(true, 0);
} else {
activity.getMapActions().stopNavigationActionConfirm();
DestinationReachedMenu.show(activity);
}
}
@ -43,7 +44,7 @@ public class NavRemoveNextDestination extends QuickAction {
public void drawUI(ViewGroup parent, MapActivity activity) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.quick_action_with_text, parent, false);
((TextView) view.findViewById(R.id.text)).setText(R.string.quick_action_remove_next_destination);
((TextView) view.findViewById(R.id.text)).setText(R.string.quick_action_remove_next_destination_descr);
parent.addView(view);
}