use of net.osmand.plus.settings.backend.backup.items.DataSettingsItem 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;
}
Aggregations