Clean up AlertDialogs

This commit is contained in:
TacoTheDank 2023-07-11 21:54:10 -04:00
parent e33bb676f9
commit c1f0a945c0
15 changed files with 89 additions and 112 deletions

View file

@ -538,7 +538,6 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb
builder.setNegativeButton(R.string.ok, (dialog, which) -> dialog.cancel())
.setTitle(mission.storage.getName())
.create()
.show();
}

View file

@ -211,12 +211,11 @@ public class MissionsFragment extends Fragment {
.setTitle(R.string.clear_download_history)
.setMessage(R.string.confirm_prompt)
// Intentionally misusing buttons' purpose in order to achieve good order
.setNegativeButton(R.string.clear_download_history,
(dialog, which) -> mAdapter.clearFinishedDownloads(false))
.setNegativeButton(R.string.clear_download_history, (dialog, which) ->
mAdapter.clearFinishedDownloads(false))
.setNeutralButton(R.string.cancel, null)
.setPositiveButton(R.string.delete_downloaded_files,
(dialog, which) -> showDeleteDownloadedFilesConfirmationPrompt())
.create()
.setPositiveButton(R.string.delete_downloaded_files, (dialog, which) ->
showDeleteDownloadedFilesConfirmationPrompt())
.show();
}
@ -225,9 +224,8 @@ public class MissionsFragment extends Fragment {
new AlertDialog.Builder(mContext)
.setTitle(R.string.delete_downloaded_files_confirm)
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok,
(dialog, which) -> mAdapter.clearFinishedDownloads(true))
.create()
.setPositiveButton(R.string.ok, (dialog, which) ->
mAdapter.clearFinishedDownloads(true))
.show();
}