1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-20 10:13:42 +00:00

a11y labeling

This commit is contained in:
Kyle Spearrin
2019-07-22 12:04:17 -04:00
parent 392e429dfd
commit a2bac9d368
12 changed files with 140 additions and 35 deletions

View File

@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Controls.CipherViewCell" x:Class="Bit.App.Controls.CipherViewCell"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:ff="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"> xmlns:ff="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms">
<Grid <Grid
@@ -32,7 +33,8 @@
Grid.Column="0" Grid.Column="0"
HorizontalOptions="Center" HorizontalOptions="Center"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-icon, list-icon-platform" /> StyleClass="list-icon, list-icon-platform"
AutomationProperties.IsInAccessibleTree="False" />
<ff:CachedImage <ff:CachedImage
x:Name="_image" x:Name="_image"
@@ -44,7 +46,8 @@
VerticalOptions="Center" VerticalOptions="Center"
WidthRequest="22" WidthRequest="22"
HeightRequest="22" HeightRequest="22"
IsVisible="False"/> IsVisible="False"
AutomationProperties.IsInAccessibleTree="False" />
<Grid RowSpacing="0" ColumnSpacing="0" Grid.Row="0" Grid.Column="1" VerticalOptions="Center"> <Grid RowSpacing="0" ColumnSpacing="0" Grid.Row="0" Grid.Column="1" VerticalOptions="Center">
<Grid.RowDefinitions> <Grid.RowDefinitions>
@@ -79,7 +82,9 @@
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="&#xf1e0;" Text="&#xf1e0;"
IsVisible="{Binding Cipher.Shared, Mode=OneWay}" /> IsVisible="{Binding Cipher.Shared, Mode=OneWay}"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Shared}" />
<controls:FaLabel <controls:FaLabel
Grid.Column="2" Grid.Column="2"
Grid.Row="0" Grid.Row="0"
@@ -88,7 +93,9 @@
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="&#xf0c6;" Text="&#xf0c6;"
IsVisible="{Binding Cipher.HasAttachments, Mode=OneWay}" /> IsVisible="{Binding Cipher.HasAttachments, Mode=OneWay}"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Attachments}" />
</Grid> </Grid>
<controls:MiButton <controls:MiButton
@@ -98,7 +105,9 @@
StyleClass="list-row-button, list-row-button-platform, btn-disabled" StyleClass="list-row-button, list-row-button-platform, btn-disabled"
Clicked="MoreButton_Clicked" Clicked="MoreButton_Clicked"
VerticalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"
HorizontalOptions="EndAndExpand" /> HorizontalOptions="EndAndExpand"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Options}" />
</Grid> </Grid>

View File

@@ -16,7 +16,9 @@
<controls:FaButton Text="&#xf013;" <controls:FaButton Text="&#xf013;"
StyleClass="btn-muted, btn-icon, btn-icon-platform" StyleClass="btn-muted, btn-icon, btn-icon-platform"
HorizontalOptions="Start" HorizontalOptions="Start"
Clicked="Settings_Clicked"> Clicked="Settings_Clicked"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Options}">
<controls:FaButton.Margin> <controls:FaButton.Margin>
<OnPlatform x:TypeArguments="Thickness"> <OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="0, 10, 0, 0" /> <On Platform="iOS" Value="0, 10, 0, 0" />

View File

@@ -58,7 +58,9 @@
Command="{Binding TogglePasswordCommand}" Command="{Binding TogglePasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
</Grid> </Grid>
<Grid StyleClass="box-row" IsVisible="{Binding PinLock, Converter={StaticResource inverseBool}}"> <Grid StyleClass="box-row" IsVisible="{Binding PinLock, Converter={StaticResource inverseBool}}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
@@ -91,7 +93,9 @@
Command="{Binding TogglePasswordCommand}" Command="{Binding TogglePasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
</Grid> </Grid>
<Label <Label
Text="{Binding LockedVerifyText}" Text="{Binding LockedVerifyText}"

View File

@@ -68,7 +68,9 @@
Command="{Binding TogglePasswordCommand}" Command="{Binding TogglePasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
</Grid> </Grid>
</StackLayout> </StackLayout>
<StackLayout Padding="10, 0"> <StackLayout Padding="10, 0">

View File

@@ -66,7 +66,9 @@
Command="{Binding TogglePasswordCommand}" Command="{Binding TogglePasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
</Grid> </Grid>
<Label <Label
Text="{u:I18n MasterPasswordDescription}" Text="{u:I18n MasterPasswordDescription}"
@@ -102,7 +104,9 @@
Command="{Binding ToggleConfirmPasswordCommand}" Command="{Binding ToggleConfirmPasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
</Grid> </Grid>
<StackLayout StyleClass="box-row"> <StackLayout StyleClass="box-row">
<Label <Label

View File

@@ -84,7 +84,9 @@
CommandParameter="{Binding .}" CommandParameter="{Binding .}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CopyPassword}" />
</Grid> </Grid>
</ViewCell> </ViewCell>
</DataTemplate> </DataTemplate>

View File

@@ -121,21 +121,27 @@
Command="{Binding CheckPasswordCommand}" Command="{Binding CheckPasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CheckPassword}" />
<controls:FaButton <controls:FaButton
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="{Binding ShowPasswordIcon}" Text="{Binding ShowPasswordIcon}"
Command="{Binding TogglePasswordCommand}" Command="{Binding TogglePasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
<controls:FaButton <controls:FaButton
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="&#xf021;" Text="&#xf021;"
Command="{Binding GeneratePasswordCommand}" Command="{Binding GeneratePasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="3" Grid.Column="3"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n GeneratePassword}" />
</Grid> </Grid>
<Grid StyleClass="box-row, box-row-input"> <Grid StyleClass="box-row, box-row-input">
@@ -166,7 +172,9 @@
Clicked="ScanTotp_Clicked" Clicked="ScanTotp_Clicked"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ScanQrTitle}" />
</Grid> </Grid>
</StackLayout> </StackLayout>
<StackLayout IsVisible="{Binding IsCard}" Spacing="0" Padding="0"> <StackLayout IsVisible="{Binding IsCard}" Spacing="0" Padding="0">
@@ -249,7 +257,9 @@
Command="{Binding ToggleCardCodeCommand}" Command="{Binding ToggleCardCodeCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
</Grid> </Grid>
</StackLayout> </StackLayout>
<StackLayout IsVisible="{Binding IsIdentity}" Spacing="0" Padding="0"> <StackLayout IsVisible="{Binding IsIdentity}" Spacing="0" Padding="0">
@@ -454,7 +464,9 @@
CommandParameter="{Binding .}" CommandParameter="{Binding .}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Options}" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</controls:RepeaterView.ItemTemplate> </controls:RepeaterView.ItemTemplate>
@@ -565,7 +577,9 @@
IsVisible="{Binding IsHiddenType}" IsVisible="{Binding IsHiddenType}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
<controls:FaButton <controls:FaButton
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="&#xf013;" Text="&#xf013;"
@@ -573,7 +587,9 @@
CommandParameter="{Binding .}" CommandParameter="{Binding .}"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Options}" />
</Grid> </Grid>
<BoxView StyleClass="box-row-separator" IsVisible="{Binding IsBooleanType}" /> <BoxView StyleClass="box-row-separator" IsVisible="{Binding IsBooleanType}" />
</StackLayout> </StackLayout>

View File

@@ -54,7 +54,9 @@
Text="&#xf014;" Text="&#xf014;"
Command="{Binding BindingContext.DeleteAttachmentCommand, Source={x:Reference _page}}" Command="{Binding BindingContext.DeleteAttachmentCommand, Source={x:Reference _page}}"
CommandParameter="{Binding .}" CommandParameter="{Binding .}"
VerticalOptions="Center" /> VerticalOptions="Center"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Delete}" />
</StackLayout> </StackLayout>
<BoxView StyleClass="box-row-separator" /> <BoxView StyleClass="box-row-separator" />
</StackLayout> </StackLayout>

View File

@@ -75,7 +75,9 @@
CommandParameter="{Binding .}" CommandParameter="{Binding .}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CopyPassword}" />
</Grid> </Grid>
</ViewCell> </ViewCell>
</DataTemplate> </DataTemplate>

View File

@@ -88,7 +88,9 @@
CommandParameter="LoginUsername" CommandParameter="LoginUsername"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CopyUsername}" />
</Grid> </Grid>
<BoxView StyleClass="box-row-separator" <BoxView StyleClass="box-row-separator"
IsVisible="{Binding Cipher.Login.Username, Converter={StaticResource stringHasValue}}" /> IsVisible="{Binding Cipher.Login.Username, Converter={StaticResource stringHasValue}}" />
@@ -128,14 +130,18 @@
Command="{Binding CheckPasswordCommand}" Command="{Binding CheckPasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CheckPassword}" />
<controls:FaButton <controls:FaButton
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="{Binding ShowPasswordIcon}" Text="{Binding ShowPasswordIcon}"
Command="{Binding TogglePasswordCommand}" Command="{Binding TogglePasswordCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
<controls:FaButton <controls:FaButton
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="&#xf0ea;" Text="&#xf0ea;"
@@ -143,7 +149,9 @@
CommandParameter="LoginPassword" CommandParameter="LoginPassword"
Grid.Row="0" Grid.Row="0"
Grid.Column="3" Grid.Column="3"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CopyPassword}" />
</Grid> </Grid>
<BoxView StyleClass="box-row-separator" <BoxView StyleClass="box-row-separator"
IsVisible="{Binding Cipher.Login.Password, Converter={StaticResource stringHasValue}}" /> IsVisible="{Binding Cipher.Login.Password, Converter={StaticResource stringHasValue}}" />
@@ -184,7 +192,9 @@
CommandParameter="LoginTotp" CommandParameter="LoginTotp"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CopyTotp}" />
</Grid> </Grid>
<BoxView StyleClass="box-row-separator" IsVisible="{Binding ShowTotp}" /> <BoxView StyleClass="box-row-separator" IsVisible="{Binding ShowTotp}" />
</StackLayout> </StackLayout>
@@ -227,7 +237,9 @@
CommandParameter="CardNumber" CommandParameter="CardNumber"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CopyNumber}" />
</Grid> </Grid>
<BoxView StyleClass="box-row-separator" <BoxView StyleClass="box-row-separator"
IsVisible="{Binding Cipher.Card.Number, Converter={StaticResource stringHasValue}}" /> IsVisible="{Binding Cipher.Card.Number, Converter={StaticResource stringHasValue}}" />
@@ -287,7 +299,9 @@
Command="{Binding ToggleCardCodeCommand}" Command="{Binding ToggleCardCodeCommand}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
<controls:FaButton <controls:FaButton
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="&#xf0ea;" Text="&#xf0ea;"
@@ -295,7 +309,9 @@
CommandParameter="CardCode" CommandParameter="CardCode"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n CopySecurityCode}" />
</Grid> </Grid>
<BoxView StyleClass="box-row-separator" <BoxView StyleClass="box-row-separator"
IsVisible="{Binding Cipher.Card.Code, Converter={StaticResource stringHasValue}}" /> IsVisible="{Binding Cipher.Card.Code, Converter={StaticResource stringHasValue}}" />
@@ -461,7 +477,9 @@
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" Grid.RowSpan="2"
IsVisible="{Binding CanLaunch, Mode=OneWay}" /> IsVisible="{Binding CanLaunch, Mode=OneWay}"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Launch}" />
<controls:FaButton <controls:FaButton
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="&#xf0ea;" Text="&#xf0ea;"
@@ -469,7 +487,9 @@
CommandParameter="{Binding .}" CommandParameter="{Binding .}"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Copy}" />
</Grid> </Grid>
<BoxView StyleClass="box-row-separator" /> <BoxView StyleClass="box-row-separator" />
</StackLayout> </StackLayout>
@@ -551,7 +571,9 @@
IsVisible="{Binding IsHiddenType}" IsVisible="{Binding IsHiddenType}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
<controls:FaButton <controls:FaButton
StyleClass="box-row-button, box-row-button-platform" StyleClass="box-row-button, box-row-button-platform"
Text="&#xf0ea;" Text="&#xf0ea;"
@@ -560,7 +582,9 @@
IsVisible="{Binding ShowCopyButton}" IsVisible="{Binding ShowCopyButton}"
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Grid.RowSpan="2" /> Grid.RowSpan="2"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Copy}" />
</Grid> </Grid>
<BoxView StyleClass="box-row-separator" /> <BoxView StyleClass="box-row-separator" />
</StackLayout> </StackLayout>
@@ -593,7 +617,9 @@
Text="&#xf019;" Text="&#xf019;"
Command="{Binding BindingContext.DownloadAttachmentCommand, Source={x:Reference _page}}" Command="{Binding BindingContext.DownloadAttachmentCommand, Source={x:Reference _page}}"
CommandParameter="{Binding .}" CommandParameter="{Binding .}"
VerticalOptions="Center" /> VerticalOptions="Center"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Download}" />
</StackLayout> </StackLayout>
<BoxView StyleClass="box-row-separator" /> <BoxView StyleClass="box-row-separator" />
</StackLayout> </StackLayout>

View File

@@ -1248,6 +1248,15 @@ namespace Bit.App.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Download.
/// </summary>
public static string Download {
get {
return ResourceManager.GetString("Download", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Downloading.... /// Looks up a localized string similar to Downloading....
/// </summary> /// </summary>
@@ -3345,6 +3354,15 @@ namespace Bit.App.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Shared.
/// </summary>
public static string Shared {
get {
return ResourceManager.GetString("Shared", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Choose an organization that you wish to share this item with. Sharing transfers ownership of the item to the organization. You will no longer be the direct owner of this item once it has been shared.. /// Looks up a localized string similar to Choose an organization that you wish to share this item with. Sharing transfers ownership of the item to the organization. You will no longer be the direct owner of this item once it has been shared..
/// </summary> /// </summary>
@@ -3552,6 +3570,15 @@ namespace Bit.App.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Toggle Visiblity.
/// </summary>
public static string ToggleVisibility {
get {
return ResourceManager.GetString("ToggleVisibility", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Tools. /// Looks up a localized string similar to Tools.
/// </summary> /// </summary>

View File

@@ -1566,4 +1566,13 @@
<data name="IncludeNumber" xml:space="preserve"> <data name="IncludeNumber" xml:space="preserve">
<value>Include Number</value> <value>Include Number</value>
</data> </data>
<data name="Download" xml:space="preserve">
<value>Download</value>
</data>
<data name="Shared" xml:space="preserve">
<value>Shared</value>
</data>
<data name="ToggleVisibility" xml:space="preserve">
<value>Toggle Visiblity</value>
</data>
</root> </root>