mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 07:05:35 +03:00
[PM-2678] Adding IDs for Settings Page elements (#2584)
* Adding IDS for Settings elements * Adding IDS for Settings elements
This commit is contained in:
parent
16f59e2698
commit
1407aa5655
2 changed files with 30 additions and 5 deletions
|
@ -20,7 +20,8 @@
|
|||
x:Key="regularTemplate"
|
||||
x:DataType="pages:SettingsPageListItem">
|
||||
<controls:ExtendedStackLayout Orientation="Horizontal"
|
||||
StyleClass="list-row, list-row-platform">
|
||||
StyleClass="list-row, list-row-platform"
|
||||
AutomationId="{Binding AutomationId}">
|
||||
<Frame
|
||||
IsVisible="{Binding UseFrame}"
|
||||
Padding="10"
|
||||
|
@ -37,14 +38,16 @@
|
|||
LineBreakMode="{Binding LineBreakMode}"
|
||||
HorizontalOptions="StartAndExpand"
|
||||
VerticalOptions="CenterAndExpand"
|
||||
StyleClass="list-title"/>
|
||||
StyleClass="list-title"
|
||||
AutomationId="SettingTitleLabel" />
|
||||
<Label Text="{Binding SubLabel, Mode=OneWay}"
|
||||
IsVisible="{Binding ShowSubLabel}"
|
||||
HorizontalOptions="End"
|
||||
HorizontalTextAlignment="End"
|
||||
VerticalOptions="CenterAndExpand"
|
||||
TextColor="{Binding SubLabelColor}"
|
||||
StyleClass="list-sub" />
|
||||
StyleClass="list-sub"
|
||||
AutomationId="SettingStatusLabel" />
|
||||
</controls:ExtendedStackLayout>
|
||||
</DataTemplate>
|
||||
<DataTemplate
|
||||
|
@ -57,7 +60,8 @@
|
|||
Padding="10"
|
||||
HasShadow="False"
|
||||
BackgroundColor="Transparent"
|
||||
BorderColor="{DynamicResource PrimaryColor}">
|
||||
BorderColor="{DynamicResource PrimaryColor}"
|
||||
AutomationId="SettingActivePolicyTextLabel">
|
||||
<Label
|
||||
Text="{Binding Name, Mode=OneWay}"
|
||||
StyleClass="text-muted, text-sm, text-bold"
|
||||
|
@ -75,7 +79,8 @@
|
|||
VerticalOptions="Center"
|
||||
FontSize="Small"
|
||||
TextColor="{Binding SubLabelColor}"
|
||||
StyleClass="list-sub" Margin="-5"/>
|
||||
StyleClass="list-sub" Margin="-5"
|
||||
AutomationId="SettingCustomVaultTimeoutPicker" />
|
||||
<controls:ExtendedStackLayout.GestureRecognizers>
|
||||
<TapGestureRecognizer Tapped="ActivateTimePicker"/>
|
||||
</controls:ExtendedStackLayout.GestureRecognizers>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App.Resources;
|
||||
using Bit.App.Utilities;
|
||||
|
@ -22,5 +23,24 @@ namespace Bit.App.Pages
|
|||
public Color SubLabelColor => SubLabelTextEnabled ?
|
||||
ThemeManager.GetResourceColor("SuccessColor") :
|
||||
ThemeManager.GetResourceColor("MutedColor");
|
||||
public string AutomationId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!UseFrame)
|
||||
{
|
||||
var idText = new CultureInfo("en-US", false)
|
||||
.TextInfo
|
||||
.ToTitleCase(Name)
|
||||
.Replace(" ", String.Empty)
|
||||
.Replace("-", String.Empty);
|
||||
return $"{idText}Cell";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "EnabledPolicyCell";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue