gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 28/35: QRcode rendering and hint


From: gnunet
Subject: [taler-taler-ios] 28/35: QRcode rendering and hint
Date: Thu, 27 Jul 2023 09:10: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 71bdc77649055c39e8462623b7ba0108ee4aab55
Author: Marc Stibane <marc@taler.net>
AuthorDate: Tue Jul 25 16:34:19 2023 +0200

    QRcode rendering and hint
---
 .../Views/HelperViews/QRCodeDetailView.swift       | 32 +++++++++++++++-------
 .../Views/Transactions/TransactionDetailView.swift |  3 +-
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift 
b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
index 3891532..dfacf5e 100644
--- a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
+++ b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
@@ -10,25 +10,37 @@ import AVFoundation
 struct QRCodeDetailView: View {
     let talerURI: String
     let incoming: Bool
+    let amount: Amount?
 
     var body: some View {
         if talerURI.count > 10 {
-            VStack {
-                Text(incoming ? "Let the payer scan this QR code to pay:"
-                              : "Let the payee scan this QR code to receive:")
-                    .fixedSize(horizontal: false, vertical: true)
-                    .padding(.top, 30)
+            VStack (alignment: .leading) {
+                // TODO: use currency formatter instead of .readableDescription
+                let amountStr = (amount == nil) ?
+                    (incoming ? String(localized: "Let the payer scan this QR 
code to pay:")
+                              : String(localized: "Let the payee scan this QR 
code to receive:"))
+                :   (incoming ? String(localized: "Let the payer scan this QR 
code to pay \(amount!.readableDescription):",
+                                       comment: "amount.readableDescription: 
5,3 €")
+                              : String(localized: "Let the payee scan this QR 
code to receive \(amount!.readableDescription):",
+                                       comment: "amount.readableDescription: 
7.41 $"))
+                Text(amountStr)
+                    .fixedSize(horizontal: false, vertical: true)       // 
wrap in scrollview
+//                    .padding(.top, 30)
                     .font(.title3)
-
-                QRGeneratorView(text: talerURI)
-//                Text(talerURI)
+                HStack {
+                    Spacer()
+                    QRGeneratorView(text: talerURI)
+                    Spacer()
+                }
 
                 Text("Alternatively, copy and send this link:")
-                    .fixedSize(horizontal: false, vertical: true)
+                    .multilineTextAlignment(.leading)
                     .font(.title3)
                     .padding(.vertical)
 
                 Text(talerURI)
+                    .multilineTextAlignment(.center)
+                    .fixedSize(horizontal: false, vertical: true)       // 
wrap in scrollview
                     .padding(.bottom)
 
                 CopyShare(textToCopy: talerURI)
@@ -44,7 +56,7 @@ fileprivate struct ContentView: View {
 
     var body: some View {
         List {
-            QRCodeDetailView(talerURI: talerURI, incoming: false)
+            QRCodeDetailView(talerURI: talerURI, incoming: false, amount: nil)
         }
     }
 }
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift 
b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
index 594435e..e1af98c 100644
--- a/TalerWallet1/Views/Transactions/TransactionDetailView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -252,7 +252,8 @@ struct TransactionDetailView: View {
                 if let talerURI = details[TALERURI] {
                     if talerURI.count > 10 {
                         QRCodeDetailView(talerURI: talerURI,
-                                         incoming: transaction.isP2pIncoming)
+                                         incoming: transaction.isP2pIncoming,
+                                           amount: 
transaction.common.amountRaw)
                     }
                 }
             } else if keys.contains(EXCHANGEBASEURL) {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]