From 2746c52d7b23eee0e87879d7023a207334a9d0dd Mon Sep 17 00:00:00 2001 From: m2049r Date: Sun, 25 Apr 2021 14:26:46 +0200 Subject: [PATCH] confirm checkboxes for delete confirmation dialogs (#759) --- .../com/m2049r/xmrwallet/LoginActivity.java | 21 +++++++++++++++---- app/src/main/res/layout/checkbox_confirm.xml | 13 ++++++++++++ app/src/main/res/values-cat/strings.xml | 2 +- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-el/strings.xml | 2 +- app/src/main/res/values-eo/strings.xml | 2 +- app/src/main/res/values-es/strings.xml | 2 +- app/src/main/res/values-et/strings.xml | 2 +- app/src/main/res/values-fr/strings.xml | 2 +- app/src/main/res/values-hu/strings.xml | 2 +- app/src/main/res/values-it/strings.xml | 4 ++-- app/src/main/res/values-ja/strings.xml | 2 +- app/src/main/res/values-nb/strings.xml | 2 +- app/src/main/res/values-nl/strings.xml | 2 +- app/src/main/res/values-pt-rBR/strings.xml | 2 +- app/src/main/res/values-pt/strings.xml | 2 +- app/src/main/res/values-ro/strings.xml | 2 +- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-sk/strings.xml | 2 +- app/src/main/res/values-sr/strings.xml | 2 +- app/src/main/res/values-sv/strings.xml | 2 +- app/src/main/res/values-uk/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- external-libs/VERSION | 2 +- 26 files changed, 55 insertions(+), 29 deletions(-) create mode 100644 app/src/main/res/layout/checkbox_confirm.xml diff --git a/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java b/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java index 1a660d6..539095a 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java +++ b/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java @@ -44,6 +44,7 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; +import com.google.android.material.checkbox.MaterialCheckBox; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.m2049r.xmrwallet.data.DefaultNodes; import com.m2049r.xmrwallet.data.Node; @@ -554,12 +555,18 @@ public class LoginActivity extends BaseActivity } }; - AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this); - builder.setMessage(getString(R.string.delete_alert_message)) + final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this); + final AlertDialog confirm = builder.setMessage(getString(R.string.delete_alert_message)) .setTitle(walletName) .setPositiveButton(getString(R.string.delete_alert_yes), dialogClickListener) .setNegativeButton(getString(R.string.delete_alert_no), dialogClickListener) + .setView(View.inflate(builder.getContext(), R.layout.checkbox_confirm, null)) .show(); + confirm.getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(false); + final MaterialCheckBox checkBox = confirm.findViewById(R.id.checkbox); + checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> { + confirm.getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(isChecked); + }); } @Override @@ -579,12 +586,18 @@ public class LoginActivity extends BaseActivity } }; - AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this); - builder.setMessage(getString(R.string.deletecache_alert_message, walletName)) + final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this); + final AlertDialog confirm = builder.setMessage(getString(R.string.deletecache_alert_message)) .setTitle(walletName) .setPositiveButton(getString(R.string.delete_alert_yes), dialogClickListener) .setNegativeButton(getString(R.string.delete_alert_no), dialogClickListener) + .setView(View.inflate(builder.getContext(), R.layout.checkbox_confirm, null)) .show(); + confirm.getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(false); + final MaterialCheckBox checkBox = confirm.findViewById(R.id.checkbox); + checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> { + confirm.getButton(DialogInterface.BUTTON_POSITIVE).setEnabled(isChecked); + }); } void reloadWalletList() { diff --git a/app/src/main/res/layout/checkbox_confirm.xml b/app/src/main/res/layout/checkbox_confirm.xml new file mode 100644 index 0000000..1ff959b --- /dev/null +++ b/app/src/main/res/layout/checkbox_confirm.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/app/src/main/res/values-cat/strings.xml b/app/src/main/res/values-cat/strings.xml index 10aae1c..43045e0 100644 --- a/app/src/main/res/values-cat/strings.xml +++ b/app/src/main/res/values-cat/strings.xml @@ -417,7 +417,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index f643e1a..f3f4a26 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -266,7 +266,7 @@ Nein, doch nicht! Details - Das Wallet wird gelöscht! + Das Wallet wird gelöscht. Dein Geld wird für immer verloren sein, außer wenn Du den Seed oder ein funktionierendes Backup hast um es wiederherzustellen. Ja, mach das! Nein, danke! diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 529cfca..42128fc 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -419,7 +419,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index bd85a3b..62a1afd 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -419,7 +419,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index ebf1bc0..f493af9 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -207,7 +207,7 @@ ¡Llévame de vuelta! Detalles - ¡El monedero será borrado! + Este monedero será borrado. Tus fondos se irán para siempre a menos que tengas tu semilla o una copia de seguridad funcional para recuperarlo. ¡Sí, hazlo! ¡No, gracias! diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index e058a83..fc6a770 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -417,7 +417,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index d8af4fa..70873ff 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -267,7 +267,7 @@ Non merci ! Détails - Le portefeuille sera supprimé ! + Ce portefeuille sera supprimé. Vos fonds seront perdus à jamais, sauf si vous disposez de votre semence ou d\'une sauvegarde fonctionnelle pour les récupérer. Oui, procéder ! Non merci ! diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 1a8d714..f83faa0 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -421,7 +421,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 2322408..1712f4d 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -266,7 +266,7 @@ Torna indietro! Dettagli - Il portafoglio verrà eliminato! + Questo portafoglio sarà cancellato. I tuoi fondi saranno andati per sempre a meno che tu non abbia il tuo seme o un backup funzionante per recuperarli. Sì, procedi! No grazie! @@ -366,7 +366,7 @@ Rescan! - I get it! + Ho capito! Next I\'m ready! diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index d853b66..81bfcb0 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -422,7 +422,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index f1e2113..c47fa2f 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -419,7 +419,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 2f0f59a..1bd80c7 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -261,7 +261,7 @@ Ga terug! Details - Er wordt de portemonnee verwijderd! + Deze portemonnee zal worden verwijderd. Uw geld zal voor altijd weg zijn, tenzij u uw zaad of een werkende back-up hebt om het te herstellen. Ja, doe dat! Nee, niet doen! diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 576e405..7c68403 100755 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -411,7 +411,7 @@ Selecione um subendereço Toque e segure para mais detalhes - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 5259101..c9395a7 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -423,7 +423,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 4570066..ecd406c 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -419,7 +419,7 @@ Selectează o subadresă Atinge lung pentru detalii - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 3e6196a..7412f32 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -265,7 +265,7 @@ Верните меня обратно! Подробная информация - Этот кошелек будет удален! + Этот кошелек будет удален. Твои деньги исчезнут навсегда, если у тебя нет сид-фразы или рабочей резервной копии для их восстановления. Да, сделай это! Нет, спасибо! diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 5340de4..dc44703 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -262,7 +262,7 @@ Naspäť! Detaily - Peňaženka bude zmazaná! + Táto peňaženka bude zmazaná. Vaše finančné prostriedky budú navždy preč, pokiaľ nemáte svoj seed alebo funkčnú zálohu na ich obnovenie. Áno, poďme na to! Nie, díky! diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 0f5d282..b70094f 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -272,7 +272,7 @@ Vrati me nazad! Detalji - Novčanik će biti obrisan! + Ovaj novčanik će biti obrisan. Vaša sredstva će zauvek nestati ako nemate svoje seme ili ispravnu rezervnu kopiju da biste ih vratili. Da, uradi to! Ne, hvala! diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index e7b4e56..eb8b553 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -411,7 +411,7 @@ Välj en subadress Tryck länge för mer detaljerad info - Denna plånbok kommer förstöras! + Denna plånbok kommer att raderas. Dina pengar kommer att vara borta för alltid om du inte har din seed eller en fungerande säkerhetskopia för att återställa dem. Förstöra Förstöringen misslyckades! diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 9cb77ae..73d31a9 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -265,7 +265,7 @@ Поверніть мене назад! Детальна інформація - Цей гаманець буде знищено! + Цей гаманець буде знищено. Ваші кошти назавжди зникнуть, якщо у вас немає насіння або діючої резервної копії для його відновлення. Так, зроби це! Ні, дякую! diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 3838a3d..084f359 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -343,7 +343,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 4cbe350..61991b5 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -418,7 +418,7 @@ Select a subaddress Long-press for details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Delete Delete failed! diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 32fb585..161e49d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -278,7 +278,7 @@ Take me back! Details - This wallet will be deleted! + This wallet will be deleted. Your funds will be gone forever unless you have your seed or a working backup to recover it. Yes, do that! No thanks! diff --git a/external-libs/VERSION b/external-libs/VERSION index 7aba6e5..8823154 100644 --- a/external-libs/VERSION +++ b/external-libs/VERSION @@ -1 +1 @@ -MONERUJO_monero feature_updatedocker with monero release-v0.17.2.0-monerujo +MONERUJO_monero master with monero release-v0.17.2.0-monerujo