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);

View File

@ -427,7 +427,8 @@ abrir en modo popup</string>
<string name="grid">Mostrar como grilla</string>
<string name="list">Mostrar como lista</string>
<string name="clear_finished_download">Limpiar descargas finalizadas</string>
<string name="msg_pending_downloads">Continúa tus %s transferencias pendientes desde Descargas</string>
<string name="confirm_prompt">¿Estas seguro?</string>
<string name="msg_pending_downloads">Tienes %s descargas pendientes, ve a Descargas para continuarlas</string>
<string name="stop">Detener</string>
<string name="max_retry_msg">Intentos máximos</string>
<string name="max_retry_desc">Cantidad máxima de intentos antes de cancelar la descarga</string>

View File

@ -536,6 +536,7 @@
<string name="error_progress_lost">Progress lost, because the file was deleted</string>
<string name="clear_finished_download">Clear finished downloads</string>
<string name="confirm_prompt">Are you sure?</string>
<string name="msg_pending_downloads">Continue your %s pending transfers from Downloads</string>
<string name="stop">Stop</string>
<string name="max_retry_msg">Maximum retries</string>