summaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt
diff options
context:
space:
mode:
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt')
-rw-r--r--wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt32
1 files changed, 18 insertions, 14 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt b/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt
index 1ce0175..609629e 100644
--- a/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt
+++ b/wallet/src/main/java/net/taler/wallet/peer/IncomingComposable.kt
@@ -134,7 +134,7 @@ fun ColumnScope.PeerPullTermsComposable(
modifier = Modifier.align(End),
) {
Text(
- text = stringResource(id = R.string.payment_label_amount_total),
+ text = stringResource(id = R.string.amount_total_label),
style = MaterialTheme.typography.bodyLarge,
)
Text(
@@ -145,22 +145,26 @@ fun ColumnScope.PeerPullTermsComposable(
)
}
// this gets used for credit and debit, so fee calculation differs
- val fee = if (data.isCredit) {
+ val fee = if (data.isCredit && terms.amountRaw > terms.amountEffective) {
terms.amountRaw - terms.amountEffective
- } else {
+ } else if (terms.amountEffective > terms.amountRaw) {
terms.amountEffective - terms.amountRaw
+ } else null
+
+ if (fee != null) {
+ val feeStr = if (data.isCredit) {
+ stringResource(R.string.amount_negative, fee)
+ } else {
+ stringResource(R.string.amount_positive, fee)
+ }
+ Text(
+ modifier = Modifier.align(End),
+ text = feeStr,
+ style = MaterialTheme.typography.bodyLarge,
+ color = MaterialTheme.colorScheme.error,
+ )
}
- val feeStr = if (data.isCredit) {
- stringResource(R.string.amount_negative, fee)
- } else {
- stringResource(R.string.amount_positive, fee)
- }
- if (!fee.isZero()) Text(
- modifier = Modifier.align(End),
- text = feeStr,
- style = MaterialTheme.typography.bodyLarge,
- color = MaterialTheme.colorScheme.error,
- )
+
if (terms is IncomingAccepting) {
CircularProgressIndicator(
modifier = Modifier