diff options
author | Iván Ávalos <avalos@disroot.org> | 2023-07-04 11:03:41 -0600 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2023-07-11 10:31:27 -0300 |
commit | 13c4700300ff83a88d0f2eabbdb306e94c78c4cc (patch) | |
tree | d23f3c4975c2c6c8ce12dad5ee00d83cd152ff52 /wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt | |
parent | d8c2ec321c1f7e2f10e0599244b8af7d20d6d8fb (diff) | |
download | taler-android-13c4700300ff83a88d0f2eabbdb306e94c78c4cc.tar.gz taler-android-13c4700300ff83a88d0f2eabbdb306e94c78c4cc.tar.bz2 taler-android-13c4700300ff83a88d0f2eabbdb306e94c78c4cc.zip |
[wallet] Fully remove deprecated status fields
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt | 32 |
1 files changed, 27 insertions, 5 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 dd46a92..958ba0c 100644 --- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt +++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt @@ -36,7 +36,17 @@ import net.taler.common.exhaustive import net.taler.common.toRelativeTime import net.taler.wallet.R import net.taler.wallet.transactions.TransactionAdapter.TransactionViewHolder +import net.taler.wallet.transactions.TransactionMajorState.Aborted +import net.taler.wallet.transactions.TransactionMajorState.Aborting +import net.taler.wallet.transactions.TransactionMajorState.Deleted +import net.taler.wallet.transactions.TransactionMajorState.Dialog +import net.taler.wallet.transactions.TransactionMajorState.Done +import net.taler.wallet.transactions.TransactionMajorState.Failed +import net.taler.wallet.transactions.TransactionMajorState.None import net.taler.wallet.transactions.TransactionMajorState.Pending +import net.taler.wallet.transactions.TransactionMajorState.Suspended +import net.taler.wallet.transactions.TransactionMajorState.SuspendedAborting +import net.taler.wallet.transactions.TransactionMajorState.Unknown internal class TransactionAdapter( private val listener: OnTransactionClickListener @@ -115,12 +125,24 @@ internal class TransactionAdapter( extraInfoView.setText(R.string.withdraw_waiting_confirm) extraInfoView.setTextColor(amountColor) extraInfoView.visibility = VISIBLE - } else if (transaction is TransactionPayment && transaction.status != PaymentStatus.Paid && transaction.status != PaymentStatus.Accepted) { - extraInfoView.setText(if (transaction.status == PaymentStatus.Aborted) R.string.payment_aborted else R.string.payment_failed) - extraInfoView.setTextColor(amountColor) - extraInfoView.visibility = VISIBLE } else { - extraInfoView.visibility = GONE + when (transaction.txState.major) { + Aborted -> R.string.payment_aborted + Failed -> R.string.payment_failed + None -> null + Pending -> null + Done -> null + Aborting -> null + Suspended -> null + Dialog -> null + SuspendedAborting -> null + Deleted -> null + Unknown -> null + }?.let { + extraInfoView.setText(it) + } ?: { + extraInfoView.visibility = GONE + } } } |