taler-ios

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

commit f2bc812814ba3738aae30bff208f7a2300d03267
parent fbe5f9a9d08fd53682f0f77e20e19935804be634
Author: Marc Stibane <marc@taler.net>
Date:   Mon, 10 Jul 2023 13:02:12 +0200

navigationBarTitleDisplayMode

Diffstat:
MTalerWallet1/Model/Model+Payment.swift | 16++++++++++++++--
MTalerWallet1/Views/Balances/BalancesListView.swift | 1-
MTalerWallet1/Views/Exchange/ExchangeListView.swift | 1-
MTalerWallet1/Views/HelperViews/LoadingView.swift | 3++-
MTalerWallet1/Views/Main/MainView.swift | 1+
MTalerWallet1/Views/Settings/Pending/PendingOpsListView.swift | 1-
MTalerWallet1/Views/Sheets/Sheet.swift | 3++-
MTalerWallet1/Views/Transactions/TransactionsListView.swift | 5-----
MTalerWallet1/Views/WithdrawBankIntegrated/WithdrawTOSView.swift | 1-
9 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/TalerWallet1/Model/Model+Payment.swift b/TalerWallet1/Model/Model+Payment.swift @@ -114,6 +114,16 @@ enum PreparePayResultType: String, Codable { case insufficientBalance = "insufficient-balance" } +struct PayMerchantInsufficientBalanceDetails: Codable { + let amountRequested: Amount + let balanceAvailable: Amount + let balanceMaterial: Amount + let balanceAgeAcceptable: Amount + let balanceMerchantAcceptable: Amount + let balanceMerchantDepositable: Amount + let feeGapEstimate: Amount +} + /// The result from PreparePayForUri struct PaymentDetailsForUri: Codable { let status: PreparePayResultType @@ -121,8 +131,10 @@ struct PaymentDetailsForUri: Codable { let contractTerms: MerchantContractTerms let contractTermsHash: String let amountRaw: Amount - let amountEffective: Amount - let talerUri: String + let amountEffective: Amount? // only if status != insufficientBalance + let balanceDetails: PayMerchantInsufficientBalanceDetails? // only if status == insufficientBalance + let paid: Bool? // only if status == alreadyConfirmed +// let talerUri: String? } /// A request to get an exchange's payment contract terms. fileprivate struct PreparePayForUri: WalletBackendFormattedRequest { diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift b/TalerWallet1/Views/Balances/BalancesListView.swift @@ -86,7 +86,6 @@ struct BalancesListView: View { centsToTransfer: $centsToTransfer, summary: $summary, reloadAction: reloadAction) .navigationTitle(navTitle) - .navigationBarTitleDisplayMode(.automatic) .navigationBarItems(leading: HamburgerButton(action: hamburgerAction), trailing: QRButton(action: checkCameraAvailable)) .overlay { diff --git a/TalerWallet1/Views/Exchange/ExchangeListView.swift b/TalerWallet1/Views/Exchange/ExchangeListView.swift @@ -54,7 +54,6 @@ struct ExchangeListView: View { centsToTransfer: $centsToTransfer, reloadAction: reloadAction) .navigationTitle(navTitle) - .navigationBarTitleDisplayMode(.automatic) .navigationBarItems(leading: HamburgerButton(action: hamburgerAction), trailing: PlusButton(action: plusAction) .accessibilityLabel("Add Exchange")) diff --git a/TalerWallet1/Views/HelperViews/LoadingView.swift b/TalerWallet1/Views/HelperViews/LoadingView.swift @@ -23,6 +23,7 @@ struct LoadingView_Previews: PreviewProvider { static var previews: some View { NavigationView { LoadingView(backButtonHidden: true) - } + .navigationBarTitleDisplayMode(.automatic) + }.navigationViewStyle(.stack) } } diff --git a/TalerWallet1/Views/Main/MainView.swift b/TalerWallet1/Views/Main/MainView.swift @@ -113,6 +113,7 @@ extension MainView { .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) .transition(.backslide) } + .navigationBarTitleDisplayMode(.automatic) }.navigationViewStyle(.stack) // The side view is on top of the current view SideBarView(views: views, diff --git a/TalerWallet1/Views/Settings/Pending/PendingOpsListView.swift b/TalerWallet1/Views/Settings/Pending/PendingOpsListView.swift @@ -44,7 +44,6 @@ extension PendingOpsListView { PendingOpView(pendingOp: pendingOp) } .listStyle(myListStyle.style).anyView - .navigationBarTitleDisplayMode(.large) .onAppear() { DebugViewC.shared.setViewID(VIEW_PENDING) } diff --git a/TalerWallet1/Views/Sheets/Sheet.swift b/TalerWallet1/Views/Sheets/Sheet.swift @@ -28,8 +28,9 @@ struct Sheet: View { NavigationView { sheetView .navigationBarItems(leading: cancelButton) + .navigationBarTitleDisplayMode(.automatic) .background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all)) - } + }.navigationViewStyle(.stack) .overlay(alignment: .top) { // Show the viewID on top of the sheet's NavigationView Text(idString) diff --git a/TalerWallet1/Views/Transactions/TransactionsListView.swift b/TalerWallet1/Views/Transactions/TransactionsListView.swift @@ -22,9 +22,6 @@ struct TransactionsListView: View { let _ = symLog.vlog() // just to get the # to compare it with .onAppear & onDisappear #endif let count = transactions.count - // TODO: Unlock the power of grammatical agreement -// let title = AttributedString(localized: "^[\(count) Ticket](inflect: true)") -// let title: String = "\(count) \(navTitle)" Content(symLog: symLog, currency: currency, transactions: transactions, @@ -32,9 +29,7 @@ struct TransactionsListView: View { myListStyle: $myListStyle, reloadAllAction: reloadAllAction, reloadOneAction: reloadOneAction) -// .navigationTitle(title) .navigationTitle(navTitle) - .navigationBarTitleDisplayMode(.large) // .inline .onAppear { DebugViewC.shared.setViewID(VIEW_TRANSACTIONLIST) } diff --git a/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawTOSView.swift b/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawTOSView.swift @@ -39,7 +39,6 @@ struct WithdrawTOSView: View { } } } - .navigationBarTitleDisplayMode(.large) // .inline .navigationTitle(navTitle) .overlay { if exchangeTOS == nil {