gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 01/06: Debugging


From: gnunet
Subject: [taler-taler-ios] 01/06: Debugging
Date: Tue, 20 Feb 2024 19:19:44 +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 03de05ba02eaac5575dbd6c74ddc656dfbb73c94
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Feb 16 06:12:14 2024 +0100

    Debugging
---
 TalerWallet1/Views/Settings/SettingsView.swift     | 28 +++++-----
 .../Views/Transactions/TransactionRowView.swift    | 61 +++++++++++++++++-----
 2 files changed, 63 insertions(+), 26 deletions(-)

diff --git a/TalerWallet1/Views/Settings/SettingsView.swift 
b/TalerWallet1/Views/Settings/SettingsView.swift
index 28e82eb..8e2ba06 100644
--- a/TalerWallet1/Views/Settings/SettingsView.swift
+++ b/TalerWallet1/Views/Settings/SettingsView.swift
@@ -98,16 +98,10 @@ struct SettingsView: View {
                     SettingsItem(name: aboutStr, id1: "about",
                           description: hideDescriptions ? nil : 
String(localized: "More info about this app...")) {}
                 }
-#if DEBUG
-                if showDevelopItems {
-                    Text("https://bank.taler.grothoff.org/";)
-                    Text("https://bank.taler.fdold.eu/";)
-                    Text("https://bank.head.taler.net/";)
-                    Text("https://bank.test.taler.net/";)
-                    Text("https://bank.demo.taler.net/";)
-                    Text("https://bank.taler.ar/";)
+                SettingsToggle(name: String(localized: "Minimalistic"), value: 
$minimalistic, id1: "minimal",
+                               description: hideDescriptions ? nil : 
String(localized: "Omit text where possible")) {
+                    hideDescriptions = minimalistic //withAnimation { 
hideDescriptions = minimalistic }
                 }
-#endif
                 if controller.hapticCapability.supportsHaptics {
                     SettingsToggle(name: String(localized: "Haptics"), value: 
$useHaptics, id1: "haptics",
                             description: hideDescriptions ? nil : 
String(localized: "Vibration Feedback"))
@@ -129,21 +123,27 @@ struct SettingsView: View {
 //                               description: hideDescriptions ? nil : 
String(localized: "If you don't want to set it globally in Settings.app"))
 //                .id("increaseContrast")
                 SettingsToggle(name: String(localized: "Show Warnings"), 
value: $shouldShowWarning, id1: "warnings",
-                               description: hideDescriptions ? nil : 
String(localized: "For Delete, Fail & Abort buttons"))
+                        description: hideDescriptions ? nil : 
String(localized: "For Delete, Fail & Abort buttons"))
                 .id("showWarnings")
 //                SettingsFont(title: String(localized: "Font:"), value: 
talerFontIndex, action: redraw)
 //                    .id("font")
                 SettingsStyle(title: String(localized: "Liststyle:"), 
myListStyle: $myListStyle)
                     .id("liststyle")
-                SettingsToggle(name: String(localized: "Minimalistic"), value: 
$minimalistic, id1: "minimal",
-                        description: hideDescriptions ? nil : 
String(localized: "Omit text where possible")) {
-                    hideDescriptions = minimalistic //withAnimation { 
hideDescriptions = minimalistic }
-                }
                 if diagnosticModeEnabled {
                     SettingsToggle(name: String("Developer Mode"), value: 
$developerMode, id1: "devMode",
                             description: hideDescriptions ? nil : String("More 
information intended for debugging")) {
                         withAnimation(Animation.linear.delay(0.8)) { 
showDevelopItems = developerMode }
                     }
+#if DEBUG
+                    if showDevelopItems {
+                        Text("https://bank.taler.grothoff.org/";)
+                        Text("https://bank.taler.fdold.eu/";)
+                        Text("https://bank.head.taler.net/";)
+                        Text("https://bank.test.taler.net/";)
+                        Text("https://bank.demo.taler.net/";)
+                        Text("https://bank.taler.ar/";)
+                    }
+#endif
                     if showDevelopItems {  // show or hide the following items
                         SettingsItem(name: String("Withdraw \(DEMOCURRENCY)"), 
id1: "demo1with",
                               description: hideDescriptions ? nil : 
String("Get money for testing")) {
diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift 
b/TalerWallet1/Views/Transactions/TransactionRowView.swift
index 388df60..dea1331 100644
--- a/TalerWallet1/Views/Transactions/TransactionRowView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionRowView.swift
@@ -95,6 +95,14 @@ struct TransactionRowView: View {
             .foregroundColor(textColor)
             .talerFont(.callout)
 
+#if DEBUG
+        let debug = false
+        let red = debug ? Color.red : Color.clear
+        let green = debug ? Color.green : Color.clear
+        let blue = debug ? Color.blue : Color.clear
+        let orange = debug ? Color.orange : Color.clear
+#endif
+
         let layout1 = HStack(spacing: 0) {
             HStack(spacing: -4) {
                 iconBadge
@@ -112,13 +120,22 @@ struct TransactionRowView: View {
             centerTop
             HStack(spacing: 8) {
                 HStack(spacing: 0) {
-                    iconBadge//.border(.blue)
+                    iconBadge
+#if DEBUG
+                        .border(blue)
+#endif
                     Spacer(minLength: 0)
                     centerBottom
                     Spacer(minLength: 2)
-                }//.border(.green)
-                amountV//.border(.red)
-            }//.border(.orange)
+                }
+#if DEBUG
+                    .border(green)
+#endif
+                amountV
+#if DEBUG
+                    .border(red)
+#endif
+            }
         }
 
         let layout3 = VStack(spacing: 0) {
@@ -137,21 +154,41 @@ struct TransactionRowView: View {
         let layout4 = VStack(spacing: 0) {
             centerTop
             HStack(spacing: -4) {
-                iconBadge//.border(.green)
-                Spacer(minLength: 2
-                )
-                amountV//.border(.green)
-            }//.border(.orange)
+                iconBadge
+#if DEBUG
+                    .border(green)
+#endif
+                Spacer(minLength: 2)
+                amountV
+#if DEBUG
+                    .border(green)
+#endif
+            }
+#if DEBUG
+                .border(orange)
+#endif
             centerBottom
         }
 
         Group {
             if #available(iOS 16.0, *) {
                 ViewThatFits(in: .horizontal) {
-                    layout1//.border(.green)
+                    layout1
+#if DEBUG
+                        .border(green)
+#endif
                     layout2
-                    layout3//.border(.red)
-                    layout4//.border(.blue)
+#if DEBUG
+                        .border(orange)
+#endif
+                    layout3
+#if DEBUG
+                        .border(red)
+#endif
+                    layout4
+#if DEBUG
+                        .border(blue)
+#endif
                 }
             } else { layout4 } // view for iOS 15
         }

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