1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-27 12:26:31 +01:00

list section separator on settings page

This commit is contained in:
Kyle Spearrin 2019-05-31 11:52:56 -04:00
parent aa3fd29508
commit 6588b5bebb
3 changed files with 14 additions and 6 deletions

View File

@ -13,6 +13,7 @@
<ContentPage.Resources>
<ResourceDictionary>
<u:InverseBoolConverter x:Key="inverseBool" />
<u:StringHasValueConverter x:Key="stringHasValue" />
<DataTemplate
@ -54,10 +55,14 @@
<ListView.GroupHeaderTemplate>
<DataTemplate x:DataType="pages:SettingsPageListGroup">
<ViewCell>
<StackLayout StyleClass="list-row-header">
<Label
Text="{Binding Name}"
StyleClass="list-header, list-header-platform" />
<StackLayout Padding="0" Spacing="0">
<BoxView StyleClass="list-section-separator"
IsVisible="{Binding First, Converter={StaticResource inverseBool}}" />
<StackLayout StyleClass="list-row-header">
<Label
Text="{Binding Name}"
StyleClass="list-header, list-header-platform" />
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>

View File

@ -4,7 +4,8 @@ namespace Bit.App.Pages
{
public class SettingsPageListGroup : List<SettingsPageListItem>
{
public SettingsPageListGroup(List<SettingsPageListItem> groupItems, string name, bool doUpper = true)
public SettingsPageListGroup(List<SettingsPageListItem> groupItems, string name, bool doUpper = true,
bool first = false)
{
AddRange(groupItems);
if(string.IsNullOrWhiteSpace(name))
@ -19,8 +20,10 @@ namespace Bit.App.Pages
{
Name = name;
}
First = first;
}
public bool First { get; set; }
public string Name { get; set; }
}
}

View File

@ -339,7 +339,7 @@ namespace Bit.App.Pages
};
GroupedItems.ResetWithRange(new List<SettingsPageListGroup>
{
new SettingsPageListGroup(autofillItems, AppResources.Autofill, doUpper),
new SettingsPageListGroup(autofillItems, AppResources.Autofill, doUpper, true),
new SettingsPageListGroup(manageItems, AppResources.Manage, doUpper),
new SettingsPageListGroup(securityItems, AppResources.Security, doUpper),
new SettingsPageListGroup(accountItems, AppResources.Account, doUpper),