taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit bbdfcfa15767278593b58a19cc1dff383dd791f1
parent 2969cc907f8560a3250e8cf849974b15f3dfdf9a
Author: Marc Stibane <marc@taler.net>
Date:   Fri,  2 May 2025 04:13:42 +0000

two amounts in title

Diffstat:
MTalerWallet1/Views/OIM/OIMEditView.swift | 18+++++++++++++++++-
MTalerWallet1/Views/OIM/OIMSubjectView.swift | 2+-
MTalerWallet1/Views/OIM/OIMView.swift | 11+++++++++--
3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/TalerWallet1/Views/OIM/OIMEditView.swift b/TalerWallet1/Views/OIM/OIMEditView.swift @@ -24,8 +24,24 @@ struct OIMEditView: View { @State private var amountVal: UInt64 = 0 @State private var sending = false // user tapped on Send @State private var availableVal: UInt64 = 0 + @State private var availRest: Amount @State private var tappedVal: UInt64 = 0 + init(stack: CallStack, cash: OIMcash, + amount: Binding<Amount>, + available: Amount, + useAvailable : Bool, + fwdButtonTapped: Binding<Bool> + ) { + self.stack = stack + self.cash = cash + self._amount = amount + self.available = available + self.useAvailable = useAvailable + self._fwdButtonTapped = fwdButtonTapped + self._availRest = State(wrappedValue: { available }()) + } + // available minus amountVal - what's still available from the balance when amount is on the table var isAvailable: UInt64 { @@ -74,7 +90,7 @@ struct OIMEditView: View { ) { ZStack(alignment: .top) { VStack { - OIMtitleView(cash: cash, amount: amount) + OIMtitleView(cash: cash, amount: availRest, isSending: true, secondAmount: amount) Spacer() OIMlineView(stack: stack.push(), cash: cash, diff --git a/TalerWallet1/Views/OIM/OIMSubjectView.swift b/TalerWallet1/Views/OIM/OIMSubjectView.swift @@ -53,7 +53,7 @@ struct OIMSubjectView: View { action: sendAction ) { VStack { - OIMtitleView(cash: cash, amount: amount) + OIMtitleView(cash: cash, amount: amount, isSending: true, secondAmount: amount) Spacer() HStack { ForEach(goals, id: \.self) { goal in diff --git a/TalerWallet1/Views/OIM/OIMView.swift b/TalerWallet1/Views/OIM/OIMView.swift @@ -56,6 +56,8 @@ struct OIMnavBack<Content: View>: View { struct OIMtitleView: View { let cash: OIMcash let amount: Amount? + let isSending: Bool + let secondAmount: Amount? @EnvironmentObject private var wrapper: NamespaceWrapper @@ -70,6 +72,11 @@ struct OIMtitleView: View { OIMamountV(amount: amount, currencyName: cash.currency.noteBase) + if isSending { + Spacer() + OIMamountV(amount: secondAmount, currencyName: cash.currency.noteBase) + } + OIMsendButton(isGoal: false, isFinal: false, enabled: false) {} .frame(width: 66, height: 66) .disabled(true) @@ -150,7 +157,7 @@ struct OIMView: View { OIMbackground() { ZStack(alignment: .top) { actions - OIMtitleView(cash: cash, amount: available) + OIMtitleView(cash: cash, amount: available, isSending: sending, secondAmount: nil) VStack { // this shows the two savings boxes (Germany and Sierra Leone) @@ -178,7 +185,7 @@ struct OIMView: View { .frame(width: size, height: size) .zIndex(itsMe ? 3 : 0) .opacity((isClosed || itsMe) ? 1.0 : 0.01) - .matchedGeometryEffect(id: itsMe ? (sending ? "OIMback" : "OIMnumber") + .matchedGeometryEffect(id: itsMe ? "OIMnumber" // (sending ? "OIMback" : "OIMnumber") : String(index), in: wrapper.namespace, isSource: false) .frame(width: size, height: size)