From 17fe2f70c3d0f34b11db9e4e66ef489bbeae7065 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 19 May 2020 15:11:27 -0300 Subject: [wallet] Implement detail page for refresh transaction --- .../taler/wallet/transactions/TransactionDetailFragment.kt | 14 +++++++++++++- .../java/net/taler/wallet/transactions/Transactions.kt | 2 +- 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) -- cgit v1.2.3