Skip to content

Commit

Permalink
Make export finished dialog cancellable.
Browse files Browse the repository at this point in the history
Related #40.
  • Loading branch information
zamojski committed Aug 26, 2020
1 parent 88e74c1 commit 44aef25
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ public void displayExportFinishedDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle(R.string.export_dialog_finished_title);
builder.setView(dialogLayout);
builder.setCancelable(true);
if (shareEnabled) {
builder.setPositiveButton(R.string.dialog_share, (dialog, which) -> {
exportShareAction();
Expand All @@ -725,7 +726,6 @@ public void displayExportFinishedDialog() {
exportedFilePaths = null;
});
}

builder.setNeutralButton(R.string.dialog_upload, (dialog, which) -> {
MyApplication.getAnalytics().sendExportUploadAction();
startUploaderServiceWithCheck();
Expand All @@ -748,11 +748,12 @@ public void displayExportFinishedDialog() {
deleteDialog.setCancelable(true);
deleteDialog.show();
});
builder.setOnCancelListener(dialog -> {
exportKeepAction();
exportedFilePaths = null;
});

AlertDialog dialog = builder.create();
dialog.setCanceledOnTouchOutside(false);
dialog.setCancelable(false);

dialog.setOnShowListener(dialog1 -> {
shareCheckbox.setChecked(shareEnabled);
shareCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
Expand Down

0 comments on commit 44aef25

Please sign in to comment.