[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-android] 01/04: [wallet] show error icon for transactions w
From: |
gnunet |
Subject: |
[taler-taler-android] 01/04: [wallet] show error icon for transactions with error |
Date: |
Tue, 11 Aug 2020 22:35:45 +0200 |
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 a20adabb2cfbaa2a78acac6560d81c27ca721731
Author: Torsten Grote <t@grobox.de>
AuthorDate: Thu Aug 6 09:41:16 2020 -0300
[wallet] show error icon for transactions with error
---
.../main/java/net/taler/wallet/transactions/TransactionAdapter.kt | 7 +++++--
wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt | 7 +++++--
wallet/src/main/res/drawable/ic_error.xml | 1 +
wallet/src/main/res/drawable/transaction_refresh.xml | 1 +
wallet/src/main/res/drawable/transaction_refund.xml | 1 +
wallet/src/main/res/drawable/transaction_tip_accepted.xml | 1 +
wallet/src/main/res/drawable/transaction_withdrawal.xml | 1 +
wallet/src/main/res/layout/list_item_transaction.xml | 1 -
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" />
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.