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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user