From 43e9515a032e4cc60252cd6a96107fe6fb1d0282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Filipe=20da=20Silva=20Bispo?= Date: Wed, 25 May 2022 17:20:51 +0100 Subject: [PATCH] [PS-672] Accessibility - File/Text controls unintuitive, "Text" accessible name incorrect (#1923) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * PS-672: Accessibility - File/Text controls unintuitive, "Text" accessible name incorrect - Added new text to help identify File / Text segmented button - Added missing text for Text button accessibility * PS-672: refactor code with pr suggestions * PS-672: removed unnecessary code * PS-672: change text from "click" to "tap" * PS-672: removed comma Co-authored-by: AndreĢ Bispo --- src/App/Pages/Send/SendAddEditPage.xaml | 2 ++ .../Pages/Send/SendAddEditPageViewModel.cs | 4 +++ src/App/Resources/AppResources.Designer.cs | 30 +++++++++++++++++++ src/App/Resources/AppResources.resx | 15 ++++++++++ 4 files changed, 51 insertions(+) diff --git a/src/App/Pages/Send/SendAddEditPage.xaml b/src/App/Pages/Send/SendAddEditPage.xaml index fc3009e07..c6701c682 100644 --- a/src/App/Pages/Send/SendAddEditPage.xaml +++ b/src/App/Pages/Send/SendAddEditPage.xaml @@ -121,6 +121,7 @@ Clicked="FileType_Clicked" AutomationProperties.IsInAccessibleTree="True" AutomationProperties.Name="{u:I18n File}" + AutomationProperties.HelpText="{Binding FileTypeAccessibilityLabel}" Grid.Column="0"> diff --git a/src/App/Pages/Send/SendAddEditPageViewModel.cs b/src/App/Pages/Send/SendAddEditPageViewModel.cs index 01d588170..99c41f6a2 100644 --- a/src/App/Pages/Send/SendAddEditPageViewModel.cs +++ b/src/App/Pages/Send/SendAddEditPageViewModel.cs @@ -44,6 +44,8 @@ namespace Bit.App.Pages { nameof(IsText), nameof(IsFile), + nameof(FileTypeAccessibilityLabel), + nameof(TextTypeAccessibilityLabel) }; private bool _disableHideEmail; private bool _sendOptionsPolicyInEffect; @@ -231,6 +233,8 @@ namespace Bit.App.Pages public bool ShowDeletionCustomPickers => EditMode || DeletionDateTypeSelectedIndex == 6; public bool ShowExpirationCustomPickers => EditMode || ExpirationDateTypeSelectedIndex == 7; public string ShowPasswordIcon => ShowPassword ? BitwardenIcons.EyeSlash : BitwardenIcons.Eye; + public string FileTypeAccessibilityLabel => IsFile ? AppResources.FileTypeIsSelected : AppResources.FileTypeIsNotSelected; + public string TextTypeAccessibilityLabel => IsText ? AppResources.TextTypeIsSelected : AppResources.TextTypeIsNotSelected; public async Task InitAsync() { diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index 723d00683..ba004805d 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -3299,6 +3299,12 @@ namespace Bit.App.Resources { } } + public static string Text { + get { + return ResourceManager.GetString("Text", resourceCulture); + } + } + public static string TypeText { get { return ResourceManager.GetString("TypeText", resourceCulture); @@ -3329,6 +3335,30 @@ namespace Bit.App.Resources { } } + public static string FileTypeIsSelected { + get { + return ResourceManager.GetString("FileTypeIsSelected", resourceCulture); + } + } + + public static string FileTypeIsNotSelected { + get { + return ResourceManager.GetString("FileTypeIsNotSelected", resourceCulture); + } + } + + public static string TextTypeIsSelected { + get { + return ResourceManager.GetString("TextTypeIsSelected", resourceCulture); + } + } + + public static string TextTypeIsNotSelected { + get { + return ResourceManager.GetString("TextTypeIsNotSelected", resourceCulture); + } + } + public static string DeletionDate { get { return ResourceManager.GetString("DeletionDate", resourceCulture); diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index 20b8aeae3..ab695df1f 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -1861,6 +1861,9 @@ A friendly name to describe this Send. 'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated. + + Text + Text @@ -1877,6 +1880,18 @@ The file you want to send. + + File type is selected. + + + File type is not selected, tap to select. + + + Text type is selected. + + + Text type is not selected, tap to select. + Deletion Date