summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Stibane <marc@taler.net>2023-07-24 16:02:48 +0200
committerMarc Stibane <marc@taler.net>2023-07-24 16:02:48 +0200
commit01726cada2e886147be614e59d837807da357d08 (patch)
tree798f46067f1672a7a4a51fed369b0ddbdf2af0ea
parent8a126ae2156ef416a42075ff2bf712c221fa4e2a (diff)
downloadtaler-ios-01726cada2e886147be614e59d837807da357d08.tar.gz
taler-ios-01726cada2e886147be614e59d837807da357d08.tar.bz2
taler-ios-01726cada2e886147be614e59d837807da357d08.zip
SendDone
-rw-r--r--TalerWallet.xcodeproj/project.pbxproj8
-rw-r--r--TalerWallet1/Views/Peer2peer/PaymentPurpose.swift2
-rw-r--r--TalerWallet1/Views/Peer2peer/SendDone.swift (renamed from TalerWallet1/Views/Peer2peer/SendNow.swift)50
-rw-r--r--TalerWallet1/Views/Peer2peer/SendPurpose.swift2
4 files changed, 33 insertions, 29 deletions
diff --git a/TalerWallet.xcodeproj/project.pbxproj b/TalerWallet.xcodeproj/project.pbxproj
index 4cbd328..4861860 100644
--- a/TalerWallet.xcodeproj/project.pbxproj
+++ b/TalerWallet.xcodeproj/project.pbxproj
@@ -94,7 +94,7 @@
4EB0956E2989CBFE0043A8A1 /* Model+Pending.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EB0954C2989CBFE0043A8A1 /* Model+Pending.swift */; };
4EB0956F2989CBFE0043A8A1 /* PendingOpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EB0954D2989CBFE0043A8A1 /* PendingOpView.swift */; };
4EB095702989CBFE0043A8A1 /* PendingOpsListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EB0954E2989CBFE0043A8A1 /* PendingOpsListView.swift */; };
- 4EB3136129FEE79B007D68BC /* SendNow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EB3136029FEE79B007D68BC /* SendNow.swift */; };
+ 4EB3136129FEE79B007D68BC /* SendDone.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EB3136029FEE79B007D68BC /* SendDone.swift */; };
4EB431672A1E55C700C5690E /* ManualWithdrawDone.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EB431662A1E55C700C5690E /* ManualWithdrawDone.swift */; };
4EBA82AB2A3EB2CA00E5F39A /* TransactionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBA82AA2A3EB2CA00E5F39A /* TransactionButton.swift */; };
4EBA82AD2A3F580500E5F39A /* QuiteSomeCoins.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EBA82AC2A3F580500E5F39A /* QuiteSomeCoins.swift */; };
@@ -232,7 +232,7 @@
4EB0954C2989CBFE0043A8A1 /* Model+Pending.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Model+Pending.swift"; sourceTree = "<group>"; };
4EB0954D2989CBFE0043A8A1 /* PendingOpView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PendingOpView.swift; sourceTree = "<group>"; };
4EB0954E2989CBFE0043A8A1 /* PendingOpsListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PendingOpsListView.swift; sourceTree = "<group>"; };
- 4EB3136029FEE79B007D68BC /* SendNow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendNow.swift; sourceTree = "<group>"; };
+ 4EB3136029FEE79B007D68BC /* SendDone.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SendDone.swift; sourceTree = "<group>"; };
4EB431662A1E55C700C5690E /* ManualWithdrawDone.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManualWithdrawDone.swift; sourceTree = "<group>"; };
4EBA82AA2A3EB2CA00E5F39A /* TransactionButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionButton.swift; sourceTree = "<group>"; };
4EBA82AC2A3F580500E5F39A /* QuiteSomeCoins.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuiteSomeCoins.swift; sourceTree = "<group>"; };
@@ -538,7 +538,7 @@
children = (
4E40E0BD29F25ABB00B85369 /* SendAmount.swift */,
4E7940DD29FC307C00A9AEA1 /* SendPurpose.swift */,
- 4EB3136029FEE79B007D68BC /* SendNow.swift */,
+ 4EB3136029FEE79B007D68BC /* SendDone.swift */,
4E9320442A1645B600A87B0E /* RequestPayment.swift */,
4E9320462A164BC700A87B0E /* PaymentPurpose.swift */,
);
@@ -788,7 +788,7 @@
4EAD117629F672FA008EDD0B /* KeyboardResponder.swift in Sources */,
4EB095572989CBFE0043A8A1 /* TransactionRowView.swift in Sources */,
4EA1ABBE29A3833A008821EA /* PublicConstants.swift in Sources */,
- 4EB3136129FEE79B007D68BC /* SendNow.swift in Sources */,
+ 4EB3136129FEE79B007D68BC /* SendDone.swift in Sources */,
4EB0956B2989CBFE0043A8A1 /* TextFieldAlert.swift in Sources */,
4EBA82AD2A3F580500E5F39A /* QuiteSomeCoins.swift in Sources */,
4EB431672A1E55C700C5690E /* ManualWithdrawDone.swift in Sources */,
diff --git a/TalerWallet1/Views/Peer2peer/PaymentPurpose.swift b/TalerWallet1/Views/Peer2peer/PaymentPurpose.swift
index a608488..969440a 100644
--- a/TalerWallet1/Views/Peer2peer/PaymentPurpose.swift
+++ b/TalerWallet1/Views/Peer2peer/PaymentPurpose.swift
@@ -65,7 +65,7 @@ struct PaymentPurpose: View {
let disabled = (expireDays == 0) || (summary.count < 1)
NavigationLink(destination: LazyView {
- SendNow(amountToSend: nil,
+ SendDone(amountToSend: nil,
amountToReceive: amount,
summary: summary, expireDays: expireDays)
}) {
diff --git a/TalerWallet1/Views/Peer2peer/SendNow.swift b/TalerWallet1/Views/Peer2peer/SendDone.swift
index aba01b7..79b0918 100644
--- a/TalerWallet1/Views/Peer2peer/SendNow.swift
+++ b/TalerWallet1/Views/Peer2peer/SendDone.swift
@@ -6,13 +6,15 @@ import SwiftUI
import taler_swift
import SymLog
-struct SendNow: View {
+struct SendDone: View {
private let symLog = SymLogV()
+ let navTitle = String(localized: "P2P Ready")
#if DEBUG
@AppStorage("developerMode") var developerMode: Bool = true
#else
@AppStorage("developerMode") var developerMode: Bool = false
#endif
+ @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
let amountToSend: Amount?
let amountToReceive: Amount?
@@ -24,37 +26,39 @@ struct SendNow: View {
@State var talerURI: String = ""
var body: some View {
- VStack {
+ List {
+ let incoming = (amountToSend == nil)
+ QRCodeDetailView(talerURI: talerURI,
+ incoming: incoming,
+ amount: incoming ? amountToReceive : amountToSend)
+ Text("QR code and link can also be scanned or copied / shared from Transactions later.")
+ .multilineTextAlignment(.leading)
+ .font(.subheadline)
+ .padding(.top)
+ }
+ .listStyle(myListStyle.style).anyView
+ .safeAreaInset(edge: .bottom) {
+ Button("Done") {
+ withAnimation() { ViewState.shared.popToRootView() }
+ }
+ .buttonStyle(TalerButtonStyle(type: .prominent))
+ .padding(.horizontal)
+ }
+ .overlay {
if talerURI.isEmpty {
LoadingView(backButtonHidden: true)
- } else {
- QRCodeDetailView(talerURI: talerURI,
- incoming: amountToSend == nil)
- .padding()
- Text("The QR code can also be copied and shared from Transactions later.")
- .fixedSize(horizontal: false, vertical: true)
- .font(.subheadline)
- .padding(.vertical, 20)
-
- Spacer()
- Button("Done") {
- withAnimation(){ ViewState.shared.popToRootView() }
- }
- .buttonStyle(TalerButtonStyle(type: .prominent))
- .padding()
-
}
}
-// .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
-// .padding(.horizontal)
.interactiveDismissDisabled() // can only use "Done" button to dismiss
- .navigationBarHidden(true) // no back button, no title
+ .navigationBarBackButtonHidden(true)
+ .navigationTitle(navTitle)
+// .navigationBarHidden(true) // no back button, no title
.background(WalletColors().backgroundColor.edgesIgnoringSafeArea(.all))
.task {
symLog.log(".task")
do {
// generate talerURI
- var timestamp = developerMode ? Timestamp.inSomeMinutes(expireDays > 20 ? (24*60)
+ let timestamp = developerMode ? Timestamp.inSomeMinutes(expireDays > 20 ? (24*60)
: expireDays > 5 ? 60 : 3)
: Timestamp.inSomeDays(expireDays)
if let amountToSend {
@@ -83,7 +87,7 @@ struct SendNow: View {
struct SendNow_Previews: PreviewProvider {
static var previews: some View {
Group {
- SendNow(amountToSend: try! Amount(fromString: LONGCURRENCY + ":4.8"),
+ SendDone(amountToSend: try! Amount(fromString: LONGCURRENCY + ":4.8"),
amountToReceive: nil,
summary: "some purpose",
expireDays: 0,
diff --git a/TalerWallet1/Views/Peer2peer/SendPurpose.swift b/TalerWallet1/Views/Peer2peer/SendPurpose.swift
index 50ee382..3703d91 100644
--- a/TalerWallet1/Views/Peer2peer/SendPurpose.swift
+++ b/TalerWallet1/Views/Peer2peer/SendPurpose.swift
@@ -65,7 +65,7 @@ struct SendPurpose: View {
let disabled = (expireDays == 0) || (summary.count < 1) // TODO: check amountAvailable
NavigationLink(destination: LazyView {
- SendNow(amountToSend: amount,
+ SendDone(amountToSend: amount,
amountToReceive: nil,
summary: summary, expireDays: expireDays)
}) {