1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-20 02:03:49 +00:00

[PS-1080] Added text alternative to Boolean custom field icon (#2000)

* PS-1080 Added new accessibility text property to the custom field bool icon

* PS-1080 Added BoolValue property to the FieldView and added new AccessibilityProperty to bool icon
This commit is contained in:
aj-rosado
2022-07-21 09:53:39 +01:00
committed by GitHub
parent f809170c51
commit 263aeef030
3 changed files with 18 additions and 1 deletions

View File

@@ -727,6 +727,7 @@ namespace Bit.App.Pages
additionalPropertyNames: new string[]
{
nameof(ValueText),
nameof(ValueAccessibilityText),
nameof(IsBooleanType),
nameof(IsHiddenType),
nameof(IsTextType),
@@ -750,7 +751,7 @@ namespace Bit.App.Pages
{
if (IsBooleanType)
{
return _field.Value == "true" ? BitwardenIcons.CheckSquare : BitwardenIcons.Square;
return _field.BoolValue ? BitwardenIcons.CheckSquare : BitwardenIcons.Square;
}
else if (IsLinkedType)
{
@@ -764,6 +765,19 @@ namespace Bit.App.Pages
}
}
public string ValueAccessibilityText
{
get
{
if (IsBooleanType)
{
return _field.BoolValue ? AppResources.Enabled : AppResources.Disabled;
}
return ValueText;
}
}
public FormattedString ColoredHiddenValue => PasswordFormatter.FormatPassword(_field.Value);
public Command ToggleHiddenValueCommand { get; set; }