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 | |
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')
4 files changed, 6 insertions, 11 deletions
diff --git a/wallet/build.gradle b/wallet/build.gradle index 8e807d1..b977f91 100644 --- a/wallet/build.gradle +++ b/wallet/build.gradle @@ -23,7 +23,7 @@ plugins { id "de.undercouch.download" } -def walletCoreVersion = "v0.7.1-dev.5" +def walletCoreVersion = "v0.7.1-dev.6" android { compileSdkVersion 29 @@ -35,7 +35,7 @@ android { minSdkVersion 24 targetSdkVersion 29 versionCode 6 - versionName "0.7.1.dev.5" + versionName "0.7.1.dev.6" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" buildConfigField "String", "WALLET_CORE_VERSION", "\"$walletCoreVersion\"" } 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> |