Search in sources :

Example 1 with SuggestedDownloadsItem

use of net.osmand.plus.settings.backend.backup.items.SuggestedDownloadsItem in project Osmand by osmandapp.

the class SettingsItemsFactory method createItem.

@Nullable
private SettingsItem createItem(@NonNull JSONObject json) throws IllegalArgumentException, JSONException {
    SettingsItem item = null;
    SettingsItemType type = SettingsItem.parseItemType(json);
    if (type == null) {
        return null;
    }
    OsmandSettings settings = app.getSettings();
    switch(type) {
        case GLOBAL:
            item = new GlobalSettingsItem(settings, json);
            break;
        case PROFILE:
            item = new ProfileSettingsItem(app, json);
            break;
        case PLUGIN:
            item = new PluginSettingsItem(app, json);
            break;
        case DATA:
            item = new DataSettingsItem(app, json);
            break;
        case FILE:
            item = new FileSettingsItem(app, json);
            break;
        case RESOURCES:
            item = new ResourcesSettingsItem(app, json);
            break;
        case QUICK_ACTIONS:
            item = new QuickActionsSettingsItem(app, json);
            break;
        case POI_UI_FILTERS:
            item = new PoiUiFiltersSettingsItem(app, json);
            break;
        case MAP_SOURCES:
            item = new MapSourcesSettingsItem(app, json);
            break;
        case AVOID_ROADS:
            item = new AvoidRoadsSettingsItem(app, json);
            break;
        case SUGGESTED_DOWNLOADS:
            item = new SuggestedDownloadsItem(app, json);
            break;
        case DOWNLOADS:
            item = new DownloadsItem(app, json);
            break;
        case OSM_NOTES:
            item = new OsmNotesSettingsItem(app, json);
            break;
        case OSM_EDITS:
            item = new OsmEditsSettingsItem(app, json);
            break;
        case FAVOURITES:
            item = new FavoritesSettingsItem(app, json);
            break;
        case ACTIVE_MARKERS:
            item = new MarkersSettingsItem(app, json);
            break;
        case HISTORY_MARKERS:
            item = new HistoryMarkersSettingsItem(app, json);
            break;
        case SEARCH_HISTORY:
            item = new SearchHistorySettingsItem(app, json);
            break;
        case GPX:
            item = new GpxSettingsItem(app, json);
            break;
        case ONLINE_ROUTING_ENGINES:
            item = new OnlineRoutingSettingsItem(app, json);
            break;
        case ITINERARY_GROUPS:
            item = new ItinerarySettingsItem(app, json);
            break;
    }
    return item;
}
Also used : SearchHistorySettingsItem(net.osmand.plus.settings.backend.backup.items.SearchHistorySettingsItem) ProfileSettingsItem(net.osmand.plus.settings.backend.backup.items.ProfileSettingsItem) OsmEditsSettingsItem(net.osmand.plus.settings.backend.backup.items.OsmEditsSettingsItem) DataSettingsItem(net.osmand.plus.settings.backend.backup.items.DataSettingsItem) GpxSettingsItem(net.osmand.plus.settings.backend.backup.items.GpxSettingsItem) ResourcesSettingsItem(net.osmand.plus.settings.backend.backup.items.ResourcesSettingsItem) OsmNotesSettingsItem(net.osmand.plus.settings.backend.backup.items.OsmNotesSettingsItem) OsmandSettings(net.osmand.plus.settings.backend.OsmandSettings) QuickActionsSettingsItem(net.osmand.plus.settings.backend.backup.items.QuickActionsSettingsItem) PoiUiFiltersSettingsItem(net.osmand.plus.settings.backend.backup.items.PoiUiFiltersSettingsItem) ItinerarySettingsItem(net.osmand.plus.settings.backend.backup.items.ItinerarySettingsItem) GlobalSettingsItem(net.osmand.plus.settings.backend.backup.items.GlobalSettingsItem) DownloadsItem(net.osmand.plus.settings.backend.backup.items.DownloadsItem) SuggestedDownloadsItem(net.osmand.plus.settings.backend.backup.items.SuggestedDownloadsItem) PoiUiFiltersSettingsItem(net.osmand.plus.settings.backend.backup.items.PoiUiFiltersSettingsItem) FavoritesSettingsItem(net.osmand.plus.settings.backend.backup.items.FavoritesSettingsItem) SettingsItem(net.osmand.plus.settings.backend.backup.items.SettingsItem) OsmEditsSettingsItem(net.osmand.plus.settings.backend.backup.items.OsmEditsSettingsItem) AvoidRoadsSettingsItem(net.osmand.plus.settings.backend.backup.items.AvoidRoadsSettingsItem) SearchHistorySettingsItem(net.osmand.plus.settings.backend.backup.items.SearchHistorySettingsItem) GpxSettingsItem(net.osmand.plus.settings.backend.backup.items.GpxSettingsItem) PluginSettingsItem(net.osmand.plus.settings.backend.backup.items.PluginSettingsItem) ProfileSettingsItem(net.osmand.plus.settings.backend.backup.items.ProfileSettingsItem) OsmNotesSettingsItem(net.osmand.plus.settings.backend.backup.items.OsmNotesSettingsItem) MarkersSettingsItem(net.osmand.plus.settings.backend.backup.items.MarkersSettingsItem) GlobalSettingsItem(net.osmand.plus.settings.backend.backup.items.GlobalSettingsItem) FileSettingsItem(net.osmand.plus.settings.backend.backup.items.FileSettingsItem) HistoryMarkersSettingsItem(net.osmand.plus.settings.backend.backup.items.HistoryMarkersSettingsItem) MapSourcesSettingsItem(net.osmand.plus.settings.backend.backup.items.MapSourcesSettingsItem) DataSettingsItem(net.osmand.plus.settings.backend.backup.items.DataSettingsItem) OnlineRoutingSettingsItem(net.osmand.plus.settings.backend.backup.items.OnlineRoutingSettingsItem) ItinerarySettingsItem(net.osmand.plus.settings.backend.backup.items.ItinerarySettingsItem) ResourcesSettingsItem(net.osmand.plus.settings.backend.backup.items.ResourcesSettingsItem) QuickActionsSettingsItem(net.osmand.plus.settings.backend.backup.items.QuickActionsSettingsItem) FileSettingsItem(net.osmand.plus.settings.backend.backup.items.FileSettingsItem) OnlineRoutingSettingsItem(net.osmand.plus.settings.backend.backup.items.OnlineRoutingSettingsItem) SuggestedDownloadsItem(net.osmand.plus.settings.backend.backup.items.SuggestedDownloadsItem) MapSourcesSettingsItem(net.osmand.plus.settings.backend.backup.items.MapSourcesSettingsItem) FavoritesSettingsItem(net.osmand.plus.settings.backend.backup.items.FavoritesSettingsItem) MarkersSettingsItem(net.osmand.plus.settings.backend.backup.items.MarkersSettingsItem) HistoryMarkersSettingsItem(net.osmand.plus.settings.backend.backup.items.HistoryMarkersSettingsItem) HistoryMarkersSettingsItem(net.osmand.plus.settings.backend.backup.items.HistoryMarkersSettingsItem) PluginSettingsItem(net.osmand.plus.settings.backend.backup.items.PluginSettingsItem) AvoidRoadsSettingsItem(net.osmand.plus.settings.backend.backup.items.AvoidRoadsSettingsItem) Nullable(androidx.annotation.Nullable)

Aggregations

Nullable (androidx.annotation.Nullable)1 OsmandSettings (net.osmand.plus.settings.backend.OsmandSettings)1 AvoidRoadsSettingsItem (net.osmand.plus.settings.backend.backup.items.AvoidRoadsSettingsItem)1 DataSettingsItem (net.osmand.plus.settings.backend.backup.items.DataSettingsItem)1 DownloadsItem (net.osmand.plus.settings.backend.backup.items.DownloadsItem)1 FavoritesSettingsItem (net.osmand.plus.settings.backend.backup.items.FavoritesSettingsItem)1 FileSettingsItem (net.osmand.plus.settings.backend.backup.items.FileSettingsItem)1 GlobalSettingsItem (net.osmand.plus.settings.backend.backup.items.GlobalSettingsItem)1 GpxSettingsItem (net.osmand.plus.settings.backend.backup.items.GpxSettingsItem)1 HistoryMarkersSettingsItem (net.osmand.plus.settings.backend.backup.items.HistoryMarkersSettingsItem)1 ItinerarySettingsItem (net.osmand.plus.settings.backend.backup.items.ItinerarySettingsItem)1 MapSourcesSettingsItem (net.osmand.plus.settings.backend.backup.items.MapSourcesSettingsItem)1 MarkersSettingsItem (net.osmand.plus.settings.backend.backup.items.MarkersSettingsItem)1 OnlineRoutingSettingsItem (net.osmand.plus.settings.backend.backup.items.OnlineRoutingSettingsItem)1 OsmEditsSettingsItem (net.osmand.plus.settings.backend.backup.items.OsmEditsSettingsItem)1 OsmNotesSettingsItem (net.osmand.plus.settings.backend.backup.items.OsmNotesSettingsItem)1 PluginSettingsItem (net.osmand.plus.settings.backend.backup.items.PluginSettingsItem)1 PoiUiFiltersSettingsItem (net.osmand.plus.settings.backend.backup.items.PoiUiFiltersSettingsItem)1 ProfileSettingsItem (net.osmand.plus.settings.backend.backup.items.ProfileSettingsItem)1 QuickActionsSettingsItem (net.osmand.plus.settings.backend.backup.items.QuickActionsSettingsItem)1