[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 06/11: QRcodesForPayto
From: |
gnunet |
Subject: |
[taler-taler-ios] 06/11: QRcodesForPayto |
Date: |
Sat, 10 Aug 2024 04:29:26 +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 cf75516359e4f140d7f10bce44754b696901e6f8
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Aug 8 06:46:13 2024 +0200
QRcodesForPayto
---
TalerWallet.xcodeproj/project.pbxproj | 6 ++
TalerWallet1/Controllers/DebugViewC.swift | 1 +
.../Views/Transactions/ManualDetailsV.swift | 35 +++++------
.../Views/Transactions/QRcodesForPayto.swift | 69 ++++++++++++++++++++++
4 files changed, 90 insertions(+), 21 deletions(-)
diff --git a/TalerWallet.xcodeproj/project.pbxproj
b/TalerWallet.xcodeproj/project.pbxproj
index c679e0a..bc43ae6 100644
--- a/TalerWallet.xcodeproj/project.pbxproj
+++ b/TalerWallet.xcodeproj/project.pbxproj
@@ -180,6 +180,8 @@
4E8E25332A1CD39700A27BFA /* EqualIconWidthDomain.swift in
Sources */ = {isa = PBXBuildFile; fileRef = 4E8E25322A1CD39700A27BFA /*
EqualIconWidthDomain.swift */; };
4E8EADA52C6470B900C6CDC4 /* ManualDetailsWireV.swift in Sources
*/ = {isa = PBXBuildFile; fileRef = 4E8EADA42C6470B800C6CDC4 /*
ManualDetailsWireV.swift */; };
4E8EADA62C6470B900C6CDC4 /* ManualDetailsWireV.swift in Sources
*/ = {isa = PBXBuildFile; fileRef = 4E8EADA42C6470B800C6CDC4 /*
ManualDetailsWireV.swift */; };
+ 4E8EADA82C64744700C6CDC4 /* QRcodesForPayto.swift in Sources */
= {isa = PBXBuildFile; fileRef = 4E8EADA72C64744700C6CDC4 /*
QRcodesForPayto.swift */; };
+ 4E8EADA92C64744700C6CDC4 /* QRcodesForPayto.swift in Sources */
= {isa = PBXBuildFile; fileRef = 4E8EADA72C64744700C6CDC4 /*
QRcodesForPayto.swift */; };
4E9320432A14F6EA00A87B0E /* WalletColors.swift in Sources */ =
{isa = PBXBuildFile; fileRef = 4E9320422A14F6EA00A87B0E /* WalletColors.swift
*/; };
4E9320452A1645B600A87B0E /* RequestPayment.swift in Sources */
= {isa = PBXBuildFile; fileRef = 4E9320442A1645B600A87B0E /*
RequestPayment.swift */; };
4E96583C2B79656E00404A68 /* DepositAmountV.swift in Sources */
= {isa = PBXBuildFile; fileRef = 4E96583B2B79656E00404A68 /*
DepositAmountV.swift */; };
@@ -404,6 +406,7 @@
4E8C171F2A6509BB005B2392 /*
Atkinson-Hyperlegible-BoldItalic-102.otf */ = {isa = PBXFileReference;
lastKnownFileType = file; path = "Atkinson-Hyperlegible-BoldItalic-102.otf";
sourceTree = "<group>"; };
4E8E25322A1CD39700A27BFA /* EqualIconWidthDomain.swift */ =
{isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path =
EqualIconWidthDomain.swift; sourceTree = "<group>"; };
4E8EADA42C6470B800C6CDC4 /* ManualDetailsWireV.swift */ = {isa
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift;
path = ManualDetailsWireV.swift; sourceTree = "<group>"; };
+ 4E8EADA72C64744700C6CDC4 /* QRcodesForPayto.swift */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path
= QRcodesForPayto.swift; sourceTree = "<group>"; };
4E9320422A14F6EA00A87B0E /* WalletColors.swift */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path
= WalletColors.swift; sourceTree = "<group>"; };
4E9320442A1645B600A87B0E /* RequestPayment.swift */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path
= RequestPayment.swift; sourceTree = "<group>"; };
4E96583B2B79656E00404A68 /* DepositAmountV.swift */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path
= DepositAmountV.swift; sourceTree = "<group>"; };
@@ -795,6 +798,7 @@
4E87C8722A31CB7F001C6406 /*
TransactionsEmptyView.swift */,
4E6EDD842A3615BE0031D520 /*
ManualDetailsV.swift */,
4E8EADA42C6470B800C6CDC4 /*
ManualDetailsWireV.swift */,
+ 4E8EADA72C64744700C6CDC4 /*
QRcodesForPayto.swift */,
4ED2F94A2A278F5100453B40 /*
ThreeAmountsSection.swift */,
);
path = Transactions;
@@ -1187,6 +1191,7 @@
4EE77E852C101493007C9064 /* OverviewListV.swift
in Sources */,
4E3EAE252A990778009F1BE8 /*
WithdrawAcceptDone.swift in Sources */,
4E3EAE262A990778009F1BE8 /* Transaction.swift
in Sources */,
+ 4E8EADA82C64744700C6CDC4 /*
QRcodesForPayto.swift in Sources */,
4E605DB72AB05E48002FB9A7 /*
View+flippedDirection.swift in Sources */,
4E983C2C2ADC416800FA9CC5 /*
View+fitsSideBySide.swift in Sources */,
4E3EAE272A990778009F1BE8 /* WalletColors.swift
in Sources */,
@@ -1317,6 +1322,7 @@
4EE77E862C101493007C9064 /* OverviewListV.swift
in Sources */,
4E5A88F72A3B9E5B00072618 /*
WithdrawAcceptDone.swift in Sources */,
4EB095222989CBCB0043A8A1 /* Transaction.swift
in Sources */,
+ 4E8EADA92C64744700C6CDC4 /*
QRcodesForPayto.swift in Sources */,
4E605DB82AB05E48002FB9A7 /*
View+flippedDirection.swift in Sources */,
4E983C2D2ADC416800FA9CC5 /*
View+fitsSideBySide.swift in Sources */,
4E9320432A14F6EA00A87B0E /* WalletColors.swift
in Sources */,
diff --git a/TalerWallet1/Controllers/DebugViewC.swift
b/TalerWallet1/Controllers/DebugViewC.swift
index 54d28a9..21f9046 100644
--- a/TalerWallet1/Controllers/DebugViewC.swift
+++ b/TalerWallet1/Controllers/DebugViewC.swift
@@ -46,6 +46,7 @@ public let VIEW_WITHDRAWAL = VIEW_EMPTY_HISTORY + 10
// 30 Withdr
public let VIEW_WITHDRAW_TOS = VIEW_WITHDRAWAL + 1 // 31
WithdrawTOSView
public let VIEW_WITHDRAW_ACCEPT = VIEW_WITHDRAW_TOS + 1 // 32
ManualWithdrawDone
public let VIEW_WITHDRAW_INSTRUCTIONS = VIEW_WITHDRAW_ACCEPT + 1 // 33
ManualDetailsWireV
+public let VIEW_WITHDRAW_QRCODES = VIEW_WITHDRAW_INSTRUCTIONS + 1 // 34
QRcodesForPayto
// MARK: Manual Deposit (from Banking / ExchangeList)
// send coins back to customer ==> instruct exchange to make the wire transfer
to the customer's bank account
diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift
b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
index 713ccee..de48062 100644
--- a/TalerWallet1/Views/Transactions/ManualDetailsV.swift
+++ b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
@@ -198,27 +198,11 @@ struct ManualDetailsV: View {
} else if let amount = account.transferAmount {
if let bankName = account.bankLabel {
Text(bankName + ": " + amountStr)
- } else {
- Text(amountStr)
+// } else {
+// Text(amountStr)
}
}
let payto = account.paytoUri
- let qrCodesForPayto = Group {
- ForEach(qrCodeSpecs, id: \.self) { spec in
- let specDetails =
String("❗️\(spec.type)❗️\(spec.qrContent)❗️")
- QRGeneratorView(text: spec.qrContent)
- .frame(maxWidth: .infinity, alignment: .center)
- .accessibilityLabel("QR Code")
- .listRowSeparator(.hidden)
- CopyShare(textToCopy: spec.qrContent)
- .disabled(false)
-// .padding(.bottom)
-
-// Text(specDetails)
-// .listRowSeparator(.automatic)
- }
- }
-
let payURL = URL(string: payto)
if let queryParameters = payURL?.queryParameters {
let iban = payURL?.iban
@@ -238,6 +222,15 @@ struct ManualDetailsV: View {
Text(minimalistic ? "Instructions"
: "Wire transfer
instructions")
}
+
+ if qrCodeSpecs.count > 0 {
+ let qrCodesForPayto = QRcodesForPayto(stack:
stack.push(), qrCodeSpecs: $qrCodeSpecs)
+ NavigationLink(destination: qrCodesForPayto) {
+ Text(minimalistic ? "QR"
+ : "Wire transfer QR
codes")
+ }
+ .listRowSeparator(.visible)
+ }
Text(minimalistic ? "**Alternative:** Use this
PayTo-Link:"
: "**Alternative:** If your bank already
supports PayTo, you can use this PayTo-Link instead:")
.multilineTextAlignment(.leading)
@@ -246,10 +239,10 @@ struct ManualDetailsV: View {
let title = String(localized: "Share the PayTo
URL", comment: "VoiceOver")
let minTitle = String(localized: "Share PayTo",
comment: "mini")
ShareButton(textToShare: payto, title:
minimalistic ? minTitle : title)
- .frame(maxWidth: .infinity, alignment:
.center)
+ .frame(maxWidth: .infinity, alignment: .center)
.accessibilityLabel(Text(title))
- .disabled(false)
- qrCodesForPayto
+ .disabled(false)
+ .listRowSeparator(.hidden)
}.id(listID)
.talerFont(.body)
.task {
diff --git a/TalerWallet1/Views/Transactions/QRcodesForPayto.swift
b/TalerWallet1/Views/Transactions/QRcodesForPayto.swift
new file mode 100644
index 0000000..7eba697
--- /dev/null
+++ b/TalerWallet1/Views/Transactions/QRcodesForPayto.swift
@@ -0,0 +1,69 @@
+/*
+ * This file is part of GNU Taler, ©2022-24 Taler Systems S.A.
+ * See LICENSE.md
+ */
+/**
+ * @author Marc Stibane
+ */
+import SwiftUI
+import OrderedCollections
+import taler_swift
+
+struct QRcodesForPayto: View {
+ let stack: CallStack
+ @Binding var qrCodeSpecs: [QrCodeSpec]
+ let navTitle = String(localized: "Wire transfer", comment: "ViewTitle of
wire-transfer QR codes")
+
+ @AppStorage("minimalistic") var minimalistic: Bool = false
+
+ var body: some View {
+ List {
+ if !minimalistic {
+ Text("If your banking software runs on another device, you can
scan one of these QR codes:")
+ .listRowSeparator(.hidden)
+ }
+ ForEach(qrCodeSpecs, id: \.self) { spec in
+ Text(spec.type)
+ QRGeneratorView(text: spec.qrContent)
+ .frame(maxWidth: .infinity, alignment: .center)
+ .accessibilityLabel("QR Code")
+ .listRowSeparator(.hidden)
+ HStack {
+ Text(verbatim: "|") // only reason for this
leading-aligned text is to get a nice full length listRowSeparator
+ .accessibilityHidden(true)
+ .foregroundColor(Color.clear)
+ // Spacer()
+ CopyShare(textToCopy: spec.qrContent)
+ .disabled(false)
+ }.listRowSeparator(.automatic)
+ }
+ }
+ .navigationTitle(navTitle)
+ .onAppear() {
+// symLog.log("onAppear")
+ DebugViewC.shared.setViewID(VIEW_WITHDRAW_QRCODES, stack:
stack.push())
+ }
+ }
+}
+// MARK: -
+#if DEBUG
+//struct QRcodesForPayto_Previews: PreviewProvider {
+// static var previews: some View {
+// let common = TransactionCommon(type: .withdrawal,
+// txState: TransactionState(major: .done),
+// amountEffective: Amount(currency: LONGCURRENCY,
cent: 110),
+// amountRaw: Amount(currency: LONGCURRENCY,
cent: 220),
+// transactionId: "someTxID",
+// timestamp: Timestamp(from:
1_666_666_000_000),
+// txActions: [])
+// let payto =
"payto://iban/SANDBOXX/DE159593?receiver-name=Exchange+Company"
+// let details = WithdrawalDetails(type: .manual,
+// reservePub:
"ReSeRvEpUbLiC_KeY_FoR_WiThDrAwAl",
+// reserveIsReady: false,
+// confirmed: false)
+// List {
+// QRcodesForPayto(stack: CallStack("Preview"), qrCodeSpecs:
details)
+// }
+// }
+//}
+#endif
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (022a1b3 -> fb443d4), gnunet, 2024/08/09
- [taler-taler-ios] 04/11: DepositWireTypesForCurrency, gnunet, 2024/08/09
- [taler-taler-ios] 03/11: layout, gnunet, 2024/08/09
- [taler-taler-ios] 02/11: ShareButton title, gnunet, 2024/08/09
- [taler-taler-ios] 01/11: callStack, gnunet, 2024/08/09
- [taler-taler-ios] 11/11: Bump version to 0.12.0 (0.12.9), gnunet, 2024/08/09
- [taler-taler-ios] 05/11: ManualDetailsWireV, gnunet, 2024/08/09
- [taler-taler-ios] 06/11: QRcodesForPayto,
gnunet <=
- [taler-taler-ios] 07/11: cleanup, gnunet, 2024/08/09
- [taler-taler-ios] 10/11: ManualDetails, gnunet, 2024/08/09
- [taler-taler-ios] 09/11: currencySymbol, gnunet, 2024/08/09
- [taler-taler-ios] 08/11: German translation, gnunet, 2024/08/09