use of net.osmand.plus.dialogs.ProgressDialogFragment in project Osmand by osmandapp.
the class OsmEditsFragment method showProgressDialog.
public void showProgressDialog(OsmPoint[] points, boolean closeChangeSet, boolean anonymously) {
ProgressDialogFragment dialog = ProgressDialogFragment.createInstance(R.string.uploading, R.string.local_openstreetmap_uploading, ProgressDialog.STYLE_HORIZONTAL);
OsmEditsUploadListener listener = new OsmEditsUploadListenerHelper(getActivity(), getString(R.string.local_openstreetmap_were_uploaded)) {
@Override
public void uploadEnded(Map<OsmPoint, String> loadErrorsMap) {
super.uploadEnded(loadErrorsMap);
for (OsmPoint osmPoint : loadErrorsMap.keySet()) {
if (loadErrorsMap.get(osmPoint) == null) {
osmEdits.remove(osmPoint);
}
}
recreateAdapterData();
}
};
dialog.show(getActivity().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.dialogs.ProgressDialogFragment in project Osmand by osmandapp.
the class OsmEditsFragment method showProgressDialog.
public void showProgressDialog(OsmPoint[] points, boolean closeChangeSet, boolean anonymously) {
ProgressDialogFragment dialog = ProgressDialogFragment.createInstance(R.string.uploading, R.string.local_openstreetmap_uploading, ProgressDialog.STYLE_HORIZONTAL);
OsmEditsUploadListener listener = new OsmEditsUploadListenerHelper(getActivity(), getString(R.string.local_openstreetmap_were_uploaded)) {
@Override
public void uploadEnded(Map<OsmPoint, String> loadErrorsMap) {
super.uploadEnded(loadErrorsMap);
for (Map.Entry<OsmPoint, String> entry : loadErrorsMap.entrySet()) {
if (entry.getValue() == null) {
osmEdits.remove(entry.getKey());
}
}
recreateAdapterData();
}
};
dialog.show(getActivity().getSupportFragmentManager(), ProgressDialogFragment.TAG);
UploadOpenstreetmapPointAsyncTask uploadTask = new UploadOpenstreetmapPointAsyncTask(dialog, listener, plugin, points.length, closeChangeSet, anonymously);
uploadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, points);
}
Aggregations