aboutsummaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler
diff options
context:
space:
mode:
Diffstat (limited to 'wallet/src/main/java/net/taler')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt7
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt7
2 files changed, 10 insertions, 4 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 d670b74..f494b05 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionAdapter.kt
@@ -89,8 +89,11 @@ internal class TransactionAdapter(
v.foreground = selectableForeground
v.setOnClickListener { listener.onTransactionClicked(transaction) }
v.isActivated = selected
-
- icon.setImageResource(transaction.icon)
+ if (transaction.error == null) {
+ icon.setImageResource(transaction.icon)
+ } else {
+ icon.setImageResource(R.drawable.ic_error)
+ }
title.text = transaction.getTitle(context)
bindExtraInfo(transaction)
time.text = transaction.timestamp.ms.toRelativeTime(context)
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt b/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
index 1dc55dc..5363834 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
@@ -72,8 +72,11 @@ sealed class AmountType {
object Neutral : AmountType()
}
-class TransactionError(private val ec: Int, private val hint: String?) {
- val text get() = if (hint == null) "$ec" else "$ec - $hint"
+data class TransactionError(
+ private val ec: Int,
+ private val hint: String?
+) {
+ val text get() = if (hint == null) "$ec" else "$ec $hint"
}
@JsonTypeName("withdrawal")