From 68795c63d12c4d0db18d7dbf90c50076a703d7b8 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 28 Sep 2024 10:55:02 -0500 Subject: [PATCH] feat: more accessibility --- .../Resources/Localizable.xcstrings | 15 +++++++++++++++ BDKSwiftExampleWallet/View/OnboardingView.swift | 1 + .../View/Send/BuildTransactionView.swift | 1 + BDKSwiftExampleWallet/View/Send/FeeView.swift | 5 +++++ BDKSwiftExampleWallet/View/WalletView.swift | 3 +++ 5 files changed, 25 insertions(+) diff --git a/BDKSwiftExampleWallet/Resources/Localizable.xcstrings b/BDKSwiftExampleWallet/Resources/Localizable.xcstrings index ae10762b..44dbd307 100644 --- a/BDKSwiftExampleWallet/Resources/Localizable.xcstrings +++ b/BDKSwiftExampleWallet/Resources/Localizable.xcstrings @@ -132,6 +132,9 @@ } } } + }, + "%lld satoshis per vbyte" : { + }, "%lld Transaction%@" : { "localizations" : { @@ -251,6 +254,9 @@ } } } + }, + "Bitcoin Balance" : { + }, "Block %@" : { "localizations" : { @@ -566,6 +572,9 @@ } } } + }, + "Select Bitcoin Network" : { + }, "Select Fee" : { "localizations" : { @@ -576,6 +585,9 @@ } } } + }, + "Select Transaction Fee" : { + }, "Send" : { "localizations" : { @@ -586,6 +598,9 @@ } } } + }, + "Send Transaction" : { + }, "Settings Error" : { "localizations" : { diff --git a/BDKSwiftExampleWallet/View/OnboardingView.swift b/BDKSwiftExampleWallet/View/OnboardingView.swift index 8e97ca82..db3b6058 100644 --- a/BDKSwiftExampleWallet/View/OnboardingView.swift +++ b/BDKSwiftExampleWallet/View/OnboardingView.swift @@ -87,6 +87,7 @@ struct OnboardingView: View { } .pickerStyle(.automatic) .tint(.primary) + .accessibilityLabel("Select Bitcoin Network") Picker( "Esplora Server", diff --git a/BDKSwiftExampleWallet/View/Send/BuildTransactionView.swift b/BDKSwiftExampleWallet/View/Send/BuildTransactionView.swift index 8c995def..95b60fd7 100644 --- a/BDKSwiftExampleWallet/View/Send/BuildTransactionView.swift +++ b/BDKSwiftExampleWallet/View/Send/BuildTransactionView.swift @@ -119,6 +119,7 @@ struct BuildTransactionView: View { ) .padding() + .accessibilityLabel("Send Transaction") } else if isSent && viewModel.buildTransactionViewError == nil { VStack { diff --git a/BDKSwiftExampleWallet/View/Send/FeeView.swift b/BDKSwiftExampleWallet/View/Send/FeeView.swift index a43b219c..8898666e 100644 --- a/BDKSwiftExampleWallet/View/Send/FeeView.swift +++ b/BDKSwiftExampleWallet/View/Send/FeeView.swift @@ -26,6 +26,7 @@ struct FeeView: View { HStack { Spacer() + Picker("Select Fee", selection: $viewModel.selectedFeeIndex) { HStack { Image( @@ -70,9 +71,13 @@ struct FeeView: View { } .pickerStyle(.automatic) .tint(.primary) + .accessibilityLabel("Select Transaction Fee") + .accessibilityValue("\(viewModel.selectedFee ?? 1) satoshis per vbyte") + Text("sat/vb") .foregroundColor(.secondary) .fontWeight(.thin) + Spacer() } diff --git a/BDKSwiftExampleWallet/View/WalletView.swift b/BDKSwiftExampleWallet/View/WalletView.swift index 4c2f223f..0d24b35f 100644 --- a/BDKSwiftExampleWallet/View/WalletView.swift +++ b/BDKSwiftExampleWallet/View/WalletView.swift @@ -56,6 +56,9 @@ struct WalletView: View { .lineLimit(1) .minimumScaleFactor(0.5) } + .accessibilityLabel("Bitcoin Balance") + .accessibilityValue("\(viewModel.balanceTotal.formattedSatoshis()) sats") + HStack { if viewModel.walletSyncState == .syncing { Image(systemName: "chart.bar.fill")