commit f26e277802ecf62ad042cb485c4cfc981c773368
parent 6fec1ca046dba916cd83e2bbf44e937f2a35b1f9
Author: Marc Stibane <marc@taler.net>
Date: Fri, 17 Nov 2023 16:37:06 +0100
ScrollVStack, cleanup
Diffstat:
4 files changed, 21 insertions(+), 29 deletions(-)
diff --git a/TalerWallet1/Views/Peer2peer/RequestPayment.swift b/TalerWallet1/Views/Peer2peer/RequestPayment.swift
@@ -57,7 +57,7 @@ struct RequestPayment: View {
.disabled(disabled)
}
Spacer()
- } }
+ } } // ScrollVStack
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal)
.background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
diff --git a/TalerWallet1/Views/Peer2peer/RequestPurpose.swift b/TalerWallet1/Views/Peer2peer/RequestPurpose.swift
@@ -25,7 +25,7 @@ struct RequestPurpose: View {
var body: some View {
let currencyInfo = controller.info(for: amountToTransfer.currencyStr, controller.currencyTicker)
- VStack (spacing: 6) {
+ ScrollView { VStack (spacing: 6) {
Text(amountToTransfer.string(currencyInfo))
Text("+ \(fee) payment fee")
.foregroundColor(.red)
@@ -76,7 +76,7 @@ struct RequestPurpose: View {
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal)
- }
+ } } // ScrollVStack
.navigationTitle(navTitle)
.background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
.onAppear {
diff --git a/TalerWallet1/Views/Peer2peer/SendDoneV.swift b/TalerWallet1/Views/Peer2peer/SendDoneV.swift
@@ -36,7 +36,7 @@ struct SendDoneV: View {
let _ = Self._printChanges()
let _ = symLog.vlog() // just to get the # to compare it with .onAppear & onDisappear
#endif
- VStack {
+ ScrollView { VStack {
if let transactionId {
TransactionDetailView(stack: stack.push(),
transactionId: transactionId,
@@ -53,7 +53,7 @@ struct SendDoneV: View {
} else {
WithdrawProgressView(message: "Loading...")
}
- }
+ } } // ScrollVStack
// .background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
.navigationTitle(navTitle)
.task {
diff --git a/TalerWallet1/Views/Peer2peer/SendPurpose.swift b/TalerWallet1/Views/Peer2peer/SendPurpose.swift
@@ -22,7 +22,7 @@ struct SendPurpose: View {
@FocusState private var isFocused: Bool
var body: some View {
- VStack (spacing: 6) {
+ ScrollView { VStack (spacing: 6) {
Text(amountToTransfer.readableDescription) // TODO: curreny formatter
Text("+ \(fee) payment fee")
.accessibilityFont(.body)
@@ -33,34 +33,26 @@ struct SendPurpose: View {
.accessibilityFont(.title2)
.padding(.top)
}
- if #available(iOS 16.0, *) {
+ Group { if #available(iOS 16.0, *) {
TextField("Subject", text: $summary, axis: .vertical)
- .accessibilityFont(.title2)
- .lineLimit(2...)
- .foregroundColor(WalletColors().fieldForeground) // text color
- .background(WalletColors().fieldBackground)
- .textFieldStyle(.roundedBorder)
.focused($isFocused)
- .onAppear {
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
- isFocused = true // make first responder - raise keybord
- }
- }
+ .lineLimit(2...)
} else {
TextField("Subject", text: $summary)
- .accessibilityFont(.title)
-// .lineLimit(2...5) // lineLimit' is only available in iOS 16.0 or newer
- .foregroundColor(WalletColors().fieldForeground) // text color
- .background(WalletColors().fieldBackground)
- .textFieldStyle(.roundedBorder)
.focused($isFocused)
- .onAppear {
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
- isFocused = true // make first responder - raise keybord
- }
+// .lineLimit(2...5) // lineLimit' is only available in iOS 16.0 or newer
+ } }
+ .accessibilityFont(.title2)
+ .foregroundColor(WalletColors().fieldForeground) // text color
+ .background(WalletColors().fieldBackground)
+ .textFieldStyle(.roundedBorder)
+ .onAppear {
+ symLog.log("dispatching kbd...")
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
+ isFocused = true // make first responder - raise keybord
+ symLog.log("...kbd isFocused")
}
- } // #available
-
+ }
HStack{
Spacer()
Text(verbatim: "\(summary.count)/100")
@@ -93,7 +85,7 @@ struct SendPurpose: View {
.textFieldStyle(.roundedBorder)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.horizontal)
- }
+ } } // ScrollVStack
.navigationTitle(navTitle)
.background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
.onAppear {