aboutsummaryrefslogtreecommitdiff
path: root/wallet
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-08-06 09:41:16 -0300
committerTorsten Grote <t@grobox.de>2020-08-06 09:41:16 -0300
commita20adabb2cfbaa2a78acac6560d81c27ca721731 (patch)
tree736f2a038323c905a9726500ee6314df87e12d68 /wallet
parent78096abeb8ca000e3480e98d300bec86350f9d13 (diff)
downloadtaler-android-a20adabb2cfbaa2a78acac6560d81c27ca721731.tar.gz
taler-android-a20adabb2cfbaa2a78acac6560d81c27ca721731.tar.bz2
taler-android-a20adabb2cfbaa2a78acac6560d81c27ca721731.zip
[wallet] show error icon for transactions with error
Diffstat (limited to 'wallet')
-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
-rw-r--r--wallet/src/main/res/drawable/ic_error.xml1
-rw-r--r--wallet/src/main/res/drawable/transaction_refresh.xml1
-rw-r--r--wallet/src/main/res/drawable/transaction_refund.xml1
-rw-r--r--wallet/src/main/res/drawable/transaction_tip_accepted.xml1
-rw-r--r--wallet/src/main/res/drawable/transaction_withdrawal.xml1
-rw-r--r--wallet/src/main/res/layout/list_item_transaction.xml1
8 files changed, 15 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 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")
diff --git a/wallet/src/main/res/drawable/ic_error.xml b/wallet/src/main/res/drawable/ic_error.xml
index abbe33e..4f747f1 100644
--- a/wallet/src/main/res/drawable/ic_error.xml
+++ b/wallet/src/main/res/drawable/ic_error.xml
@@ -17,6 +17,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
+ android:tint="@color/red"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
diff --git a/wallet/src/main/res/drawable/transaction_refresh.xml b/wallet/src/main/res/drawable/transaction_refresh.xml
index 219b891..63889d9 100644
--- a/wallet/src/main/res/drawable/transaction_refresh.xml
+++ b/wallet/src/main/res/drawable/transaction_refresh.xml
@@ -17,6 +17,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
+ android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
diff --git a/wallet/src/main/res/drawable/transaction_refund.xml b/wallet/src/main/res/drawable/transaction_refund.xml
index 6c3d0a7..864add9 100644
--- a/wallet/src/main/res/drawable/transaction_refund.xml
+++ b/wallet/src/main/res/drawable/transaction_refund.xml
@@ -17,6 +17,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
+ android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
diff --git a/wallet/src/main/res/drawable/transaction_tip_accepted.xml b/wallet/src/main/res/drawable/transaction_tip_accepted.xml
index b945b53..27b1ae4 100644
--- a/wallet/src/main/res/drawable/transaction_tip_accepted.xml
+++ b/wallet/src/main/res/drawable/transaction_tip_accepted.xml
@@ -17,6 +17,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
+ android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
diff --git a/wallet/src/main/res/drawable/transaction_withdrawal.xml b/wallet/src/main/res/drawable/transaction_withdrawal.xml
index 4fd64f5..edbd4ea 100644
--- a/wallet/src/main/res/drawable/transaction_withdrawal.xml
+++ b/wallet/src/main/res/drawable/transaction_withdrawal.xml
@@ -17,6 +17,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
+ android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
diff --git a/wallet/src/main/res/layout/list_item_transaction.xml b/wallet/src/main/res/layout/list_item_transaction.xml
index 34712a2..239e656 100644
--- a/wallet/src/main/res/layout/list_item_transaction.xml
+++ b/wallet/src/main/res/layout/list_item_transaction.xml
@@ -33,7 +33,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
- app:tint="?android:colorControlNormal"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_cash_usd_outline" />