diff options
author | Torsten Grote <t@grobox.de> | 2020-05-18 09:46:29 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-05-18 09:46:29 -0300 |
commit | a94022d0f21ca4575b8b8ee5b58e71a679faa542 (patch) | |
tree | 48a868566f1e02e4a0927b94c552c1848dea2e53 /wallet/src/main | |
parent | 40ccf513c42736ff463a4815a24466d3b28e33a9 (diff) | |
download | taler-android-a94022d0f21ca4575b8b8ee5b58e71a679faa542.tar.gz taler-android-a94022d0f21ca4575b8b8ee5b58e71a679faa542.tar.bz2 taler-android-a94022d0f21ca4575b8b8ee5b58e71a679faa542.zip |
[wallet] upgrade to latest core and fix sorting bug
Diffstat (limited to 'wallet/src/main')
3 files changed, 4 insertions, 9 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 } diff --git a/wallet/src/main/res/values/strings.xml b/wallet/src/main/res/values/strings.xml index cddc1d5..e815e9b 100644 --- a/wallet/src/main/res/values/strings.xml +++ b/wallet/src/main/res/values/strings.xml @@ -75,7 +75,6 @@ GNU Taler is immune against many types of fraud, such as phishing of credit card <string name="transaction_tip_from">Tip from %s</string> <string name="transaction_refund">Refund</string> <string name="transaction_refund_from">Refund from %s</string> - <string name="transaction_refund_for">Refund for %s</string> <string name="transaction_pending">PENDING</string> <string name="transaction_refresh">Coin expiry change fee</string> |