[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 01/03: improve a11y
From: |
gnunet |
Subject: |
[taler-taler-ios] 01/03: improve a11y |
Date: |
Fri, 12 Apr 2024 23:35:26 +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 4eb43460a2a98d524a1270ac5768902559544fac
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Apr 12 22:28:13 2024 +0200
improve a11y
---
TalerWallet1/Helper/WalletColors.swift | 4 +++
.../Views/Transactions/ManualDetailsV.swift | 36 ++++++++++++++--------
2 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/TalerWallet1/Helper/WalletColors.swift
b/TalerWallet1/Helper/WalletColors.swift
index a351bd0..4871978 100644
--- a/TalerWallet1/Helper/WalletColors.swift
+++ b/TalerWallet1/Helper/WalletColors.swift
@@ -62,6 +62,10 @@ public struct WalletColors {
: (scheme == .dark ? gray4 : gray5)
}
+ var pickerBackground: Color {
+ gray7
+ }
+
var fieldForeground: Color { // text color
Color.primary
}
diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift
b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
index 5adcb9c..7c06807 100644
--- a/TalerWallet1/Views/Transactions/ManualDetailsV.swift
+++ b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
@@ -26,7 +26,6 @@ struct SegmentControl: View {
.cornerRadius(6.0)
.padding(4)
.frame(width: geo.size.width / CGFloat(count))
- .shadow(color: .black.opacity(0.1), radius: 2, x: 1, y: 1)
.offset(x: geo.size.width / CGFloat(count) *
CGFloat(selectedAccount), y: 0)
}
.frame(height: frameHeight)
@@ -35,16 +34,22 @@ struct SegmentControl: View {
ForEach((0..<count), id: \.self) { index in
let detail = accountDetails[index]
let amount = detail.transferAmount
+ let bankName = detail.bankLabel
+ let amountStr = amount?.readableDescription ?? ""
+ let a11yLabel = bankName != nil ? (bankName! + amountStr)
: amountStr
VStack(spacing: 6) {
- let amountStr = amount?.readableDescription ?? ""
Text(amountStr)
.talerFont(.title3)
- let bankName = detail.bankLabel ?? ("BankName " +
String(index))
- Text(bankName)
- .talerFont(.subheadline)
+ if let bankName {
+ Text(bankName)
+ .talerFont(.subheadline)
+ }
}
+ .accessibilityElement(children: .combine)
+ .accessibilityLabel(a11yLabel)
+ .accessibilityAddTraits(.isButton)
+ .accessibilityAddTraits(index == selectedAccount ?
.isSelected : [])
.frame(maxWidth: .infinity)
- .background(.gray.opacity(0.00001))
.onTapGesture {
withAnimation(.easeInOut(duration: 0.150)) {
selectedAccount = index
@@ -61,7 +66,7 @@ struct SegmentControl: View {
}
.background(
RoundedRectangle(cornerRadius: 6.0)
- .fill(WalletColors().fieldBackground)
+ .fill(WalletColors().sideBackground)
)
}
}
@@ -79,9 +84,13 @@ struct AccountPicker: View {
let detail = accountDetails[index]
if let amount = detail.transferAmount {
let amountStr = amount.readableDescription
- let bankName = detail.bankLabel ?? ("BankName " +
String(index))
- Text(bankName + ": " + amountStr)
- .tag(index)
+ if let bankName = detail.bankLabel {
+ Text(bankName + ": " + amountStr)
+ .tag(index)
+ } else {
+ Text(amountStr)
+ .tag(index)
+ }
}
})
})
@@ -175,8 +184,11 @@ struct ManualDetailsV: View {
}
} else if let amount = account.transferAmount {
let amountStr = amount.readableDescription
- let bankName = account.bankLabel ?? "Unknown bank"
- Text(bankName + ": " + amountStr)
+ if let bankName = account.bankLabel {
+ Text(bankName + ": " + amountStr)
+ } else {
+ Text(amountStr)
+ }
}
let payto = account.paytoUri
let payURL = URL(string: payto)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.