mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +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:Key="regularTemplate"
|
||||||
x:DataType="pages:SettingsPageListItem">
|
x:DataType="pages:SettingsPageListItem">
|
||||||
<controls:ExtendedStackLayout Orientation="Horizontal"
|
<controls:ExtendedStackLayout Orientation="Horizontal"
|
||||||
StyleClass="list-row, list-row-platform">
|
StyleClass="list-row, list-row-platform"
|
||||||
|
AutomationId="{Binding AutomationId}">
|
||||||
<Frame
|
<Frame
|
||||||
IsVisible="{Binding UseFrame}"
|
IsVisible="{Binding UseFrame}"
|
||||||
Padding="10"
|
Padding="10"
|
||||||
|
@ -37,14 +38,16 @@
|
||||||
LineBreakMode="{Binding LineBreakMode}"
|
LineBreakMode="{Binding LineBreakMode}"
|
||||||
HorizontalOptions="StartAndExpand"
|
HorizontalOptions="StartAndExpand"
|
||||||
VerticalOptions="CenterAndExpand"
|
VerticalOptions="CenterAndExpand"
|
||||||
StyleClass="list-title"/>
|
StyleClass="list-title"
|
||||||
|
AutomationId="SettingTitleLabel" />
|
||||||
<Label Text="{Binding SubLabel, Mode=OneWay}"
|
<Label Text="{Binding SubLabel, Mode=OneWay}"
|
||||||
IsVisible="{Binding ShowSubLabel}"
|
IsVisible="{Binding ShowSubLabel}"
|
||||||
HorizontalOptions="End"
|
HorizontalOptions="End"
|
||||||
HorizontalTextAlignment="End"
|
HorizontalTextAlignment="End"
|
||||||
VerticalOptions="CenterAndExpand"
|
VerticalOptions="CenterAndExpand"
|
||||||
TextColor="{Binding SubLabelColor}"
|
TextColor="{Binding SubLabelColor}"
|
||||||
StyleClass="list-sub" />
|
StyleClass="list-sub"
|
||||||
|
AutomationId="SettingStatusLabel" />
|
||||||
</controls:ExtendedStackLayout>
|
</controls:ExtendedStackLayout>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate
|
<DataTemplate
|
||||||
|
@ -57,7 +60,8 @@
|
||||||
Padding="10"
|
Padding="10"
|
||||||
HasShadow="False"
|
HasShadow="False"
|
||||||
BackgroundColor="Transparent"
|
BackgroundColor="Transparent"
|
||||||
BorderColor="{DynamicResource PrimaryColor}">
|
BorderColor="{DynamicResource PrimaryColor}"
|
||||||
|
AutomationId="SettingActivePolicyTextLabel">
|
||||||
<Label
|
<Label
|
||||||
Text="{Binding Name, Mode=OneWay}"
|
Text="{Binding Name, Mode=OneWay}"
|
||||||
StyleClass="text-muted, text-sm, text-bold"
|
StyleClass="text-muted, text-sm, text-bold"
|
||||||
|
@ -75,7 +79,8 @@
|
||||||
VerticalOptions="Center"
|
VerticalOptions="Center"
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
TextColor="{Binding SubLabelColor}"
|
TextColor="{Binding SubLabelColor}"
|
||||||
StyleClass="list-sub" Margin="-5"/>
|
StyleClass="list-sub" Margin="-5"
|
||||||
|
AutomationId="SettingCustomVaultTimeoutPicker" />
|
||||||
<controls:ExtendedStackLayout.GestureRecognizers>
|
<controls:ExtendedStackLayout.GestureRecognizers>
|
||||||
<TapGestureRecognizer Tapped="ActivateTimePicker"/>
|
<TapGestureRecognizer Tapped="ActivateTimePicker"/>
|
||||||
</controls:ExtendedStackLayout.GestureRecognizers>
|
</controls:ExtendedStackLayout.GestureRecognizers>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Bit.App.Resources;
|
using Bit.App.Resources;
|
||||||
using Bit.App.Utilities;
|
using Bit.App.Utilities;
|
||||||
|
@ -22,5 +23,24 @@ namespace Bit.App.Pages
|
||||||
public Color SubLabelColor => SubLabelTextEnabled ?
|
public Color SubLabelColor => SubLabelTextEnabled ?
|
||||||
ThemeManager.GetResourceColor("SuccessColor") :
|
ThemeManager.GetResourceColor("SuccessColor") :
|
||||||
ThemeManager.GetResourceColor("MutedColor");
|
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