gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 09/19: Accessibility String for Payment Sounds


From: gnunet
Subject: [taler-taler-ios] 09/19: Accessibility String for Payment Sounds
Date: Sat, 02 Sep 2023 22:01:10 +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 845937233505f3824b8abbdec4b2d73ecc2761d1
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Aug 31 20:57:06 2023 +0200

    Accessibility String for Payment Sounds
---
 TalerWallet1/Views/Settings/SettingsItem.swift | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/TalerWallet1/Views/Settings/SettingsItem.swift 
b/TalerWallet1/Views/Settings/SettingsItem.swift
index df26904..a34f2c4 100644
--- a/TalerWallet1/Views/Settings/SettingsItem.swift
+++ b/TalerWallet1/Views/Settings/SettingsItem.swift
@@ -62,24 +62,30 @@ struct SettingsSpeaker: View {
     var description: String?
     var action: (_ value: Int) -> Void = {value in }
 
+    func imageName(_ value: Int) -> (String, String) {
+        return (value == 0) ? ("speaker.slash", String(localized:"off", 
comment: "Accessibility String for Payment Sounds Off"))
+             : (value == 1) ? ("speaker.fill", String(localized:"Taler 
Sounds", comment: "Accessibility String for Payment Sounds"))
+                            : ("speaker", String(localized:"Apple Sounds", 
comment: "Accessibility String for Payment Sounds"))
+    }
     var body: some View {
         VStack {
-            let image = (value == 0) ? "speaker.slash"
-                      : (value == 1) ? "speaker.fill"
-                                     : "speaker"
+            let image = imageName(value)
             HStack {
                 Text(name)
                     .font(.title2)
                 Text(" ")
                     .font(.largeTitle)
                 Spacer()
-                Image(systemName: image)
+                Image(systemName: image.0)
                     .font(.largeTitle)
+                    .accessibilityLabel(image.1)
                     .onTapGesture {
                         if value > 0 {
                             value = -1
+                            Controller.shared.playSound(1)
                         } else {
                             value = value + 1
+                            Controller.shared.playSound(value)
                         }
                     }
             }

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