summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Stibane <marc@taler.net>2023-11-06 19:59:36 +0100
committerMarc Stibane <marc@taler.net>2023-11-06 19:59:36 +0100
commit0fcd73c0d2a2788138e92b18ae2fc128620e3d6b (patch)
tree4499bc815f66c8a2a160066c05e177ce2c6181d9
parent03bb845429ae4b241e97a56fdc7394e02d35324d (diff)
downloadtaler-ios-0fcd73c0d2a2788138e92b18ae2fc128620e3d6b.tar.gz
taler-ios-0fcd73c0d2a2788138e92b18ae2fc128620e3d6b.tar.bz2
taler-ios-0fcd73c0d2a2788138e92b18ae2fc128620e3d6b.zip
Accessibility
-rw-r--r--TalerWallet1/Views/Balances/BalanceRowView.swift2
-rw-r--r--TalerWallet1/Views/HelperViews/SelectDays.swift7
-rw-r--r--TalerWallet1/Views/HelperViews/TextFieldAlert.swift3
-rw-r--r--TalerWallet1/Views/Main/WalletEmptyView.swift1
-rw-r--r--TalerWallet1/Views/Peer2peer/SendPurpose.swift1
-rw-r--r--TalerWallet1/Views/Settings/AboutView.swift2
-rw-r--r--TalerWallet1/Views/Settings/SettingsItem.swift12
-rw-r--r--TalerWallet1/Views/Sheets/Sheet.swift2
-rw-r--r--TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift6
-rw-r--r--TalerWallet1/Views/Transactions/ManualDetailsV.swift1
-rw-r--r--TalerWallet1/Views/Transactions/ThreeAmountsV.swift4
-rw-r--r--TalerWallet1/Views/Transactions/TransactionDetailView.swift19
-rw-r--r--TalerWallet1/Views/Transactions/TransactionRowView.swift2
-rw-r--r--TalerWallet1/Views/Transactions/TransactionsListView.swift1
14 files changed, 37 insertions, 26 deletions
diff --git a/TalerWallet1/Views/Balances/BalanceRowView.swift b/TalerWallet1/Views/Balances/BalanceRowView.swift
index b32d993..a9b4b3a 100644
--- a/TalerWallet1/Views/Balances/BalanceRowView.swift
+++ b/TalerWallet1/Views/Balances/BalanceRowView.swift
@@ -34,7 +34,7 @@ struct BalanceButton: View {
} .disabled(false)
.buttonStyle(TalerButtonStyle(type: iconOnly ? .plain : .balance, aligned: .trailing))
.accessibilityElement(children: .combine)
- .accessibilityHint("will go to main transactions list")
+ .accessibilityHint("Will go to main transactions list.")
// .accessibilityLabel(balanceTitleStr + " " + amountStr) // TODO: CurrencyFormatter!
}
}
diff --git a/TalerWallet1/Views/HelperViews/SelectDays.swift b/TalerWallet1/Views/HelperViews/SelectDays.swift
index 9715a7e..5c3c998 100644
--- a/TalerWallet1/Views/HelperViews/SelectDays.swift
+++ b/TalerWallet1/Views/HelperViews/SelectDays.swift
@@ -41,6 +41,7 @@ struct SelectDays: View {
Text("Expires in:")
.accessibilityLabel("Choose the expiration duration")
.accessibilityAddTraits(.isHeader)
+ .accessibilityRemoveTraits(.isStaticText)
.accessibilityFont(.title3)
HStack {
Button(action: oneDayAction) {
@@ -50,7 +51,7 @@ struct SelectDays: View {
Text("\(ONEDAY) Day", comment: "1 Day, might get plural (e.g. 2..3 Days), 4 letters max., abbreviate if longer") // TODO: Plural
}
}.buttonStyle(TalerButtonStyle(type: (selected == ONEDAY) ? .prominent : .bordered, dimmed: true))
- .accessibilityHint((selected == ONEDAY) ? selectedStr : emptyStr)
+ .accessibilityValue((selected == ONEDAY) ? selectedStr : emptyStr)
.disabled(!isEnabled)
Button(action: sevenDayAction) {
@@ -60,7 +61,7 @@ struct SelectDays: View {
Text("\(SEVENDAYS) Days", comment: "7 Days, always plural (3..9), 4 letters max., abbreviate if longer")
}
}.buttonStyle(TalerButtonStyle(type: (selected == SEVENDAYS) ? .prominent : .bordered, dimmed: true))
- .accessibilityHint((selected == SEVENDAYS) ? selectedStr : emptyStr)
+ .accessibilityValue((selected == SEVENDAYS) ? selectedStr : emptyStr)
.disabled(!isEnabled || maxExpiration < SEVENDAYS)
Button(action: thirtyDayAction) {
@@ -70,7 +71,7 @@ struct SelectDays: View {
Text("\(THIRTYDAYS) Days", comment: "30 Days, always plural (10..30), 4 letters max., abbreviate if longer")
}
}.buttonStyle(TalerButtonStyle(type: (selected == THIRTYDAYS) ? .prominent : .bordered, dimmed: true))
- .accessibilityHint((selected == THIRTYDAYS) ? selectedStr : emptyStr)
+ .accessibilityValue((selected == THIRTYDAYS) ? selectedStr : emptyStr)
.disabled(!isEnabled || maxExpiration < THIRTYDAYS)
} // 3 buttons
}
diff --git a/TalerWallet1/Views/HelperViews/TextFieldAlert.swift b/TalerWallet1/Views/HelperViews/TextFieldAlert.swift
index d5639a4..c29bba3 100644
--- a/TalerWallet1/Views/HelperViews/TextFieldAlert.swift
+++ b/TalerWallet1/Views/HelperViews/TextFieldAlert.swift
@@ -15,11 +15,13 @@ struct TextFieldAlert: ViewModifier {
ZStack(alignment: .center) {
content
.disabled(isPresented)
+ .accessibilityElement(children: isPresented ? .ignore : .contain)
if isPresented {
VStack {
Text(title)
.accessibilityFont(.headline)
.accessibilityAddTraits(.isHeader)
+ .accessibilityRemoveTraits(.isStaticText)
.padding()
TextField(placeholder, text: $text).textFieldStyle(.roundedBorder).padding()
Divider()
@@ -41,6 +43,7 @@ struct TextFieldAlert: ViewModifier {
Spacer()
}
}
+ .accessibility(addTraits: .isModal)
.background(.background)
.frame(width: 300, height: 200)
.cornerRadius(20)
diff --git a/TalerWallet1/Views/Main/WalletEmptyView.swift b/TalerWallet1/Views/Main/WalletEmptyView.swift
index 00a9565..f38b657 100644
--- a/TalerWallet1/Views/Main/WalletEmptyView.swift
+++ b/TalerWallet1/Views/Main/WalletEmptyView.swift
@@ -23,6 +23,7 @@ struct WalletEmptyView: View {
Link(title, destination: URL(string: DEMOBANK)!)
.buttonStyle(TalerButtonStyle(type: .prominent, narrow: false, aligned: .center))
.padding(.vertical)
+ .accessibilityHint("Will go to the demo bank website.")
}
Section {
Text("Just register a test account in the demo bank, then withdraw some electronic cash.")
diff --git a/TalerWallet1/Views/Peer2peer/SendPurpose.swift b/TalerWallet1/Views/Peer2peer/SendPurpose.swift
index 3fc658c..e84e3df 100644
--- a/TalerWallet1/Views/Peer2peer/SendPurpose.swift
+++ b/TalerWallet1/Views/Peer2peer/SendPurpose.swift
@@ -73,6 +73,7 @@ struct SendPurpose: View {
Spacer()
Text(verbatim: "\(summary.count)/100")
.accessibilityFont(.body)
+ .accessibilityValue("\(summary.count) characters of 100")
} // maximum 100 characters
// TODO: compute max Expiration day from peerPushCheck to disable 30 (and even 7)
diff --git a/TalerWallet1/Views/Settings/AboutView.swift b/TalerWallet1/Views/Settings/AboutView.swift
index 8fcce24..2e460bf 100644
--- a/TalerWallet1/Views/Settings/AboutView.swift
+++ b/TalerWallet1/Views/Settings/AboutView.swift
@@ -35,7 +35,7 @@ struct AboutView: View {
HStack {
Spacer()
RotatingTaler(size: 100, rotationEnabled: $rotationEnabled)
- .accessibilityHint("will go to the taler.net website when long-pressed")
+ .accessibilityHint("Will go to the taler.net website when long-pressed.")
.onTapGesture(count: 2) {
rotationEnabled.toggle()
}
diff --git a/TalerWallet1/Views/Settings/SettingsItem.swift b/TalerWallet1/Views/Settings/SettingsItem.swift
index 3368ec4..61220e7 100644
--- a/TalerWallet1/Views/Settings/SettingsItem.swift
+++ b/TalerWallet1/Views/Settings/SettingsItem.swift
@@ -133,14 +133,13 @@ struct SettingsSpeaker: View {
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"))
+ return (value == 0) ? ("speaker.slash", String(localized:"Off", comment: "Accessibility String for Payment Sounds."))
+ : (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 {
let image = imageName(value)
- let accLabel = name + ", " + image.1
- let accHint = description ?? ""
+ let accHint = description ?? "" // avoid automatic translation of "" in accessibilityHint
VStack {
HStack {
@@ -170,7 +169,8 @@ struct SettingsSpeaker: View {
}
}
.accessibilityElement(children: .combine)
- .accessibilityLabel(accLabel)
+ .accessibilityLabel(name)
+ .accessibility(value: Text(image.1))
.accessibilityHint(accHint)
.padding([.bottom], 4)
}
diff --git a/TalerWallet1/Views/Sheets/Sheet.swift b/TalerWallet1/Views/Sheets/Sheet.swift
index b1f0cda..371d110 100644
--- a/TalerWallet1/Views/Sheets/Sheet.swift
+++ b/TalerWallet1/Views/Sheets/Sheet.swift
@@ -42,6 +42,8 @@ struct Sheet: View {
.monospacedDigit()
.edgesIgnoringSafeArea(.top)
.id("sheetID")
+ .accessibilityLabel(Text("Sheet.ID.", comment: "AccessibilityLabel"))
+ .accessibilityValue(idString)
}
}
}
diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
index 9b0f775..2fb147e 100644
--- a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
+++ b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawURIView.swift
@@ -45,8 +45,10 @@ struct WithdrawURIView: View {
large: false, pending: false, incoming: true,
baseURL: exchangeBaseUrl)
let someCoins = SomeCoins(details: withdrawalAmountDetails)
- QuiteSomeCoins(someCoins: someCoins, shouldShowFee: false,
- currency: raw.currencyStr, amountEffective: effective)
+ QuiteSomeCoins(someCoins: someCoins,
+ shouldShowFee: true, // TODO: set to false if we never charge withdrawal fees
+ currency: raw.currencyStr,
+ amountEffective: effective)
}
.listStyle(myListStyle.style).anyView
.navigationTitle(navTitle)
diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
index 2b35934..3adceaf 100644
--- a/TalerWallet1/Views/Transactions/ManualDetailsV.swift
+++ b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
@@ -47,6 +47,7 @@ struct ManualDetailsV: View {
HStack {
Text(iban)
.monospacedDigit()
+ .accessibilityLabel("IBAN of the exchange")
Spacer()
CopyButton(textToCopy: iban, vertical: true)
.accessibilityLabel("Copy the IBAN")
diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
index 78fc1c1..2579b94 100644
--- a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
+++ b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
@@ -65,6 +65,7 @@ struct ThreeAmountsV: View {
color: labelColor,
large: large)
.padding(.bottom, 4)
+ .accessibilityElement(children: .combine)
if let fee {
AmountView(title: iconOnly ? String(localized: "Fee:")
: String(localized: "Exchange fee:"),
@@ -72,12 +73,14 @@ struct ThreeAmountsV: View {
color: labelColor,
large: false)
.padding(.bottom, 4)
+ .accessibilityElement(children: .combine)
}
if let bottomAmount {
AmountView(title: iconOnly ? bottomAbbrev : bottomTitle,
value: bottomAmount.readableDescription,
color: foreColor,
large: large)
+ .accessibilityElement(children: .combine)
}
if let baseURL {
VStack(alignment: .leading) {
@@ -96,6 +99,7 @@ struct ThreeAmountsV: View {
.padding(.top, 4)
.frame(maxWidth: .infinity, alignment: .leading)
.listRowSeparator(.hidden)
+ .accessibilityElement(children: .combine)
}
} header: {
if !iconOnly {
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
index ce99a9d..bae70f2 100644
--- a/TalerWallet1/Views/Transactions/TransactionDetailView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -47,14 +47,9 @@ struct TransactionDetailView: View {
func accessibilityDate(_ date: Date?) -> String? {
if let date {
- let dateString = DateFormatter.localizedString(from: date,
- dateStyle: .short,
- timeStyle: .none)
- let hourComponents = Calendar.current.dateComponents([.hour, .minute], from: date)
- if let timeString = DateComponentsFormatter.localizedString(from: hourComponents, unitsStyle: .spellOut) {
- return dateString + ", " + timeString
- }
- return dateString
+ let formatted = date.formatted(date: .long, time: .shortened)
+// print(formatted)
+ return formatted
}
return nil
}
@@ -68,8 +63,7 @@ struct TransactionDetailView: View {
let pending = transaction.isPending
let locale = TalerDater.shared.locale
let (dateString, date) = TalerDater.dateString(from: common.timestamp)
- let accessibilityDate = accessibilityDate(date) ??
- dateString
+ let accessibilityDate = accessibilityDate(date) ?? dateString
let navTitle2 = transaction.localizedType
Group {
List {
@@ -272,8 +266,9 @@ struct TransactionDetailView: View {
.padding(.top)
}
}
- ThreeAmountsSheet(common: common, topAbbrev: transaction.localizedType,
- topTitle: transaction.localizedType,
+ let colon = ":"
+ ThreeAmountsSheet(common: common, topAbbrev: transaction.localizedType + colon,
+ topTitle: transaction.localizedType + colon,
baseURL: details.exchangeBaseUrl, large: false)
} // switch
} // Group
diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift b/TalerWallet1/Views/Transactions/TransactionRowView.swift
index 9b6f897..f51e1c6 100644
--- a/TalerWallet1/Views/Transactions/TransactionRowView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionRowView.swift
@@ -97,7 +97,7 @@ struct TransactionRowView: View {
centerBottom: dateString, isHorizontal: true, incoming: incoming, foreColor: foreColor)
}
.accessibilityElement(children: .combine)
- .accessibilityHint("will go to detail view")
+ .accessibilityHint("Will go to detail view.")
}
}
}
diff --git a/TalerWallet1/Views/Transactions/TransactionsListView.swift b/TalerWallet1/Views/Transactions/TransactionsListView.swift
index 6dc1a4b..7160969 100644
--- a/TalerWallet1/Views/Transactions/TransactionsListView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionsListView.swift
@@ -62,6 +62,7 @@ struct TransactionsListView: View {
}
} // ScrollView
.navigationTitle(navTitle)
+ .accessibilityHint(Text("Transaction list"))
.task {
symLog.log(".task ")
await reloadAllAction(stack.push())