summaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/transactions/TransactionRefreshFragment.kt
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2024-02-12 18:47:53 -0600
committerIván Ávalos <avalos@disroot.org>2024-03-26 08:07:55 -0600
commit021e4443bae33abbdc9de21f2708e633e99ca055 (patch)
tree03a33886e08d8211b061c76b85fbcd954d967d08 /wallet/src/main/java/net/taler/wallet/transactions/TransactionRefreshFragment.kt
parent4789103406f44ba797c7bfee3112cc6aaa228683 (diff)
downloadtaler-android-021e4443bae33abbdc9de21f2708e633e99ca055.tar.gz
taler-android-021e4443bae33abbdc9de21f2708e633e99ca055.tar.bz2
taler-android-021e4443bae33abbdc9de21f2708e633e99ca055.zip
[wallet] DD51: enrich some tx amounts with currencySpecification
bug 0008329
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/transactions/TransactionRefreshFragment.kt')
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionRefreshFragment.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionRefreshFragment.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionRefreshFragment.kt
index da4b14d..8f474f9 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionRefreshFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionRefreshFragment.kt
@@ -38,6 +38,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import net.taler.common.Amount
+import net.taler.common.CurrencySpecification
import net.taler.common.Timestamp
import net.taler.common.toAbsoluteTime
import net.taler.wallet.R
@@ -59,7 +60,9 @@ class TransactionRefreshFragment : TransactionDetailFragment() {
setContent {
TalerSurface {
val t = transactionManager.selectedTransaction.observeAsState().value
- if (t is TransactionRefresh) TransactionRefreshComposable(t, devMode) {
+ if (t is TransactionRefresh) TransactionRefreshComposable(t, devMode,
+ balanceManager.getSpecForCurrency(t.amountRaw.currency),
+ ) {
onTransitionButtonClicked(t, it)
}
}
@@ -71,6 +74,7 @@ class TransactionRefreshFragment : TransactionDetailFragment() {
private fun TransactionRefreshComposable(
t: TransactionRefresh,
devMode: Boolean,
+ spec: CurrencySpecification?,
onTransition: (t: TransactionAction) -> Unit,
) {
val scrollState = rememberScrollState()
@@ -88,7 +92,7 @@ private fun TransactionRefreshComposable(
)
TransactionAmountComposable(
label = stringResource(id = R.string.withdraw_fees),
- amount = t.amountEffective,
+ amount = t.amountEffective.withSpec(spec),
amountType = AmountType.Negative,
)
TransitionsComposable(t, devMode, onTransition)
@@ -111,6 +115,6 @@ private fun TransactionRefreshComposablePreview() {
error = TalerErrorInfo(code = TalerErrorCode.WALLET_WITHDRAWAL_KYC_REQUIRED),
)
Surface {
- TransactionRefreshComposable(t, true) {}
+ TransactionRefreshComposable(t, true, null) {}
}
}