use of net.osmand.plus.plugins.osmedit.OsmEditingPlugin in project Osmand by osmandapp.
the class ValidateOsmLoginDetailsTask method doInBackground.
@Override
protected OsmBugResult doInBackground(Void... params) {
OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);
assert plugin != null;
OsmBugsRemoteUtil remoteUtil = plugin.getOsmNotesRemoteUtil();
return remoteUtil.validateLoginDetails();
}
use of net.osmand.plus.plugins.osmedit.OsmEditingPlugin in project Osmand by osmandapp.
the class SimpleProgressDialogPoiUploader method showProgressDialog.
@Override
public void showProgressDialog(OsmPoint[] points, boolean closeChangeSet, boolean anonymously) {
ProgressDialogFragment dialog = ProgressDialogFragment.createInstance(R.string.uploading, R.string.local_openstreetmap_uploading, ProgressDialog.STYLE_HORIZONTAL);
OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);
OsmEditsUploadListener listener = new OsmEditsUploadListenerHelper(mapActivity, mapActivity.getString(R.string.local_openstreetmap_were_uploaded)) {
@Override
public void uploadEnded(Map<OsmPoint, String> loadErrorsMap) {
super.uploadEnded(loadErrorsMap);
mapActivity.getContextMenu().close();
OsmBugsLayer l = mapActivity.getMapView().getLayerByClass(OsmBugsLayer.class);
if (l != null) {
l.clearCache();
mapActivity.refreshMap();
}
}
};
dialog.show(mapActivity.getSupportFragmentManager(), ProgressDialogFragment.TAG);
UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask(dialog, listener, plugin, points.length, closeChangeSet, anonymously);
uploadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, points);
}
use of net.osmand.plus.plugins.osmedit.OsmEditingPlugin in project Osmand by osmandapp.
the class OsmandDevelopmentPlugin method disable.
@Override
public void disable(OsmandApplication app) {
OsmEditingPlugin osmPlugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);
if (osmPlugin != null && osmPlugin.OSM_USE_DEV_URL.get()) {
osmPlugin.OSM_USE_DEV_URL.set(false);
app.getOsmOAuthHelper().resetAuthorization();
}
OpenPlaceReviewsPlugin oprPlugin = OsmandPlugin.getPlugin(OpenPlaceReviewsPlugin.class);
if (oprPlugin != null && oprPlugin.OPR_USE_DEV_URL.get()) {
oprPlugin.OPR_USE_DEV_URL.set(false);
app.getOprAuthHelper().resetAuthorization();
}
super.disable(app);
}
use of net.osmand.plus.plugins.osmedit.OsmEditingPlugin in project Osmand by osmandapp.
the class ShowHideOSMBugAction method execute.
@Override
public void execute(@NonNull MapActivity mapActivity) {
OsmEditingPlugin plugin = OsmandPlugin.getActivePlugin(OsmEditingPlugin.class);
if (plugin != null) {
plugin.SHOW_OSM_BUGS.set(!plugin.SHOW_OSM_BUGS.get());
plugin.updateLayers(mapActivity, mapActivity);
mapActivity.getMapView().refreshMap(true);
}
}
use of net.osmand.plus.plugins.osmedit.OsmEditingPlugin in project Osmand by osmandapp.
the class OsmEditsUploadListenerHelper method showUploadItemsProgressDialog.
private static void showUploadItemsProgressDialog(Fragment fragment, OsmPoint[] toUpload) {
FragmentActivity activity = fragment.getActivity();
OsmEditingPlugin plugin = OsmandPlugin.getActivePlugin(OsmEditingPlugin.class);
OsmEditsUploadListenerHelper helper = new OsmEditsUploadListenerHelper(activity, activity.getResources().getString(R.string.local_openstreetmap_were_uploaded));
ProgressDialogFragment dialog = ProgressDialogFragment.createInstance(R.string.uploading, R.string.local_openstreetmap_uploading, ProgressDialog.STYLE_HORIZONTAL);
dialog.show(activity.getSupportFragmentManager(), ProgressDialogFragment.TAG);
UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask(dialog, helper, plugin, toUpload.length, false, false);
uploadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, toUpload);
}
Aggregations