taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

commit 17fe2f70c3d0f34b11db9e4e66ef489bbeae7065
parent e3edd5f58fe1d2f3f70d1ff20f58564f8990bcc2
Author: Torsten Grote <t@grobox.de>
Date:   Tue, 19 May 2020 15:11:27 -0300

[wallet] Implement detail page for refresh transaction

Diffstat:
Mwallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt | 14+++++++++++++-
Mwallet/src/main/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 @@ -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 @@ -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)