1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-11-06 18:23:01 +00:00

Add confirm dialog before clear the finished download list

This commit is contained in:
kapodamy
2019-04-14 22:51:59 -03:00
parent d00dc798f4
commit 1089de6321
3 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package us.shandian.giga.ui.fragment;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -179,7 +180,12 @@ public class MissionsFragment extends Fragment {
updateList();
return true;
case R.id.clear_list:
mAdapter.clearFinishedDownloads();
AlertDialog.Builder prompt = new AlertDialog.Builder(mContext);
prompt.setTitle(R.string.clear_finished_download);
prompt.setMessage(R.string.confirm_prompt);
prompt.setPositiveButton(android.R.string.ok, (dialog, which) -> mAdapter.clearFinishedDownloads());
prompt.setNegativeButton(R.string.cancel, null);
prompt.create().show();
return true;
case R.id.start_downloads:
item.setVisible(false);