gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] branch master updated (b01070b -> f7e86aa)


From: gnunet
Subject: [taler-taler-ios] branch master updated (b01070b -> f7e86aa)
Date: Tue, 21 Nov 2023 17:19:15 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a change to branch master
in repository taler-ios.

    from b01070b  Bump version to 0.9.3 (27)
     new b680c0e  badge, VoiceOver
     new 111729e  CurrencySpecification code
     new f7e86aa  VersionInfo

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 TalerWallet1/Controllers/PublicConstants.swift     |  5 ++++
 TalerWallet1/Helper/CurrencySpecification.swift    |  7 +++--
 TalerWallet1/Model/WalletModel.swift               |  2 --
 .../Views/Balances/BalancesSectionView.swift       | 11 +++++++
 TalerWallet1/Views/Balances/PendingRowView.swift   |  7 ++---
 TalerWallet1/Views/Settings/AboutView.swift        |  8 -----
 .../Views/Transactions/TransactionDetailView.swift | 35 ++++++++++++----------
 .../Views/Transactions/TransactionRowView.swift    | 32 +++++++++++++-------
 8 files changed, 64 insertions(+), 43 deletions(-)

diff --git a/TalerWallet1/Controllers/PublicConstants.swift 
b/TalerWallet1/Controllers/PublicConstants.swift
index 1b5c9ae..da8bb9a 100644
--- a/TalerWallet1/Controllers/PublicConstants.swift
+++ b/TalerWallet1/Controllers/PublicConstants.swift
@@ -16,6 +16,11 @@ public let THIRTYDAYS: UInt = 30    // 10..30
 public let EMPTYSTRING = ""                         // avoid automatic 
translation of empty "" textLiterals in Text()
 public let CONFIRM_BANK = "circle.fill"             // badge in PendingRow, 
TransactionRow and TransactionDetail
 public let NEEDS_KYC = "star.fill"                  // badge in PendingRow, 
TransactionRow and TransactionDetail
+public let PENDING_INCOMING = "plus.diamond"
+public let PENDING_OUTGOING = "minus.diamond"
+public let DONE_INCOMING = "plus.circle.fill"
+public let DONE_OUTGOING = "minus.circle.fill"
+
 public let HTTPS = "https://";
 //public let DEMOBANK = HTTPS + "bAnK.dEmO.tAlEr.nEt"             // should be 
weird to read, but still work
 //public let DEMOEXCHANGE = HTTPS + "eXcHaNgE.dEmO.tAlEr.nEt"
diff --git a/TalerWallet1/Helper/CurrencySpecification.swift 
b/TalerWallet1/Helper/CurrencySpecification.swift
index 812a962..1d957f2 100644
--- a/TalerWallet1/Helper/CurrencySpecification.swift
+++ b/TalerWallet1/Helper/CurrencySpecification.swift
@@ -56,6 +56,7 @@ public struct CurrencyInfo {
     public static func zero(_ currency: String) -> CurrencyInfo {
         let scope = ScopeInfo(type: .global, currency: currency)
         let specs = CurrencySpecification(name: currency,
+                                          code: currency,
                          fractionalInputDigits: 0,
                         fractionalNormalDigits: 0,
                   fractionalTrailingZeroDigits: 0,
@@ -154,16 +155,16 @@ public struct CurrencySpecification2: Codable, Sendable {
 public struct CurrencySpecification: Codable, Sendable {
     enum CodingKeys: String, CodingKey {
         case name = "name"
-//        case decimalSeparator = "decimal_separator"
-//        case groupSeparator = "group_separator"
+        case code = "code"
         case fractionalInputDigits = "num_fractional_input_digits"
         case fractionalNormalDigits = "num_fractional_normal_digits"
         case fractionalTrailingZeroDigits = 
"num_fractional_trailing_zero_digits"
-//        case isCurrencyNameLeading = "is_currency_name_leading"
         case altUnitNames = "alt_unit_names"
     }
     /// some name for this CurrencySpecification
     let name: String
+    /// 3-char ISO 4217 code for global currency. Regional MUST be >= 4 letters
+    let code: String
     /// how much digits the user may enter after the decimal separator
     let fractionalInputDigits: Int
     /// €,$,£: 2;  some arabic currencies: 3,  ¥: 0
diff --git a/TalerWallet1/Model/WalletModel.swift 
b/TalerWallet1/Model/WalletModel.swift
index 428af7e..288f35d 100644
--- a/TalerWallet1/Model/WalletModel.swift
+++ b/TalerWallet1/Model/WalletModel.swift
@@ -79,12 +79,10 @@ fileprivate struct GetTransactionById: 
WalletBackendFormattedRequest {
 // MARK: -
 /// The info returned from Wallet-core init
 struct VersionInfo: Decodable {
-    var hash: String?
     var version: String
     var exchange: String
     var merchant: String
     var bank: String
-    var devMode: Bool
 }
 // MARK: -
 ///  A request to initialize Wallet-core
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift 
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index e7c390e..1e5cede 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -190,6 +190,10 @@ fileprivate struct BalancesPendingRowView: View {
                            reloadOneAction: reloadOneAction)
             }
         } label: {
+            let needsKYC = true
+            let shouldConfirm = false
+            let needsKYCStr = String(localized: ". Needs K Y C", comment: 
"VoiceOver")
+            let needsConfStr = String(localized: ". Needs bank confirmation", 
comment: "VoiceOver")
             VStack(spacing: 6) {
                 var rows = 0
                 if !pendingIncoming.isZero {
@@ -205,6 +209,13 @@ fileprivate struct BalancesPendingRowView: View {
                         .accessibilityFont(.body)
                 }
             }
+            .accessibilityElement(children: .combine)
+            .accessibilityValue(needsKYC && shouldConfirm ? needsKYCStr + 
needsConfStr :
+                                                 needsKYC ? needsKYCStr :
+                                            shouldConfirm ? needsConfStr
+                                                          : EMPTYSTRING)
+            .accessibilityHint("Will go to Pending transactions.")
+
         }
 
     } // body
diff --git a/TalerWallet1/Views/Balances/PendingRowView.swift 
b/TalerWallet1/Views/Balances/PendingRowView.swift
index d6153f6..62f3292 100644
--- a/TalerWallet1/Views/Balances/PendingRowView.swift
+++ b/TalerWallet1/Views/Balances/PendingRowView.swift
@@ -28,10 +28,8 @@ struct PendingRowView: View {
 
     var body: some View {
         let pendingColor = WalletColors().pendingColor(incoming)
-        let imageName = incoming ? "plus.diamond"       //  goforward.plus   
circle
-                                 : "minus.diamond"      //
-        let iconBadge = IconBadge(imageName: imageName, foreColor: 
pendingColor, shouldConfirm: shouldConfirm, needsKYC: needsKYC)
-
+        let iconBadge = IconBadge(foreColor: pendingColor, done: false, 
incoming: incoming,
+                                  shouldConfirm: shouldConfirm, needsKYC: 
needsKYC)
         let inTitle = iconOnly ? inTitle0 : inTitle1
         let outTitle = iconOnly ? outTitle0 : outTitle1
         let pendingTitle = incoming ? inTitle : outTitle
@@ -78,6 +76,7 @@ func PreviewCurrencyInfo(_ currency: String, digits: Int) -> 
CurrencyInfo {
     let unitName = digits == 0 ? "テ" : "ク"  // do not use real currency 
symbols like "¥" : "€"
     let scope = ScopeInfo(type: .global, currency: currency)
     let specs = CurrencySpecification(name: currency,
+                                      code: currency,
                      fractionalInputDigits: digits,
                     fractionalNormalDigits: digits,
               fractionalTrailingZeroDigits: digits,
diff --git a/TalerWallet1/Views/Settings/AboutView.swift 
b/TalerWallet1/Views/Settings/AboutView.swift
index adf768d..ae5fe33 100644
--- a/TalerWallet1/Views/Settings/AboutView.swift
+++ b/TalerWallet1/Views/Settings/AboutView.swift
@@ -53,14 +53,6 @@ struct AboutView: View {
                 SettingsItem(name: "Wallet Core Version", id1: "wallet-core") {
                     Text(verbatim: "\(walletCore.versionInfo?.version ?? 
"unknown")")
                 }
-                if developerMode {
-                    SettingsItem(name: "Wallet Core DevMode", id1: "devMode") {
-                        let modeStr = if let devMode = 
walletCore.versionInfo?.devMode {
-                            devMode ? "YES" : "NO"
-                        } else { "unknown" }
-                        Text(modeStr)
-                    }
-                }
                 SettingsItem(name: "Supported Exchange Versions", id1: 
"exchange") {
                     Text(verbatim: "\(walletCore.versionInfo?.exchange ?? 
"unknown")")
                 }
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift 
b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
index 661d354..4dd575f 100644
--- a/TalerWallet1/Views/Transactions/TransactionDetailView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -212,8 +212,25 @@ struct TransactionDetailView: View {
                             let withdrawalDetails = details.withdrawalDetails
                             switch withdrawalDetails.type {
                                 case .manual:               // "Make a wire 
transfer of \(amount) to"
+                                    if transaction.isPendingKYC {
+                                        if let kycUrl = common.kycUrl {
+                                            if let destination = URL(string: 
kycUrl) {
+                                                VStack(alignment: .leading) {  
// Show Hint that User must pass KYC on website
+                                                    if !iconOnly {
+                                                        Text("You need to pass 
a KYC procedure")
+                                                            
.fixedSize(horizontal: false, vertical: true)       // wrap in scrollview
+                                                            
.multilineTextAlignment(.leading)                   // otherwise
+                                                            
.listRowSeparator(.hidden)
+                                                    }
+                                                    Link("Open KYC website", 
destination: destination)
+                                                        
.buttonStyle(TalerButtonStyle(type: .prominent, badge: NEEDS_KYC))
+                                                        
.accessibilityHint("Will go to KYC website to confirm this withdrawal.")
+                                                }
+                                            }
+                                        }
+                                    }
                                     ManualDetailsV(common: common, details: 
withdrawalDetails)
-                                    
+
                                 case .bankIntegrated:       // "Confirm with 
bank"
                                     let confirmed = 
withdrawalDetails.confirmed ?? false
                                     if !confirmed {
@@ -228,21 +245,7 @@ struct TransactionDetailView: View {
                                                     }
                                                     Link("Confirm with bank", 
destination: destination)
                                                         
.buttonStyle(TalerButtonStyle(type: .prominent, badge: CONFIRM_BANK))
-                                                }
-                                            }
-                                        }
-                                    } else if transaction.isPendingKYC {
-                                        if let kycUrl = common.kycUrl {
-                                            if let destination = URL(string: 
kycUrl) {
-                                                VStack(alignment: .leading) {  
// Show Hint that User must pass KYC on website
-                                                    if !iconOnly {
-                                                        Text("You need to pass 
a KYC procedure")
-                                                            
.fixedSize(horizontal: false, vertical: true)       // wrap in scrollview
-                                                            
.multilineTextAlignment(.leading)                   // otherwise
-                                                            
.listRowSeparator(.hidden)
-                                                    }
-                                                    Link("Open KYC website", 
destination: destination)
-                                                        
.buttonStyle(TalerButtonStyle(type: .prominent, badge: NEEDS_KYC))
+                                                        
.accessibilityHint("Will go to bank website to confirm this withdrawal.")
                                                 }
                                             }
                                         }
diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift 
b/TalerWallet1/Views/Transactions/TransactionRowView.swift
index b618c66..514c1d6 100644
--- a/TalerWallet1/Views/Transactions/TransactionRowView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionRowView.swift
@@ -6,19 +6,29 @@ import SwiftUI
 import taler_swift
 
 struct IconBadge: View {
-    let imageName: String
     let foreColor:Color
+    let done: Bool
+//    let pending: Bool
+    let incoming: Bool
     let shouldConfirm: Bool
     let needsKYC: Bool
 
     var body: some View {
+        let imageName = incoming && done ? DONE_INCOMING
+                              : incoming ? PENDING_INCOMING
+                // since the money already left the wallet, show DONE
+                                         : DONE_OUTGOING        // 
PENDING_OUTGOING
         let badgeName = needsKYC ? NEEDS_KYC
                                  : CONFIRM_BANK
         HStack(alignment: .top, spacing: -8) {      // TODO: adapt spacing to 
dynamic fontsize
-            Image(systemName: imageName)
-                .foregroundColor(foreColor)
-                .accessibilityFont(.largeTitle)
-                .accessibility(hidden: true)
+            ZStack {
+                // "plus.diamond" is wider than "plus.circle.fill"
+                // ZStack centers the main icon, and the badge will always be 
at the same position
+                Image(systemName: PENDING_INCOMING)
+                    .foregroundColor(.clear)
+                Image(systemName: imageName)
+                    .foregroundColor(foreColor)
+            }.accessibilityFont(.largeTitle)
             Image(systemName: badgeName)
                 .accessibilityFont(.caption)
                 .foregroundColor((needsKYC || shouldConfirm) ? .red : .clear)
@@ -29,9 +39,11 @@ struct TransactionRowContentV: View {
     var centerTop: String
     var centerBottom: String
     let isHorizontal: Bool
+    let pending: Bool
     let incoming: Bool
     let shouldConfirm: Bool
     let needsKYC: Bool
+    let done: Bool
     let foreColor:Color
 
     public static func width(titles: (String, String?), isHorizontal: Bool,
@@ -59,9 +71,8 @@ struct TransactionRowContentV: View {
     }
 
     var body: some View {
-        let imageName = incoming ? "plus.circle.fill"
-                                 : "minus.circle.fill"
-        let iconBadge = IconBadge(imageName: imageName, foreColor: foreColor, 
shouldConfirm: shouldConfirm, needsKYC: needsKYC)
+        let iconBadge = IconBadge(foreColor: foreColor, done: done, incoming: 
incoming,
+                              shouldConfirm: shouldConfirm, needsKYC: needsKYC)
         HStack(spacing: 8) {
             iconBadge
             VStack(alignment: .leading) {
@@ -117,8 +128,9 @@ struct TransactionRowView: View {
 
                     TransactionRowContentV(centerTop: 
transaction.localizedType,
                                         centerBottom: dateString, 
isHorizontal: true,
-                                            incoming: incoming,  
shouldConfirm: shouldConfirm,
-                                            needsKYC: needsKYC,      
foreColor: foreColor)
+                                             pending: pending, incoming: 
incoming,
+                                       shouldConfirm: shouldConfirm, needsKYC: 
needsKYC,
+                                                done: done, foreColor: 
foreColor)
                 }
                     .accessibilityElement(children: .combine)
                     .accessibilityValue(needsKYC ? ". Needs K Y C" :

-- 
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]