Search in sources :

Example 1 with NavVoiceAction

use of net.osmand.plus.quickaction.actions.NavVoiceAction 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;
}
Also used : AudioVideoNotesPlugin(net.osmand.plus.audionotes.AudioVideoNotesPlugin) NavStartStopAction(net.osmand.plus.quickaction.actions.NavStartStopAction) ArrayList(java.util.ArrayList) MapUnderlayAction(net.osmand.plus.quickaction.actions.MapUnderlayAction) ShowHideFavoritesAction(net.osmand.plus.quickaction.actions.ShowHideFavoritesAction) ParkingPositionPlugin(net.osmand.plus.parkingpoint.ParkingPositionPlugin) NavVoiceAction(net.osmand.plus.quickaction.actions.NavVoiceAction) NavReplaceDestinationAction(net.osmand.plus.quickaction.actions.NavReplaceDestinationAction) TakeAudioNoteAction(net.osmand.plus.audionotes.TakeAudioNoteAction) NavAutoZoomMapAction(net.osmand.plus.quickaction.actions.NavAutoZoomMapAction) NavAddFirstIntermediateAction(net.osmand.plus.quickaction.actions.NavAddFirstIntermediateAction) FavoriteAction(net.osmand.plus.quickaction.actions.FavoriteAction) OsmandRasterMapsPlugin(net.osmand.plus.rastermaps.OsmandRasterMapsPlugin) NavResumePauseAction(net.osmand.plus.quickaction.actions.NavResumePauseAction) AddPOIAction(net.osmand.plus.quickaction.actions.AddPOIAction) MarkerAction(net.osmand.plus.quickaction.actions.MarkerAction) MapSourceAction(net.osmand.plus.quickaction.actions.MapSourceAction) MapOverlayAction(net.osmand.plus.quickaction.actions.MapOverlayAction) TakeVideoNoteAction(net.osmand.plus.audionotes.TakeVideoNoteAction) MapStyleAction(net.osmand.plus.quickaction.actions.MapStyleAction) TakePhotoNoteAction(net.osmand.plus.audionotes.TakePhotoNoteAction) OsmEditingPlugin(net.osmand.plus.osmedit.OsmEditingPlugin) GPXAction(net.osmand.plus.quickaction.actions.GPXAction) ShowHideOSMBugAction(net.osmand.plus.quickaction.actions.ShowHideOSMBugAction) AddOSMBugAction(net.osmand.plus.quickaction.actions.AddOSMBugAction) NavAddDestinationAction(net.osmand.plus.quickaction.actions.NavAddDestinationAction) ParkingAction(net.osmand.plus.parkingpoint.ParkingAction) ShowHidePoiAction(net.osmand.plus.quickaction.actions.ShowHidePoiAction)

Aggregations

ArrayList (java.util.ArrayList)1 AudioVideoNotesPlugin (net.osmand.plus.audionotes.AudioVideoNotesPlugin)1 TakeAudioNoteAction (net.osmand.plus.audionotes.TakeAudioNoteAction)1 TakePhotoNoteAction (net.osmand.plus.audionotes.TakePhotoNoteAction)1 TakeVideoNoteAction (net.osmand.plus.audionotes.TakeVideoNoteAction)1 OsmEditingPlugin (net.osmand.plus.osmedit.OsmEditingPlugin)1 ParkingAction (net.osmand.plus.parkingpoint.ParkingAction)1 ParkingPositionPlugin (net.osmand.plus.parkingpoint.ParkingPositionPlugin)1 AddOSMBugAction (net.osmand.plus.quickaction.actions.AddOSMBugAction)1 AddPOIAction (net.osmand.plus.quickaction.actions.AddPOIAction)1 FavoriteAction (net.osmand.plus.quickaction.actions.FavoriteAction)1 GPXAction (net.osmand.plus.quickaction.actions.GPXAction)1 MapOverlayAction (net.osmand.plus.quickaction.actions.MapOverlayAction)1 MapSourceAction (net.osmand.plus.quickaction.actions.MapSourceAction)1 MapStyleAction (net.osmand.plus.quickaction.actions.MapStyleAction)1 MapUnderlayAction (net.osmand.plus.quickaction.actions.MapUnderlayAction)1 MarkerAction (net.osmand.plus.quickaction.actions.MarkerAction)1 NavAddDestinationAction (net.osmand.plus.quickaction.actions.NavAddDestinationAction)1 NavAddFirstIntermediateAction (net.osmand.plus.quickaction.actions.NavAddFirstIntermediateAction)1 NavAutoZoomMapAction (net.osmand.plus.quickaction.actions.NavAutoZoomMapAction)1