bitwarden-android/src/App/Pages/Settings/SettingsPage/SettingsPage.xaml

74 lines
3.2 KiB
Text
Raw Normal View History

2019-03-29 00:10:10 +03:00
<?xml version="1.0" encoding="utf-8" ?>
2019-05-14 18:53:41 +03:00
<pages:BaseContentPage xmlns="http://xamarin.com/schemas/2014/forms"
2019-03-30 00:54:03 +03:00
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Pages.SettingsPage"
xmlns:pages="clr-namespace:Bit.App.Pages"
xmlns:controls="clr-namespace:Bit.App.Controls"
2019-05-14 16:09:35 +03:00
xmlns:u="clr-namespace:Bit.App.Utilities"
2019-03-30 00:54:03 +03:00
x:DataType="pages:SettingsPageViewModel"
Title="{Binding PageTitle}">
2019-03-29 00:10:10 +03:00
<ContentPage.BindingContext>
2019-03-29 06:52:33 +03:00
<pages:SettingsPageViewModel />
2019-03-29 00:10:10 +03:00
</ContentPage.BindingContext>
2019-05-14 18:53:41 +03:00
<ContentPage.Resources>
<ResourceDictionary>
<u:InverseBoolConverter x:Key="inverseBool" />
2019-05-16 21:55:18 +03:00
<u:StringHasValueConverter x:Key="stringHasValue" />
2019-06-03 18:26:16 +03:00
2019-05-14 18:53:41 +03:00
<DataTemplate
x:Key="regularTemplate"
x:DataType="pages:SettingsPageListItem">
<ViewCell>
<StackLayout Orientation="Horizontal"
StyleClass="list-row, list-row-platform">
<Label Text="{Binding Name, Mode=OneWay}"
LineBreakMode="TailTruncation"
HorizontalOptions="StartAndExpand"
VerticalOptions="CenterAndExpand"
StyleClass="list-title"/>
2019-05-16 21:55:18 +03:00
<Label Text="{Binding SubLabel, Mode=OneWay}"
IsVisible="{Binding SubLabel, Converter={StaticResource stringHasValue}}"
HorizontalOptions="End"
HorizontalTextAlignment="End"
VerticalOptions="CenterAndExpand"
2019-06-03 18:26:16 +03:00
TextColor="{Binding SubLabelColor}"
StyleClass="list-sub" />
2019-05-14 18:53:41 +03:00
</StackLayout>
</ViewCell>
</DataTemplate>
2019-03-29 00:10:10 +03:00
2019-05-14 18:53:41 +03:00
<pages:SettingsPageListItemSelector
x:Key="listItemDataTemplateSelector"
RegularTemplate="{StaticResource regularTemplate}" />
</ResourceDictionary>
</ContentPage.Resources>
<ListView
ItemsSource="{Binding GroupedItems}"
VerticalOptions="FillAndExpand"
HasUnevenRows="true"
ItemTemplate="{StaticResource listItemDataTemplateSelector}"
IsGroupingEnabled="True"
ItemSelected="RowSelected"
StyleClass="list, list-platform">
<ListView.GroupHeaderTemplate>
<DataTemplate x:DataType="pages:SettingsPageListGroup">
<ViewCell>
<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>
2019-05-14 18:53:41 +03:00
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
</ListView>
</pages:BaseContentPage>