gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-android] 02/05: [wallet] Add Confirm with Bank button to tr


From: gnunet
Subject: [taler-taler-android] 02/05: [wallet] Add Confirm with Bank button to transactions list
Date: Tue, 14 Feb 2023 20:30:24 +0100

This is an automated email from the git hooks/post-receive script.

torsten-grote pushed a commit to branch master
in repository taler-android.

commit c0d94e7a240e97198eacdd33719c5983591bf219
Author: Iván Ávalos <avalos@disroot.org>
AuthorDate: Sat Feb 11 12:07:13 2023 -0600

    [wallet] Add Confirm with Bank button to transactions list
    
    #0007676
---
 .../taler/wallet/transactions/TransactionAdapter.kt  | 20 +++++++++++++++-----
 .../wallet/transactions/TransactionsFragment.kt      | 15 +++++++++++----
 wallet/src/main/res/layout/list_item_transaction.xml |  6 ++++--
 3 files changed, 30 insertions(+), 11 deletions(-)

diff --git 
a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt 
b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
index fa30f5c..e65a751 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
@@ -127,11 +127,21 @@ internal class TransactionAdapter(
             }
         }
 
-        private fun bindActionButton(transaction: Transaction) {
-            actionButton.visibility = transaction.handleKyc({ GONE }) {
-                actionButton.setOnClickListener { 
listener.onActionButtonClicked(transaction) }
-                actionButton.setText(R.string.transaction_action_kyc)
-                VISIBLE
+        private fun bindActionButton(t: Transaction) {
+            actionButton.setOnClickListener { 
listener.onActionButtonClicked(t) }
+            if (t.error != null) {
+                actionButton.visibility = t.handleKyc({ GONE }) {
+                    actionButton.setText(R.string.transaction_action_kyc)
+                    VISIBLE
+                }
+            } else if (t is TransactionWithdrawal && !t.confirmed) {
+                actionButton.setIconResource(R.drawable.ic_account_balance)
+                actionButton.visibility =
+                    if (t.withdrawalDetails is 
WithdrawalDetails.TalerBankIntegrationApi &&
+                        t.withdrawalDetails.bankConfirmationUrl != null) {
+                        
actionButton.setText(R.string.withdraw_button_confirm_bank)
+                        VISIBLE
+                    } else GONE
             }
         }
 
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 08281c4..d67d9b3 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionsFragment.kt
@@ -180,10 +180,17 @@ class TransactionsFragment : Fragment(), 
OnTransactionClickListener, ActionMode.
         }
     }
 
-    override fun onActionButtonClicked(transaction: Transaction) {
-        transaction.handleKyc({ error("Unhandled Action Button Event") }) { 
error ->
-            error.kycUrl?.let {
-                launchInAppBrowser(requireContext(), it)
+    override fun onActionButtonClicked(t: Transaction) {
+        if (t.error != null) {
+            t.handleKyc({ error("Unhandled Action Button Event") }) { error ->
+                error.kycUrl?.let {
+                    launchInAppBrowser(requireContext(), it)
+                }
+            }
+        } else if (t is TransactionWithdrawal && !t.confirmed) {
+            if (t.withdrawalDetails is 
WithdrawalDetails.TalerBankIntegrationApi &&
+                t.withdrawalDetails.bankConfirmationUrl != null) {
+                launchInAppBrowser(requireContext(), 
t.withdrawalDetails.bankConfirmationUrl)
             }
         }
     }
diff --git a/wallet/src/main/res/layout/list_item_transaction.xml 
b/wallet/src/main/res/layout/list_item_transaction.xml
index 5dfdf14..8cd10a8 100644
--- a/wallet/src/main/res/layout/list_item_transaction.xml
+++ b/wallet/src/main/res/layout/list_item_transaction.xml
@@ -66,9 +66,11 @@
         android:id="@+id/actionButton"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_marginTop="8dp"
         android:visibility="gone"
-        android:textColor="?colorOnTertiary"
-        app:backgroundTint="?colorTertiary"
+        android:textColor="?colorOnPrimary"
+        app:iconTint="?colorOnPrimary"
+        app:backgroundTint="?colorPrimary"
         app:layout_constraintStart_toStartOf="@id/title"
         app:layout_constraintTop_toBottomOf="@id/extraInfoView"
         tools:text="Complete KYC"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]