aboutsummaryrefslogtreecommitdiff
path: root/wallet
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-05-19 15:11:27 -0300
committerTorsten Grote <t@grobox.de>2020-05-19 15:11:27 -0300
commit17fe2f70c3d0f34b11db9e4e66ef489bbeae7065 (patch)
treeb4ad9c7d94c0ef4d8bd81ec7e888821c6a70df9d /wallet
parente3edd5f58fe1d2f3f70d1ff20f58564f8990bcc2 (diff)
downloadtaler-android-17fe2f70c3d0f34b11db9e4e66ef489bbeae7065.tar.gz
taler-android-17fe2f70c3d0f34b11db9e4e66ef489bbeae7065.tar.bz2
taler-android-17fe2f70c3d0f34b11db9e4e66ef489bbeae7065.zip
[wallet] Implement detail page for refresh transaction
Diffstat (limited to 'wallet')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt14
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt2
2 files changed, 14 insertions, 2 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt
index 6b58824..f78d98f 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt
@@ -73,9 +73,10 @@ class TransactionDetailFragment : Fragment() {
is TransactionWithdrawal -> bind(e)
is TransactionPayment -> bind(e)
is TransactionRefund -> bind(e)
+ is TransactionRefresh -> bind(e)
else -> Toast.makeText(
requireContext(),
- "event ${e.javaClass} not implement",
+ "Transaction ${e.javaClass.simpleName} not implemented.",
LENGTH_LONG
).show()
}
@@ -125,6 +126,17 @@ class TransactionDetailFragment : Fragment() {
bindOrderAndFee(t.info, t.amountRaw, fee)
}
+ private fun bind(t: TransactionRefresh) {
+ effectiveAmountLabel.visibility = GONE
+ effectiveAmountView.visibility = GONE
+ confirmWithdrawalButton.visibility = GONE
+ chosenAmountLabel.visibility = GONE
+ chosenAmountView.visibility = GONE
+ val fee = t.amountEffective
+ feeView.text = getString(R.string.amount_negative, fee.toString())
+ exchangeView.text = cleanExchange(t.exchangeBaseUrl)
+ }
+
private fun bindOrderAndFee(info: TransactionInfo, raw: Amount, fee: Amount) {
orderAmountView.text = raw.toString()
feeView.text = getString(R.string.amount_negative, fee.toString())
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 8567259..27384d8 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
@@ -190,7 +190,7 @@ class TransactionRefresh(
amountEffective: Amount
) : Transaction(transactionId, timestamp, pending, error, amountRaw, amountEffective) {
override val icon = R.drawable.transaction_refresh
- override val detailPageLayout = R.layout.fragment_transaction_payment
+ override val detailPageLayout = R.layout.fragment_transaction_withdrawal
override val amountType = AmountType.Negative
override fun getTitle(context: Context): String {
return context.getString(R.string.transaction_refresh)