From 1089de6321ccce883fbd5bf9fe8a7c1c2db1febb Mon Sep 17 00:00:00 2001 From: kapodamy Date: Sun, 14 Apr 2019 22:51:59 -0300 Subject: [PATCH] Add confirm dialog before clear the finished download list --- .../us/shandian/giga/ui/fragment/MissionsFragment.java | 8 +++++++- app/src/main/res/values-es/strings.xml | 3 ++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java index bd5ce9215..f8cecbed9 100644 --- a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java +++ b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java @@ -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); diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 4cc394357..af5b8b213 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -427,7 +427,8 @@ abrir en modo popup Mostrar como grilla Mostrar como lista Limpiar descargas finalizadas - Continúa tus %s transferencias pendientes desde Descargas + ¿Estas seguro? + Tienes %s descargas pendientes, ve a Descargas para continuarlas Detener Intentos máximos Cantidad máxima de intentos antes de cancelar la descarga diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 10b36c1c7..9df9bd051 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -536,6 +536,7 @@ Progress lost, because the file was deleted Clear finished downloads + Are you sure? Continue your %s pending transfers from Downloads Stop Maximum retries