[PS-672] Accessibility - File/Text controls unintuitive, "Text" accessible name incorrect (#1923)

* 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: André Bispo <abispo@bitwarden.com>
This commit is contained in:
André Filipe da Silva Bispo 2022-05-25 17:20:51 +01:00 committed by GitHub
parent 7e9b7398c8
commit 43e9515a03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 0 deletions

View File

@ -121,6 +121,7 @@
Clicked="FileType_Clicked"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n File}"
AutomationProperties.HelpText="{Binding FileTypeAccessibilityLabel}"
Grid.Column="0">
</Button>
<Button
@ -132,6 +133,7 @@
Clicked="TextType_Clicked"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Text}"
AutomationProperties.HelpText="{Binding TextTypeAccessibilityLabel}"
Grid.Column="1">
</Button>
</Grid>

View File

@ -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()
{

View File

@ -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);

View File

@ -1861,6 +1861,9 @@
<value>A friendly name to describe this Send.</value>
<comment>'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated.</comment>
</data>
<data name="Text" xml:space="preserve">
<value>Text</value>
</data>
<data name="TypeText" xml:space="preserve">
<value>Text</value>
</data>
@ -1877,6 +1880,18 @@
<data name="TypeFileInfo" xml:space="preserve">
<value>The file you want to send.</value>
</data>
<data name="FileTypeIsSelected" xml:space="preserve">
<value>File type is selected.</value>
</data>
<data name="FileTypeIsNotSelected" xml:space="preserve">
<value>File type is not selected, tap to select.</value>
</data>
<data name="TextTypeIsSelected" xml:space="preserve">
<value>Text type is selected.</value>
</data>
<data name="TextTypeIsNotSelected" xml:space="preserve">
<value>Text type is not selected, tap to select.</value>
</data>
<data name="DeletionDate" xml:space="preserve">
<value>Deletion Date</value>
</data>