Search in sources :

Example 6 with DayNightProgressDialog

use of org.odk.collect.android.views.DayNightProgressDialog in project collect by opendatakit.

the class SavedFormListFragment method deleteSelectedInstances.

/**
 * Deletes the selected files. Content provider handles removing the files
 * from the filesystem.
 */
private void deleteSelectedInstances() {
    if (deleteInstancesTask == null) {
        progressDialog = new DayNightProgressDialog(getContext());
        progressDialog.setMessage(getResources().getString(R.string.form_delete_message));
        progressDialog.setIndeterminate(true);
        progressDialog.setCancelable(false);
        progressDialog.show();
        deleteInstancesTask = new DeleteInstancesTask(instancesRepositoryProvider.get(), formsRepositoryProvider.get());
        deleteInstancesTask.setDeleteListener(this);
        deleteInstancesTask.execute(getCheckedIdObjects());
    } else {
        ToastUtils.showLongToast(requireContext(), R.string.file_delete_in_progress);
    }
}
Also used : DayNightProgressDialog(org.odk.collect.android.views.DayNightProgressDialog) DeleteInstancesTask(org.odk.collect.android.tasks.DeleteInstancesTask)

Aggregations

DayNightProgressDialog (org.odk.collect.android.views.DayNightProgressDialog)6 DialogInterface (android.content.DialogInterface)3 ProgressDialog (android.app.ProgressDialog)1 NonNull (androidx.annotation.NonNull)1 MaterialAlertDialogBuilder (com.google.android.material.dialog.MaterialAlertDialogBuilder)1 DeleteInstancesTask (org.odk.collect.android.tasks.DeleteInstancesTask)1 AuthDialogUtility (org.odk.collect.android.utilities.AuthDialogUtility)1