gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] branch master updated (08b93d6 -> 5459aa4)


From: gnunet
Subject: [taler-taler-ios] branch master updated (08b93d6 -> 5459aa4)
Date: Thu, 15 Feb 2024 13:51:03 +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 08b93d6  Bump version to 0.9.4 (5)
     new 2d7ffab  Sounds Off by default
     new c4c0bcc  Contrast of secondary color
     new 5459aa4  Wording of QR code dialog

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/Controller.swift          |  2 +-
 TalerWallet1/Helper/WalletColors.swift             |  8 +++++
 TalerWallet1/Views/Balances/BalanceRowView.swift   |  5 +--
 .../Views/Balances/BalancesSectionView.swift       |  5 +--
 TalerWallet1/Views/Banking/DepositAmountV.swift    |  5 ++-
 TalerWallet1/Views/Banking/DepositIbanV.swift      |  5 ++-
 TalerWallet1/Views/HelperViews/BarGraph.swift      |  5 +--
 .../Views/HelperViews/QRCodeDetailView.swift       | 38 ++++++++++++++--------
 TalerWallet1/Views/Main/MainView.swift             |  6 ++--
 TalerWallet1/Views/Peer2peer/P2PSubjectV.swift     |  4 ++-
 TalerWallet1/Views/Peer2peer/SendAmount.swift      |  5 ++-
 TalerWallet1/Views/Settings/SettingsView.swift     |  2 +-
 .../Views/Sheets/P2P_Sheets/P2pPayURIView.swift    |  4 ++-
 .../Sheets/P2P_Sheets/P2pReceiveURIView.swift      |  4 ++-
 .../Views/Transactions/ThreeAmountsV.swift         |  5 +--
 .../Views/Transactions/TransactionSummaryV.swift   |  7 ++--
 16 files changed, 67 insertions(+), 43 deletions(-)

diff --git a/TalerWallet1/Controllers/Controller.swift 
b/TalerWallet1/Controllers/Controller.swift
index 6e18cd1..cc8d3f0 100644
--- a/TalerWallet1/Controllers/Controller.swift
+++ b/TalerWallet1/Controllers/Controller.swift
@@ -37,7 +37,7 @@ class Controller: ObservableObject {
     @Published var currencyTicker: Int = 0                  // updates 
whenever a new currency is added
     @AppStorage("useHaptics") var useHaptics: Bool = true   // extension 
mustn't define this, so it must be here
     @AppStorage("playSoundsI") var playSoundsI: Int = 1     // extension 
mustn't define this, so it must be here
-    @AppStorage("playSoundsB") var playSoundsB: Bool = true
+    @AppStorage("playSoundsB") var playSoundsB: Bool = false
     @AppStorage("talerFontIndex") var talerFontIndex: Int = 0         // 
extension mustn't define this, so it must be here
     let hapticCapability = CHHapticEngine.capabilitiesForHardware()
     let logger = Logger(subsystem: "net.taler.gnu", category: "Controller")
diff --git a/TalerWallet1/Helper/WalletColors.swift 
b/TalerWallet1/Helper/WalletColors.swift
index 11e192e..bb6b9ac 100644
--- a/TalerWallet1/Helper/WalletColors.swift
+++ b/TalerWallet1/Helper/WalletColors.swift
@@ -7,6 +7,7 @@ import SwiftUI
 fileprivate let grouped = true
 
 public struct WalletColors {
+    @AppStorage("minimalistic") var minimalistic: Bool = false
 
     let tint = Color(.tintColor)
     let gray1 = Color(.systemGray)          // uncompleted
@@ -36,6 +37,13 @@ public struct WalletColors {
            : pressed ? gray4 : gray5
     }
 
+    func secondary(_ scheme: ColorScheme, _ contrast: ColorSchemeContrast) -> 
Color {
+        return contrast == .increased ? .primary            // WCAG AAA for 
any scheme
+                       : minimalistic ? .secondary          // not enough 
contrast
+                    : scheme == .dark ? .secondary          // WCAG AA for 
dark scheme
+                                      : Color(.darkGray)    // WCAG AA for 
light scheme
+    }
+
     var backgroundColor: Color {
         grouped ? Color(.systemGroupedBackground)
                 : Color(.systemBackground)
diff --git a/TalerWallet1/Views/Balances/BalanceRowView.swift 
b/TalerWallet1/Views/Balances/BalanceRowView.swift
index 1af8d10..ac15ea2 100644
--- a/TalerWallet1/Views/Balances/BalanceRowView.swift
+++ b/TalerWallet1/Views/Balances/BalanceRowView.swift
@@ -28,10 +28,7 @@ struct BalanceCell: View {
             } else {
                 let balanceText = Text("Balance:", comment: "Main view")
                     .talerFont(.title2)
-                    .foregroundColor(colorSchemeContrast == .increased ? 
.primary
-                                                        : minimalistic ? 
.secondary
-                                                : colorScheme == .dark ? 
.secondary
-                                                                       : 
Color(.darkGray))
+                    .foregroundColor(WalletColors().secondary(colorScheme, 
colorSchemeContrast))
                 let vLayout = VStack(alignment: .leading, spacing: 0) {
                     balanceText
                     hLayout
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift 
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index 94c4b47..7a87a57 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -142,10 +142,7 @@ extension BalancesSectionView: View {
                     Text(count > 1 ? "Recent \(count) transactions"
                                    : "Recent transaction")
                         .talerFont(.title3)
-                        .foregroundColor(colorSchemeContrast == .increased ? 
.primary
-                                                            : minimalistic ? 
.secondary
-                                                    : colorScheme == .dark ? 
.secondary
-                                                                           : 
Color(.darkGray))
+                        .foregroundColor(WalletColors().secondary(colorScheme, 
colorSchemeContrast))
                 }
             }
         } // recent transactions
diff --git a/TalerWallet1/Views/Banking/DepositAmountV.swift 
b/TalerWallet1/Views/Banking/DepositAmountV.swift
index 36488d1..0635481 100644
--- a/TalerWallet1/Views/Banking/DepositAmountV.swift
+++ b/TalerWallet1/Views/Banking/DepositAmountV.swift
@@ -21,6 +21,8 @@ struct DepositAmountV: View {
 
     @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
+    @Environment(\.colorScheme) private var colorScheme
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("minimalistic") var minimalistic: Bool = false
 
     @State var prepareDepositResult: PrepareDepositResult? = nil
@@ -112,7 +114,8 @@ struct DepositAmountV: View {
                                   : feeLabel)
                     .talerFont(.body)
                     .foregroundColor(insufficient ? .red
-                                                  : (feeAmount?.isZero ?? 
true) ? .secondary : .red)
+                                                  : (feeAmount?.isZero ?? 
true) ? WalletColors().secondary(colorScheme, colorSchemeContrast)
+                                                                               
 : .red)
                     .padding(4)
                 Button(buttonTitle(amountToTransfer, currencyInfo)) {
                     if let paytoUri {
diff --git a/TalerWallet1/Views/Banking/DepositIbanV.swift 
b/TalerWallet1/Views/Banking/DepositIbanV.swift
index c2c8b23..ef1e169 100644
--- a/TalerWallet1/Views/Banking/DepositIbanV.swift
+++ b/TalerWallet1/Views/Banking/DepositIbanV.swift
@@ -19,6 +19,8 @@ struct DepositIbanV: View {
 
     @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
+    @Environment(\.colorScheme) private var colorScheme
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("minimalistic") var minimalistic: Bool = false
     @AppStorage("depositIBAN") var depositIBAN: String = EMPTYSTRING
     @AppStorage("accountHolder") var accountHolder: String = EMPTYSTRING
@@ -63,7 +65,8 @@ struct DepositIbanV: View {
                 if label.count > 0 {
                     Text(label)
                         .frame(maxWidth: .infinity, alignment: .trailing)
-                        .foregroundColor(feeIsNotZero ? .red : .secondary)
+                        .foregroundColor(feeIsNotZero ? .red 
+                                                      : 
WalletColors().secondary(colorScheme, colorSchemeContrast))
                         .talerFont(.body)
                 }
             }
diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift 
b/TalerWallet1/Views/HelperViews/BarGraph.swift
index 60573eb..3f64829 100644
--- a/TalerWallet1/Views/HelperViews/BarGraph.swift
+++ b/TalerWallet1/Views/HelperViews/BarGraph.swift
@@ -26,10 +26,7 @@ struct BarGraphHeader: View {
         HStack (alignment: .center, spacing: 10) {
             Text(currencyName)
                 .talerFont(.title2)
-                .foregroundColor(colorSchemeContrast == .increased ? .primary
-                                                    : minimalistic ? .secondary
-                                            : colorScheme == .dark ? .secondary
-                                                                   : 
Color(.darkGray))
+                .foregroundColor(WalletColors().secondary(colorScheme, 
colorSchemeContrast))
             if let scopeInfo {
                 BarGraph(transactions: $completedTransactions,
                          maxBars: MAXBARS, barHeight: barHeight)
diff --git a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift 
b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
index 9a5fae3..52cdbba 100644
--- a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
+++ b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
@@ -13,6 +13,7 @@ struct QRCodeDetailView: View {
     let amount: Amount
 
     @EnvironmentObject private var controller: Controller
+    @AppStorage("minimalistic") var minimalistic: Bool = false
 
     var amountStr: String {
         if let currencyInfo = controller.info(for: amount.currencyStr) {
@@ -24,11 +25,15 @@ struct QRCodeDetailView: View {
     var body: some View {
         if talerURI.count > 10 {
             Section {
-                let either = incoming ? String(localized: "Either (payer)", 
defaultValue: "Either",
-                                                 comment: "Either (copy/share 
the payment link to the payer)")
-                                      : String(localized: "Either (payee)", 
defaultValue: "Either",
-                                                 comment: "Either (copy/share 
the payment link to the payee)")
-                Text(either)
+                let eitherMini = incoming ? String(localized: "Either 
(payer)", defaultValue: "Either",
+                                                     comment: "Either 
(copy/share this link to the payer)")
+                                          : String(localized: "Either 
(payee)", defaultValue: "Either",
+                                                     comment: "Either 
(copy/share this link to the payee)")
+                let eitherLong = incoming ? String(localized: "Either provide 
this payment link (payer)",
+                                                defaultValue: "Either provide 
this payment link")
+                                          : String(localized: "Either provide 
this payment link (payee)",
+                                                defaultValue: "Either provide 
this payment link")
+                Text(minimalistic ? eitherMini : eitherLong)
                     .multilineTextAlignment(.leading)
                     .talerFont(.title3)
 //                    .padding(.vertical)
@@ -37,9 +42,12 @@ struct QRCodeDetailView: View {
                     .disabled(false)
 //                    .padding(.bottom)
                     .listRowSeparator(.hidden)
-                let otherParty = incoming ? String(localized: "the payment 
link to the payer, or")
-                                          : String(localized: "the payment 
link to the payee, or")
-                Text(otherParty)
+
+                let otherPartyMini = incoming ? String(localized: "or scan 
this(payer)", defaultValue: "or scan this")
+                                              : String(localized: "or scan 
this(payee)", defaultValue: "or scan this")
+                let otherPartyLong = incoming ? String(localized: "to the 
payer, or")
+                                              : String(localized: "to the 
payee, or")
+                Text(minimalistic ? otherPartyMini : otherPartyLong)
                     .multilineTextAlignment(.leading)
                     .talerFont(.title3)
                     .listRowSeparator(.hidden)
@@ -48,12 +56,14 @@ struct QRCodeDetailView: View {
                     .accessibilityLabel("QR Code")
                     .listRowSeparator(.hidden)
 
-                let hintStr = incoming ? String(localized: "let the payer scan 
this QR code to pay \(amountStr).",
-                                                  comment: "e.g. '5,3 €'")
-                                       : String(localized: "let the payee scan 
this QR code to receive \(amountStr).",
-                                                  comment: "e.g. '$ 7.41'")
-                Text(hintStr)
-                    .fixedSize(horizontal: false, vertical: true)       // 
wrap in scrollview
+                let scanMini = incoming ? String(localized: "to pay 
\(amountStr).", comment: "e.g. '5,3 €'")
+                                        : String(localized: "to receive 
\(amountStr).", comment: "e.g. '$ 7.41'")
+                let scanLong = incoming ? String(localized: "let the payer 
scan this QR code to pay \(amountStr).",
+                                                   comment: "e.g. '5,3 €'")
+                                        : String(localized: "let the payee 
scan this QR code to receive \(amountStr).",
+                                                   comment: "e.g. '$ 7.41'")
+                Text(minimalistic ? scanMini : scanLong)
+                    .multilineTextAlignment(.leading)
                     .talerFont(.title3)
             }
         }
diff --git a/TalerWallet1/Views/Main/MainView.swift 
b/TalerWallet1/Views/Main/MainView.swift
index 0c22e73..df13198 100644
--- a/TalerWallet1/Views/Main/MainView.swift
+++ b/TalerWallet1/Views/Main/MainView.swift
@@ -21,9 +21,9 @@ struct MainView: View {
     @Binding var soundPlayed: Bool
 
     @EnvironmentObject private var controller: Controller
-    @AppStorage("talerFontIndex") var talerFontIndex: Int = 0         // 
extension mustn't define this, so it must be here
-    @AppStorage("playSoundsI") var playSoundsI: Int = 1     // extension 
mustn't define this, so it must be here
-    @AppStorage("playSoundsB") var playSoundsB: Bool = true
+    @AppStorage("talerFontIndex") var talerFontIndex: Int = 0       // 
extension mustn't define this, so it must be here
+    @AppStorage("playSoundsI") var playSoundsI: Int = 1             // 
extension mustn't define this, so it must be here
+    @AppStorage("playSoundsB") var playSoundsB: Bool = false
 
     @State private var sheetPresented = false
     @State private var urlToOpen: URL? = nil
diff --git a/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift 
b/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift
index 9dc7993..05892b0 100644
--- a/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift
+++ b/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift
@@ -27,6 +27,8 @@ struct P2PSubjectV: View {
     @Binding var expireDays: UInt
 
     @EnvironmentObject private var model: WalletModel
+    @Environment(\.colorScheme) private var colorScheme
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("minimalistic") var minimalistic: Bool = false
 
     @State private var myFeeLabel: String = EMPTYSTRING
@@ -62,7 +64,7 @@ struct P2PSubjectV: View {
                 if label.count > 0 {
                     Text(label)
                         .frame(maxWidth: .infinity, alignment: .trailing)
-                        .foregroundColor(feeIsNotZero ? .red : .secondary)
+                        .foregroundColor(feeIsNotZero ? .red : 
WalletColors().secondary(colorScheme, colorSchemeContrast))
                         .talerFont(.body)
                 }
             }
diff --git a/TalerWallet1/Views/Peer2peer/SendAmount.swift 
b/TalerWallet1/Views/Peer2peer/SendAmount.swift
index aca2b6d..7b534b3 100644
--- a/TalerWallet1/Views/Peer2peer/SendAmount.swift
+++ b/TalerWallet1/Views/Peer2peer/SendAmount.swift
@@ -18,6 +18,8 @@ struct SendAmount: View {
 
     @EnvironmentObject private var controller: Controller
     @EnvironmentObject private var model: WalletModel
+    @Environment(\.colorScheme) private var colorScheme
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("minimalistic") var minimalistic: Bool = false
 
     @State var peerPushCheck: CheckPeerPushDebitResponse? = nil
@@ -109,7 +111,8 @@ struct SendAmount: View {
                               : feeLabel)
                 .talerFont(.body)
                 .foregroundColor(insufficient ? .red
-                                 : (feeAmount?.isZero ?? true) ? .secondary : 
.red)
+                : (feeAmount?.isZero ?? true) ? 
WalletColors().secondary(colorScheme, colorSchemeContrast)
+                                              : .red)
                 .padding(4)
             NavigationLink(destination: inputDestination) { Text("Next") }
                 .buttonStyle(TalerButtonStyle(type: .prominent))
diff --git a/TalerWallet1/Views/Settings/SettingsView.swift 
b/TalerWallet1/Views/Settings/SettingsView.swift
index e2624d6..28e82eb 100644
--- a/TalerWallet1/Views/Settings/SettingsView.swift
+++ b/TalerWallet1/Views/Settings/SettingsView.swift
@@ -30,7 +30,7 @@ struct SettingsView: View {
 #endif
     @AppStorage("useHaptics") var useHaptics: Bool = true
     @AppStorage("playSoundsI") var playSoundsI: Int = 1
-    @AppStorage("playSoundsB") var playSoundsB: Bool = true
+    @AppStorage("playSoundsB") var playSoundsB: Bool = false
     @AppStorage("shouldShowWarning") var shouldShowWarning: Bool = true
 //    @AppStorage("increaseContrast") var increaseContrast: Bool = false
     @AppStorage("talerFontIndex") var talerFontIndex: Int = 0
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift 
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
index a639acf..9dbbd04 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pPayURIView.swift
@@ -17,6 +17,8 @@ struct P2pPayURIView: View {
     let url: URL
 
     @EnvironmentObject private var model: WalletModel
+    @Environment(\.colorScheme) private var colorScheme
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     @State private var peerPullDebitResponse: PreparePeerPullDebitResponse?
@@ -48,7 +50,7 @@ struct P2pPayURIView: View {
                     Text("Expires: \(dateString)")
                         .talerFont(.body)
                         .accessibilityLabel(accessibilityLabel)
-//                        .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
+                        .foregroundColor(WalletColors().secondary(colorScheme, 
colorSchemeContrast))
                 }
                 .listStyle(myListStyle.style).anyView
                 .navigationTitle(navTitle)
diff --git a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift 
b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
index dbf58a1..ee7bb6c 100644
--- a/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
+++ b/TalerWallet1/Views/Sheets/P2P_Sheets/P2pReceiveURIView.swift
@@ -17,6 +17,8 @@ struct P2pReceiveURIView: View {
     let url: URL
     
     @EnvironmentObject private var model: WalletModel
+    @Environment(\.colorScheme) private var colorScheme
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 
     @State private var peerPushCreditResponse: PreparePeerPushCreditResponse? 
= nil
@@ -56,7 +58,7 @@ struct P2pReceiveURIView: View {
                     Text("Expires: \(dateString)")
                         .talerFont(.body)
                         .accessibilityLabel(accessibilityLabel)
-//                        .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
+                        .foregroundColor(WalletColors().secondary(colorScheme, 
colorSchemeContrast))
                 }
                 .listStyle(myListStyle.style).anyView
                 .navigationTitle(navTitle)
diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift 
b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
index 4188a44..c7fbbf1 100644
--- a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
+++ b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
@@ -129,10 +129,7 @@ struct ThreeAmountsV: View {
             if !minimalistic {
                 Text("Summary")
                     .talerFont(.title3)
-                    .foregroundColor(colorSchemeContrast == .increased ? 
.primary
-                                                        : minimalistic ? 
.secondary
-                                                : colorScheme == .dark ? 
.secondary
-                                                                       : 
Color(.darkGray))
+                    .foregroundColor(WalletColors().secondary(colorScheme, 
colorSchemeContrast))
             }
         }
     }
diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift 
b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
index be71909..050bf40 100644
--- a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
+++ b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
@@ -34,6 +34,7 @@ struct TransactionSummaryV: View {
     let suspendAction: ((_ transactionId: String) async throws -> Void)?
     let resumeAction: ((_ transactionId: String) async throws -> Void)?
 
+    @Environment(\.colorScheme) private var colorScheme
     @Environment(\.colorSchemeContrast) private var colorSchemeContrast
     @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
 #if DEBUG
@@ -116,7 +117,7 @@ struct TransactionSummaryV: View {
                 Text(dateString)
                     .talerFont(.body)
                     .accessibilityLabel(accessibilityDate)
-                    .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
+                    .foregroundColor(WalletColors().secondary(colorScheme, 
colorSchemeContrast))
                     .listRowSeparator(.hidden)
                 VStack(alignment: .trailing) {
                     let majorState = common.txState.major.localizedState
@@ -243,6 +244,8 @@ struct TransactionSummaryV: View {
         let stack: CallStack
         @Binding var transaction: Transaction
         let hasDone: Bool
+        @Environment(\.colorScheme) private var colorScheme
+        @Environment(\.colorSchemeContrast) private var colorSchemeContrast
         @State private var rotationEnabled = true
 
         var body: some View {
@@ -335,7 +338,7 @@ struct TransactionSummaryV: View {
                             Text("Expires: \(dateString)")
                                 .talerFont(.body)
                                 .accessibilityLabel(accessibilityLabel)
-                            //                        
.foregroundColor(colorSchemeContrast == .increased ? .primary : .secondary)
+                                
.foregroundColor(WalletColors().secondary(colorScheme, colorSchemeContrast))
                         }
                         // TODO: isSendCoins should show QR only while not yet 
expired  - either set timer or wallet-core should do so and send a 
state-changed notification
                         if pending {

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