gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 118/204: demoHints


From: gnunet
Subject: [taler-taler-ios] 118/204: demoHints
Date: Thu, 05 Dec 2024 23:51:26 +0100

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 348a090cb7505d688f11e1feb7eb36b9a9cf2400
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sat Nov 9 10:47:56 2024 +0100

    demoHints
---
 TalerWallet1/Views/Actions/ActionsSheet.swift      | 18 +++++++-------
 .../Views/Settings/Exchange/ExchangeRowView.swift  |  4 +--
 .../Settings/Exchange/ExchangeSectionView.swift    | 29 ++++++++++++----------
 3 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/TalerWallet1/Views/Actions/ActionsSheet.swift 
b/TalerWallet1/Views/Actions/ActionsSheet.swift
index 1a51a32..566d6a0 100644
--- a/TalerWallet1/Views/Actions/ActionsSheet.swift
+++ b/TalerWallet1/Views/Actions/ActionsSheet.swift
@@ -19,7 +19,7 @@ struct ActionsSheet: View {
     @Binding var qrButtonTapped: Bool
 
     @AppStorage("minimalistic") var minimalistic: Bool = false
-    @AppStorage("hideSpendingHint") var hideSpendingHint: Bool = false
+    @AppStorage("demoHints") var demoHints: Bool = true
     @EnvironmentObject private var controller: Controller
 
     private var hasKudos: Bool {
@@ -50,7 +50,7 @@ struct ActionsSheet: View {
                 .padding(.top, 5)
                 .padding(.bottom, 10)
 
-            if hasKudos && !hideSpendingHint {
+            if hasKudos && demoHints {
                 Text(minimalistic ? "Spend your \(DEMOCURRENCY) in the Demo 
shop"
                                   : "You can spend your \(DEMOCURRENCY) in the 
Demo shop, or send them to another wallet.")
                     .talerFont(.body)
@@ -59,7 +59,7 @@ struct ActionsSheet: View {
 
                 let title = String(localized: "LinkTitle_DEMOSHOP", 
defaultValue: "Spend demo money")
                 let shopAction = {
-                    hideSpendingHint = true
+//                    demoHints += 1
                     UIApplication.shared.open(URL(string:DEMOSHOP)!, options: 
[:])
                     dismissTop(stack.push())
                 }
@@ -127,7 +127,7 @@ struct DualHeightSheet: View {
 
             .onChange(of: qrButtonTapped2) { tapped2 in
                 if tapped2 {
-                    logger.log("❗️the user tapped")
+//                    logger.trace("❗️the user tapped")
                     qrButtonTapped = true           // tell our caller
                     withAnimation(Animation.easeIn(duration: 0.6)) {
                         // animate this sheet to full height
@@ -137,13 +137,13 @@ struct DualHeightSheet: View {
             }
             .onChange(of: qrButtonTapped) { tapped in
                 if !tapped {
-                    logger.log("❗️dismissed, cleanup")
+                    logger.trace("❗️dismissed, cleanup")
                     sheetHeight = innerHeight
                     qrButtonTapped2 = false
                 }
             }
             .onChange(of: innerHeight) { newHeight in
-                logger.log("onChange❗️set sheetHeight: \(sheetHeight) -> 
\(newHeight)❗️")
+                logger.trace("onChange❗️set sheetHeight: \(sheetHeight) -> 
\(newHeight)❗️")
 //            withAnimation {
                 sheetHeight = newHeight
                 selectedDetent = .height(sheetHeight)       // will update 
detents in .onChange(:)
@@ -152,16 +152,16 @@ struct DualHeightSheet: View {
             .presentationDetents(detents, selection: $selectedDetent)
             .onChange(of: selectedDetent) { newValue in
                 if newValue == .large {
-                    logger.log("onChange❗️selectedDetent = .large)")
+                    logger.trace("onChange❗️selectedDetent = .large)")
                     updateDetentsWithDelay()
                     qrButtonTapped = true           // tell our caller
                 } else {
-                    logger.log("onChange❗️selectedDetent = 
.height(\(sheetHeight))")
+                    logger.trace("onChange❗️selectedDetent = 
.height(\(sheetHeight))")
                     detents = [.large, .height(sheetHeight)]
                 }
             }
             .task {
-                logger.log("task❗️selectedDetent = .height(\(sheetHeight))")
+                logger.trace("task❗️selectedDetent = .height(\(sheetHeight))")
                 selectedDetent = .height(sheetHeight)       // will update 
detents in .onChange(:)
             }
 //            .animation(.spring(), value: selectedDetent)
diff --git a/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift 
b/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift
index bc33ee1..2050196 100644
--- a/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift
+++ b/TalerWallet1/Views/Settings/Exchange/ExchangeRowView.swift
@@ -12,7 +12,6 @@ import SymLog
 struct ExchangeRowView: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
-    @Binding var currencyInfo: CurrencyInfo              // this is the 
currency to be used
     let exchange: Exchange
 
     @Environment(\.sizeCategory) var sizeCategory
@@ -54,7 +53,7 @@ fileprivate struct ExchangeRow_Previews: PreviewProvider {
         @State private var amountToPreview = Amount(currency: LONGCURRENCY, 
cent: 1234)
         @State private var depositIBAN = "DE1234567890"
         @State private var accountHolder = "Marc Stibane"
-        @State private var currencyInfoL: CurrencyInfo = 
CurrencyInfo.zero(LONGCURRENCY)
+//        @State private var previewL: CurrencyInfo = 
CurrencyInfo.zero(LONGCURRENCY)
 
 //    let amount = Amount(currency: LONGCURRENCY, cent: 123456)
         var body: some View {
@@ -76,7 +75,6 @@ fileprivate struct ExchangeRow_Previews: PreviewProvider {
                                 exchangeUpdateStatus: .ready,
                                ageRestrictionOptions: [])
             ExchangeRowView(stack: CallStack("Preview"),
-                     currencyInfo: $currencyInfoL,
                          exchange: exchange1)
         }
     }
diff --git a/TalerWallet1/Views/Settings/Exchange/ExchangeSectionView.swift 
b/TalerWallet1/Views/Settings/Exchange/ExchangeSectionView.swift
index a431b94..3c5d8b5 100755
--- a/TalerWallet1/Views/Settings/Exchange/ExchangeSectionView.swift
+++ b/TalerWallet1/Views/Settings/Exchange/ExchangeSectionView.swift
@@ -19,7 +19,7 @@ struct ExchangeSectionView: View {
     @EnvironmentObject private var model: WalletModel
     @EnvironmentObject private var controller: Controller
     @AppStorage("minimalistic") var minimalistic: Bool = false
-    @AppStorage("hideSpendingHint") var hideSpendingHint: Bool = false
+    @AppStorage("demoHints") var demoHints: Bool = true
 
     @State private var exchanges: [Exchange] = []
     @State private var shouldReloadBalances: Int = 0
@@ -72,7 +72,7 @@ struct ExchangeSectionView: View {
                 didDelete = true             // change button text
                 NotificationCenter.default.post(name: .ExchangeDeleted, 
object: nil, userInfo: nil)
                 NotificationCenter.default.post(name: .BalanceChange, object: 
nil, userInfo: nil)
-                hideSpendingHint = false
+                demoHints = true
             } else {
                 purge = true
                 showAlert = true
@@ -89,28 +89,31 @@ struct ExchangeSectionView: View {
 #endif
         let scopeInfo = balance.scopeInfo
         let currency = scopeInfo.currency
-//        let currencyInfo = controller.info(for: currency, 
controller.currencyTicker)
         Section {
             ForEach(exchanges) { exchange in
                 ExchangeRowView(stack: stack.push(),
-                         currencyInfo: $currencyInfo,
                              exchange: exchange)
                 .listRowSeparator(.hidden)
             }
             if DEMOCURRENCY == currency {
+                SettingsToggle(name: String(localized: "Demo Hints"), value: 
$demoHints, id1: "demoHints",
+                               description: minimalistic ? nil : 
String(localized: "Show hints for demo money"))
+                .listRowSeparator(.hidden)
                 let bankingHint = String(localized: "Since the demo bank 
supports the Taler integration, you can start a withdrawal directly on the")
                 let linkTitle = String(localized: "LinkTitle_DEMOBANK", 
defaultValue: "Demo Bank Website")
-                VStack {
-                    if !minimalistic {
-                        Text(bankingHint)
+                if demoHints {
+                    VStack {
+                        if !minimalistic {
+                            Text(bankingHint)
+                        }
+                        Link(linkTitle, destination: URL(string: DEMOBANK)!)
+                            .buttonStyle(TalerButtonStyle(type: .bordered, 
narrow: false, aligned: .center))
                     }
-                    Link(linkTitle, destination: URL(string: DEMOBANK)!)
-                        .buttonStyle(TalerButtonStyle(type: .bordered, narrow: 
false, aligned: .center))
+                    .accessibilityElement(children: .combine)
+                    .accessibilityLabel(bankingHint + " " + linkTitle)
+                    .padding(.top)
+                    .listRowSeparator(.hidden)
                 }
-                .accessibilityElement(children: .combine)
-                .accessibilityLabel(bankingHint + " " + linkTitle)
-                .padding(.top)
-                .listRowSeparator(.hidden)
             }
 
             let buttonTitle = String(localized: "Exchange.Delete", 
defaultValue: "Delete payment service", comment: "Action button")

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