aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt21
-rw-r--r--wallet/src/main/res/values/strings.xml1
2 files changed, 21 insertions, 1 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
index 0e7ef07..1926217 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
@@ -25,6 +25,8 @@ import android.view.MenuItem
import android.view.View
import android.view.View.INVISIBLE
import android.view.ViewGroup
+import androidx.annotation.StringRes
+import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.SearchView
import androidx.appcompat.widget.SearchView.OnQueryTextListener
import androidx.fragment.app.Fragment
@@ -216,11 +218,28 @@ class TransactionsFragment : Fragment(), OnTransactionClickListener, ActionMode.
return false // no update needed
}
+ @StringRes
+ val deleteDialogTitle = R.string.transactions_delete
+ @StringRes
+ val deleteDialogMessage = R.string.transactions_delete_selected_dialog_message
+ @StringRes
+ val deleteDialogButton = R.string.transactions_delete
+
override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean {
when (item.itemId) {
R.id.transaction_delete -> {
tracker?.selection?.toList()?.let { transactionIds ->
- transactionManager.deleteTransactions(transactionIds)
+ AlertDialog.Builder(requireContext(), R.style.DialogTheme)
+ .setTitle(deleteDialogTitle)
+ .setMessage(deleteDialogMessage)
+ .setPositiveButton(R.string.cancel) { dialog, _ ->
+ dialog.cancel()
+ }
+ .setNegativeButton(deleteDialogButton) { dialog, _ ->
+ transactionManager.deleteTransactions(transactionIds)
+ dialog.dismiss()
+ }
+ .show()
}
mode.finish()
}
diff --git a/wallet/src/main/res/values/strings.xml b/wallet/src/main/res/values/strings.xml
index ea5cbdf..51c2ff3 100644
--- a/wallet/src/main/res/values/strings.xml
+++ b/wallet/src/main/res/values/strings.xml
@@ -87,6 +87,7 @@ GNU Taler is immune against many types of fraud, such as phishing of credit card
<string name="transactions_select_all">Select All</string>
<string name="transactions_delete_dialog_title">Delete Transaction</string>
<string name="transactions_delete_dialog_message">Are you sure you want to remove this transaction from your wallet?</string>
+ <string name="transactions_delete_selected_dialog_message">Are you sure you want to remove the selected transactions from your wallet?</string>
<string name="transactions_cancel_dialog_message">Are you sure you want to cancel this withdrawal? Funds still in transit might get lost.</string>
<!-- Transactions -->