mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
* Adding IDs for Vault Page sections * Removing extra spaces * Adding Matt's comments * Fixing Filters Id bug * Adding Fede's suggestions * Fixing Settings Ids issues * Fixing AutomationIds issues with RecyclerViews + implementing AutomationId helper class * Adding Fede's suggestion * Adding latest Fede's suggestions
53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Threading.Tasks;
|
|
using Bit.App.Resources;
|
|
using Bit.App.Utilities;
|
|
using Bit.App.Utilities.Automation;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Bit.App.Pages
|
|
{
|
|
public class SettingsPageListItem : ISettingsPageListItem
|
|
{
|
|
public string Icon { get; set; }
|
|
public string Name { get; set; }
|
|
public string SubLabel { get; set; }
|
|
public TimeSpan? Time { get; set; }
|
|
public bool UseFrame { get; set; }
|
|
public Func<Task> ExecuteAsync { get; set; }
|
|
|
|
public bool SubLabelTextEnabled => SubLabel == AppResources.On;
|
|
public string LineBreakMode => SubLabel == null ? "TailTruncation" : "";
|
|
public bool ShowSubLabel => SubLabel.Length != 0;
|
|
public bool ShowTimeInput => Time != null;
|
|
public Color SubLabelColor => SubLabelTextEnabled ?
|
|
ThemeManager.GetResourceColor("SuccessColor") :
|
|
ThemeManager.GetResourceColor("MutedColor");
|
|
|
|
public string AutomationIdSettingName
|
|
{
|
|
get
|
|
{
|
|
return AutomationIdsHelper.AddSuffixFor(
|
|
UseFrame ? "EnabledPolicy"
|
|
: AutomationIdsHelper.ToEnglishTitleCase(Name)
|
|
, SuffixType.Cell);
|
|
}
|
|
}
|
|
|
|
public string AutomationIdSettingStatus
|
|
{
|
|
get
|
|
{
|
|
if (UseFrame)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return AutomationIdsHelper.AddSuffixFor(AutomationIdsHelper.ToEnglishTitleCase(Name), SuffixType.SettingValue);
|
|
}
|
|
}
|
|
}
|
|
}
|