[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 03/09: List handling
From: |
gnunet |
Subject: |
[taler-taler-ios] 03/09: List handling |
Date: |
Fri, 07 Jul 2023 11:40:01 +0200 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit 856c05ae94fbe17e9788e2873cb780015c7d6cde
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Jul 6 18:03:53 2023 +0200
List handling
---
TalerWallet1/Views/Balances/BalancesSectionView.swift | 12 ++++++------
TalerWallet1/Views/Exchange/ExchangeSectionView.swift | 6 +++---
TalerWallet1/Views/Main/WalletEmptyView.swift | 3 +--
TalerWallet1/Views/Payment/PaymentURIView.swift | 18 ++++++++++--------
.../Views/Sheets/P2P_Sheets/P2pPayURIView.swift | 2 ++
.../Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift | 2 ++
.../Views/Transactions/TransactionsEmptyView.swift | 4 ++--
.../Views/Transactions/TransactionsListView.swift | 6 +++---
.../Views/WithdrawBankIntegrated/WithdrawURIView.swift | 2 ++
9 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index 5cd273a..de1bfaa 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -193,17 +193,17 @@ fileprivate struct BindingViewContainer : View {
scopeInfo: scopeInfo,
requiresUserInput: false,
hasPendingTransactions: true)
- List {
- BalancesSectionView(balance: balance,
- centsToTransfer: $centsToTransfer,
- summary: $summary)
- }
+ BalancesSectionView(balance: balance,
+ centsToTransfer: $centsToTransfer,
+ summary: $summary)
}
}
struct BalancesSectionView_Previews: PreviewProvider {
static var previews: some View {
- BindingViewContainer()
+ List {
+ BindingViewContainer()
+ }
}
}
#endif
diff --git a/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
b/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
index c29dcdd..ffe53dc 100644
--- a/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
+++ b/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
@@ -87,16 +87,16 @@ struct ExchangeRow_Container : View {
exchangeStatus: "exchangeStatus",
ageRestrictionOptions: [],
permanent: false)
- List {
ExchangeSectionView(currency: LONGCURRENCY, exchanges: [exchange1,
exchange2],
centsToTransfer: $centsToTransfer)
- }
}
}
struct ExchangeRow_Previews: PreviewProvider {
static var previews: some View {
- ExchangeRow_Container()
+ List {
+ ExchangeRow_Container()
+ }
}
}
#endif
diff --git a/TalerWallet1/Views/Main/WalletEmptyView.swift
b/TalerWallet1/Views/Main/WalletEmptyView.swift
index 1ec8cd7..d095ce2 100644
--- a/TalerWallet1/Views/Main/WalletEmptyView.swift
+++ b/TalerWallet1/Views/Main/WalletEmptyView.swift
@@ -27,9 +27,8 @@ struct WalletEmptyView: View {
Text("Just register a test account, then withdraw some coins.")
}
}
-// .padding(.vertical)
- .font(.title2)
.listStyle(myListStyle.style).anyView
+ .font(.title2)
.background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
.onAppear() {
DebugViewC.shared.setViewID(VIEW_EMPTY) // 10
diff --git a/TalerWallet1/Views/Payment/PaymentURIView.swift
b/TalerWallet1/Views/Payment/PaymentURIView.swift
index 7fb9d4a..bb1beb6 100644
--- a/TalerWallet1/Views/Payment/PaymentURIView.swift
+++ b/TalerWallet1/Views/Payment/PaymentURIView.swift
@@ -13,6 +13,7 @@ struct PaymentURIView: View {
let navTitle = String(localized: "Confirm Payment", comment:"pay merchant")
@EnvironmentObject private var controller: Controller
+ @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
// the scanned URL
let url: URL
@@ -42,7 +43,7 @@ struct PaymentURIView: View {
var body: some View {
if let detailsForUri {
ScrollViewReader { scrollView in
- VStack {
+ List {
let baseURL = detailsForUri.contractTerms.exchanges.first?.url
let raw = detailsForUri.amountRaw
let effective = detailsForUri.amountEffective
@@ -52,17 +53,18 @@ struct PaymentURIView: View {
topAmount: raw, fee: fee,
bottomTitle: String(localized: "\(currency) to
be spent:"),
bottomAmount: effective,
- large: true, pending: false, incoming:
false,
+ large: false, pending: false, incoming:
false,
baseURL: baseURL)
// TODO: payment: popup with all possible exchanges, check fees
- .safeAreaInset(edge: .bottom) {
- Button(navTitle, action: { acceptAction(detailsForUri:
detailsForUri) })
- .buttonStyle(TalerButtonStyle(type: .prominent))
- .padding(.horizontal)
- }
+ }
+ .listStyle(myListStyle.style).anyView
+ .safeAreaInset(edge: .bottom) {
+ Button(navTitle, action: { acceptAction(detailsForUri:
detailsForUri) })
+ .buttonStyle(TalerButtonStyle(type: .prominent))
+ .padding(.horizontal)
}
.navigationTitle(navTitle)
- }
+ } // ScrollViewReader
} else {
let badURL = "Error in URL: \(url)"
WithdrawProgressView(message: url.host ?? badURL)
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
index d3cb92e..89a6502 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
@@ -16,6 +16,7 @@ struct P2pPayURIView: View {
let url: URL
@EnvironmentObject private var model: WalletModel
+ @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
@State private var peerPullDebitResponse: PreparePeerPullDebitResponse?
@@ -34,6 +35,7 @@ struct P2pPayURIView: View {
large: false, pending: false, incoming:
false,
baseURL: nil)
}
+ .listStyle(myListStyle.style).anyView
.navigationTitle(navTitle)
NavigationLink(destination: LazyView {
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
index f40a5bf..c4f4301 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
@@ -11,6 +11,7 @@ import SymLog
struct P2pReceiveURIView: View {
private let symLog = SymLogV()
let navTitle = String(localized: "Accept P2P Receive")
+ @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
// the scanned URL
let url: URL
@@ -34,6 +35,7 @@ struct P2pReceiveURIView: View {
large: false, pending: false,
incoming: true,
baseURL: nil)
}
+ .listStyle(myListStyle.style).anyView
.navigationTitle(navTitle)
let tosAccepted = true // TODO:
https://bugs.gnunet.org/view.php?id=7869
if tosAccepted {
diff --git a/TalerWallet1/Views/Transactions/TransactionsEmptyView.swift
b/TalerWallet1/Views/Transactions/TransactionsEmptyView.swift
index eb7479f..fa382ba 100644
--- a/TalerWallet1/Views/Transactions/TransactionsEmptyView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionsEmptyView.swift
@@ -19,10 +19,10 @@ struct TransactionsEmptyView: View {
Section {
Text("There are no transactions for \(currency).")
}
+ .font(.title2)
}
- .padding(.vertical)
- .font(.title2)
.listStyle(myListStyle.style).anyView
+// .padding(.vertical)
.background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
.onAppear() {
DebugViewC.shared.setViewID(VIEW_EMPTY) // 10
diff --git a/TalerWallet1/Views/Transactions/TransactionsListView.swift
b/TalerWallet1/Views/Transactions/TransactionsListView.swift
index ac27eea..d5a4f3c 100644
--- a/TalerWallet1/Views/Transactions/TransactionsListView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionsListView.swift
@@ -110,12 +110,12 @@ extension TransactionsListView {
}
}
// .onDelete(perform: removeItems) // delete this row
from the list
- }
+ }.id(viewId)
+ .listStyle(myListStyle.style).anyView
.refreshable {
symLog?.log("refreshing")
await reloadAllAction()
- }.id(viewId)
- .listStyle(myListStyle.style).anyView
+ }
.onAppear {
if showUpDown {
upAction = { withAnimation { scrollView.scrollTo(0) }}
diff --git a/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift
b/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift
index da3f547..e86a472 100644
--- a/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift
+++ b/TalerWallet1/Views/WithdrawBankIntegrated/WithdrawURIView.swift
@@ -17,6 +17,7 @@ struct WithdrawURIView: View {
let url: URL
@EnvironmentObject private var model: WalletModel
+ @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
// the exchange used for this withdrawal.
@State private var exchangeBaseUrl: String? = nil
@@ -44,6 +45,7 @@ struct WithdrawURIView: View {
QuiteSomeCoins(someCoins: someCoins, shouldShowFee: false,
currency: raw.currencyStr, amountEffective:
effective)
}
+ .listStyle(myListStyle.style).anyView
.navigationTitle(navTitle)
let tosAccepted = withdrawalAmountDetails.tosAccepted
if tosAccepted {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (f361428 -> ad57348), gnunet, 2023/07/07
- [taler-taler-ios] 01/09: TestFlight WhatToTest for Xcode Cloud, gnunet, 2023/07/07
- [taler-taler-ios] 05/09: shorter title, debug info, gnunet, 2023/07/07
- [taler-taler-ios] 02/09: Payment model uses transactionID, gnunet, 2023/07/07
- [taler-taler-ios] 03/09: List handling,
gnunet <=
- [taler-taler-ios] 06/09: remove .travis.yml, gnunet, 2023/07/07
- [taler-taler-ios] 09/09: iOS: bump version to 0.9.3 (14), gnunet, 2023/07/07
- [taler-taler-ios] 08/09: tosStatus, gnunet, 2023/07/07
- [taler-taler-ios] 04/09: ThreeAmounts, gnunet, 2023/07/07
- [taler-taler-ios] 07/09: Enhanced ToS plaintext formatting, gnunet, 2023/07/07