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/TransactionManager.kt4
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt8
2 files changed, 4 insertions, 8 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
index 5b8e577..d5cee16 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionManager.kt
@@ -16,7 +16,6 @@
package net.taler.wallet.transactions
-import android.util.Log
import androidx.annotation.UiThread
import androidx.annotation.WorkerThread
import androidx.lifecycle.LiveData
@@ -81,9 +80,10 @@ class TransactionManager(
liveData.postValue(TransactionsResult.Error)
return
}
- Log.e("TEST", result.toString(2)) // TODO remove once API finalized
val transactionsArray = result.getString("transactions")
val transactions: LinkedList<Transaction> = mapper.readValue(transactionsArray)
+ // TODO remove when fixed in wallet-core
+ transactions.sortWith(compareBy({ it.pending }, { it.timestamp.ms }, { it.transactionId }))
transactions.reverse() // show latest first
mProgress.postValue(false)
liveData.postValue(TransactionsResult.Success(transactions))
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 6dc9af1..55579cc 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
@@ -100,7 +100,7 @@ class TransactionPayment(
override val icon = R.drawable.ic_cash_usd_outline
override val detailPageLayout = R.layout.fragment_transaction_payment
override val amountType = AmountType.Negative
- override fun getTitle(context: Context) = info.merchant.name ?: info.summary
+ override fun getTitle(context: Context) = info.merchant.name
override val generalTitleRes = R.string.payment_title
}
@@ -143,11 +143,7 @@ class TransactionRefund(
override val detailPageLayout = R.layout.fragment_transaction_payment
override val amountType = AmountType.Positive
override fun getTitle(context: Context): String {
- return if (info.merchant.name == null) {
- context.getString(R.string.transaction_refund_for, info.summary)
- } else {
- context.getString(R.string.transaction_refund_from, info.merchant.name)
- }
+ return context.getString(R.string.transaction_refund_from, info.merchant.name)
}
override val generalTitleRes = R.string.refund_title
}