gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 30/204: QrButton in Actions


From: gnunet
Subject: [taler-taler-ios] 30/204: QrButton in Actions
Date: Thu, 05 Dec 2024 23:49:58 +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 bb5f7891351a8d394b54d2b3cc060f56a1e42fe7
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sun Oct 6 09:39:04 2024 +0200

    QrButton in Actions
---
 TalerWallet1/Controllers/PublicConstants.swift |  1 +
 TalerWallet1/Views/Actions/ActionsSheet.swift  | 11 +++++++++++
 TalerWallet1/Views/Main/MainView.swift         |  1 +
 3 files changed, 13 insertions(+)

diff --git a/TalerWallet1/Controllers/PublicConstants.swift 
b/TalerWallet1/Controllers/PublicConstants.swift
index a43eb00..89b3eb4 100644
--- a/TalerWallet1/Controllers/PublicConstants.swift
+++ b/TalerWallet1/Controllers/PublicConstants.swift
@@ -126,4 +126,5 @@ extension Notification.Name {
     static let RequestAction = Notification.Name("requestAction")
     static let DepositAction = Notification.Name("depositAction")
     static let WithdrawAction = Notification.Name("withdrawAction")
+    static let QrScanAction = Notification.Name("qrScanAction")
 }
diff --git a/TalerWallet1/Views/Actions/ActionsSheet.swift 
b/TalerWallet1/Views/Actions/ActionsSheet.swift
index dc4b00e..3c32599 100644
--- a/TalerWallet1/Views/Actions/ActionsSheet.swift
+++ b/TalerWallet1/Views/Actions/ActionsSheet.swift
@@ -33,6 +33,13 @@ struct ActionsSheet: View {
         return false
     }
 
+    @MainActor
+    func qrButtonTapped() {
+        dismissTop(stack.push())
+        NotificationCenter.default.post(name: .QrScanAction,
+                                        object: nil)                           
   // will trigger NavigationLink
+    }
+
     var body: some View {
         VStack {
             let width = UIScreen.screenWidth / 3
@@ -67,6 +74,10 @@ struct ActionsSheet: View {
                 .padding(.bottom, 20)
             }
 
+            QRButton(action: qrButtonTapped)
+                .lineLimit(5)
+                .buttonStyle(TalerButtonStyle(type: .bordered, narrow: true, 
aligned: .center))
+
             SendRequestV(stack: stack.push(),
                       balances: $balances,
               amountToTransfer: $amountToTransfer,   // does still have the 
wrong currency
diff --git a/TalerWallet1/Views/Main/MainView.swift 
b/TalerWallet1/Views/Main/MainView.swift
index 09a88b8..77b6d5e 100644
--- a/TalerWallet1/Views/Main/MainView.swift
+++ b/TalerWallet1/Views/Main/MainView.swift
@@ -391,6 +391,7 @@ extension MainView {
                         .onNotification(.RequestAction) { 
navModel.actionSelected = 2 }
                         .onNotification(.DepositAction) { 
navModel.actionSelected = 3 }
                         .onNotification(.WithdrawAction){ 
navModel.actionSelected = 4 }
+                        .onNotification(.QrScanAction)  { cameraAction() }
                     }.id(viewState.rootViewId)                // any change to 
rootViewId triggers popToRootView behaviour
                     .navigationViewStyle(.stack)
                     .tag(Tab.balances)

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