refactor action
This commit is contained in:
parent
a64ce0b2c9
commit
28ba180f50
2 changed files with 5 additions and 3 deletions
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue