taler-ios

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

commit 61a6d166d95a747e7fdc6432bba0b0282940d5cc
parent cacf407b67c6adb903c2e9e57d3037232da51a13
Author: Marc Stibane <marc@taler.net>
Date:   Sun, 30 Mar 2025 22:40:08 +0200

OIM overlay

Diffstat:
MTalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift | 9+++++++++
MTalerWallet1/Views/Actions/Peer2peer/SendAmountV.swift | 10+++++++++-
MTalerWallet1/Views/Balances/BalancesListView.swift | 10++++++++++
MTalerWallet1/Views/Main/MainView.swift | 5++++-
MTalerWallet1/Views/Sheets/Payment/PaymentView.swift | 5+++++
5 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift b/TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift @@ -29,6 +29,7 @@ struct P2PSubjectV: View { @Binding var summary: String @Binding var expireDays: UInt + @EnvironmentObject private var controller: Controller @EnvironmentObject private var model: WalletModel @Environment(\.colorScheme) private var colorScheme @Environment(\.colorSchemeContrast) private var colorSchemeContrast @@ -174,6 +175,14 @@ struct P2PSubjectV: View { } scrollView + .overlay { + if controller.oimModeActive { + OIMSubjectView(stack: stack.push(), + scope: scope, + amount: $amountToTransfer, + buttonSelected: $sendOrRequest) + } + } } } // MARK: - diff --git a/TalerWallet1/Views/Actions/Peer2peer/SendAmountV.swift b/TalerWallet1/Views/Actions/Peer2peer/SendAmountV.swift @@ -103,7 +103,15 @@ struct SendAmountV: View { .background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all)) .task { await viewDidLoad() } .task(id: balanceIndex + (1000 * controller.currencyTicker)) { await newBalance() } - + .overlay { + if controller.oimModeActive { + OIMEditView(stack: stack.push(), + scope: balance?.scopeInfo, + amount: $amountToTransfer, + available: $amountAvailable, + buttonSelected: $buttonSelected) + } + } if #available(iOS 16.0, *) { if #available(iOS 16.4, *) { scrollView.toolbar(.hidden, for: .tabBar) diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift b/TalerWallet1/Views/Balances/BalancesListView.swift @@ -16,6 +16,7 @@ struct BalancesListView: View { let stack: CallStack @Binding var selectedBalance: Balance? @Binding var reloadTransactions: Int + @Binding var qrButtonTapped: Bool @EnvironmentObject private var model: WalletModel @EnvironmentObject private var controller: Controller @@ -64,6 +65,15 @@ struct BalancesListView: View { await refresh() } } + .overlay { + if controller.oimModeActive { + let balance = controller.balances.first + OIMView(stack: stack.push(), + scope: balance?.scopeInfo, + amount: balance?.available, + qrButtonTapped: $qrButtonTapped) + } + } } } } diff --git a/TalerWallet1/Views/Main/MainView.swift b/TalerWallet1/Views/Main/MainView.swift @@ -65,6 +65,7 @@ struct MainView: View { talerFontIndex: $talerFontIndex, showActionSheet: $showActionSheet, showScanner: $showScanner, + qrButtonTapped: $qrButtonTapped, userAction: $userAction) .onAppear() { #if DEBUG @@ -233,6 +234,7 @@ extension MainView { @Binding var talerFontIndex: Int @Binding var showActionSheet: Bool @Binding var showScanner: Bool + @Binding var qrButtonTapped: Bool @Binding var userAction: Int #if DEBUG @@ -356,7 +358,8 @@ extension MainView { BalancesListView(stack: stack.push(balancesTitle), selectedBalance: $selectedBalance, // shouldReloadPending: $shouldReloadPending, - reloadTransactions: $shouldReloadTransactions) + reloadTransactions: $shouldReloadTransactions, + qrButtonTapped: $qrButtonTapped) .navigationTitle(balancesTitle) .background(balanceActions) }.navigationViewStyle(.stack) diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentView.swift b/TalerWallet1/Views/Sheets/Payment/PaymentView.swift @@ -297,6 +297,11 @@ struct PaymentView: View, Sendable { } symLog.log("Info(for: \(currency)) loaded: \(currencyInfo.name)") } + .overlay { + if controller.oimSheetActive { + OIMPayView(scope: firstScope, amount: effective) + } + } } else { LoadingView(stack: stack.push(), scopeInfo: nil, message: url.host) .task { await viewDidLoad() }