gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 32/54: Adjust DebugView for Notch


From: gnunet
Subject: [taler-taler-ios] 32/54: Adjust DebugView for Notch
Date: Fri, 30 Jun 2023 22:34:04 +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 536564ce7d487e1490f50b5633afa75a78c7f16e
Author: Marc Stibane <marc@taler.net>
AuthorDate: Tue Jun 27 22:27:13 2023 +0200

    Adjust DebugView for Notch
---
 TalerWallet1/Controllers/DebugViewC.swift | 11 ++++++++++-
 TalerWallet1/Views/Sheets/Sheet.swift     | 14 ++++++--------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/TalerWallet1/Controllers/DebugViewC.swift 
b/TalerWallet1/Controllers/DebugViewC.swift
index 43dcc32..d5139f6 100644
--- a/TalerWallet1/Controllers/DebugViewC.swift
+++ b/TalerWallet1/Controllers/DebugViewC.swift
@@ -90,7 +90,12 @@ public let SHEET_RCV_P2P_ACCEPT = SHEET_RCV_P2P_TOS + 1      
       // 172 Recei
 
 //public let SHEET_REFUND =
 
-
+extension UIDevice {
+    var hasNotch: Bool {
+        let bottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
+        return bottom > 0
+    }
+}
 // MARK: -
 struct DebugViewV: View {
     private let symLog = SymLogV(0)
@@ -106,6 +111,10 @@ struct DebugViewV: View {
         HStack {
             Spacer()
             Spacer()
+            if UIDevice.current.hasNotch {
+                Spacer()
+                Spacer()
+            }
             Text(viewIDString)
                 .font(.caption2)
                 .foregroundColor(.red)
diff --git a/TalerWallet1/Views/Sheets/Sheet.swift 
b/TalerWallet1/Views/Sheets/Sheet.swift
index e2e8a9a..43b1895 100644
--- a/TalerWallet1/Views/Sheets/Sheet.swift
+++ b/TalerWallet1/Views/Sheets/Sheet.swift
@@ -4,6 +4,7 @@
  */
 import SwiftUI
 import SymLog
+import os.log
 
 struct Sheet: View {
     private let symLog = SymLogV()
@@ -12,15 +13,18 @@ struct Sheet: View {
 
     var sheetView: AnyView
 
+    let logger = Logger (subsystem: "net.taler.gnu", category: "Sheet")
+
     var cancelButton: some View {
         Button("Cancel") {
-            print(dismiss)  // TODO: delete this line
+            logger.log("Cancel")
             dismissTop()
         }
     }
 
     var body: some View {
-        let idString = debugViewC.sheetID > 0 ? String(debugViewC.sheetID) : ""
+        let idString = debugViewC.sheetID > 0 ? String(debugViewC.sheetID)
+                                              : ""      // show nothing if 0
         NavigationView {
             sheetView
                 .navigationBarItems(leading: cancelButton)
@@ -36,9 +40,3 @@ struct Sheet: View {
         }
     }
 }
-// MARK: -
-//struct Sheet_Previews: PreviewProvider {
-//    static var previews: some View {
-//
-//    }
-//}

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