use of net.osmand.plus.quickaction.actions.NavReplaceDestinationAction in project Osmand by osmandapp.
the class QuickActionFactory method produceTypeActionsListWithHeaders.
public static List<QuickAction> produceTypeActionsListWithHeaders(List<QuickAction> active) {
ArrayList<QuickAction> quickActions = new ArrayList<>();
quickActions.add(new QuickAction(0, R.string.quick_action_add_create_items));
quickActions.add(new FavoriteAction());
quickActions.add(new GPXAction());
QuickAction marker = new MarkerAction();
if (!marker.hasInstanceInList(active)) {
quickActions.add(marker);
}
if (OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class) != null) {
QuickAction audio = new TakeAudioNoteAction();
QuickAction photo = new TakePhotoNoteAction();
QuickAction video = new TakeVideoNoteAction();
if (!audio.hasInstanceInList(active)) {
quickActions.add(audio);
}
if (!photo.hasInstanceInList(active)) {
quickActions.add(photo);
}
if (!video.hasInstanceInList(active)) {
quickActions.add(video);
}
}
if (OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null) {
quickActions.add(new AddPOIAction());
quickActions.add(new AddOSMBugAction());
}
if (OsmandPlugin.getEnabledPlugin(ParkingPositionPlugin.class) != null) {
QuickAction parking = new ParkingAction();
if (!parking.hasInstanceInList(active)) {
quickActions.add(parking);
}
}
quickActions.add(new QuickAction(0, R.string.quick_action_add_configure_map));
QuickAction favorites = new ShowHideFavoritesAction();
if (!favorites.hasInstanceInList(active)) {
quickActions.add(favorites);
}
quickActions.add(new ShowHidePoiAction());
if (OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null) {
QuickAction showHideOSMBugAction = new ShowHideOSMBugAction();
if (!showHideOSMBugAction.hasInstanceInList(active)) {
quickActions.add(showHideOSMBugAction);
}
}
quickActions.add(new MapStyleAction());
if (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null) {
quickActions.add(new MapSourceAction());
quickActions.add(new MapOverlayAction());
quickActions.add(new MapUnderlayAction());
}
QuickAction voice = new NavVoiceAction();
QuickAction addDestination = new NavAddDestinationAction();
QuickAction addFirstIntermediate = new NavAddFirstIntermediateAction();
QuickAction replaceDestination = new NavReplaceDestinationAction();
QuickAction autoZoomMap = new NavAutoZoomMapAction();
QuickAction startStopNavigation = new NavStartStopAction();
QuickAction resumePauseNavigation = new NavResumePauseAction();
ArrayList<QuickAction> navigationQuickActions = new ArrayList<>();
if (!voice.hasInstanceInList(active)) {
navigationQuickActions.add(voice);
}
if (!addDestination.hasInstanceInList(active)) {
navigationQuickActions.add(addDestination);
}
if (!addFirstIntermediate.hasInstanceInList(active)) {
navigationQuickActions.add(addFirstIntermediate);
}
if (!replaceDestination.hasInstanceInList(active)) {
navigationQuickActions.add(replaceDestination);
}
if (!autoZoomMap.hasInstanceInList(active)) {
navigationQuickActions.add(autoZoomMap);
}
if (!startStopNavigation.hasInstanceInList(active)) {
navigationQuickActions.add(startStopNavigation);
}
if (!resumePauseNavigation.hasInstanceInList(active)) {
navigationQuickActions.add(resumePauseNavigation);
}
if (navigationQuickActions.size() > 0) {
quickActions.add(new QuickAction(0, R.string.quick_action_add_navigation));
quickActions.addAll(navigationQuickActions);
}
return quickActions;
}
Aggregations