174 lines
8.5 KiB
XML
174 lines
8.5 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<pages:BaseContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
x:Class="Bit.App.Pages.GroupingsPage"
|
|
xmlns:pages="clr-namespace:Bit.App.Pages"
|
|
xmlns:u="clr-namespace:Bit.App.Utilities"
|
|
xmlns:effects="clr-namespace:Bit.App.Effects"
|
|
xmlns:controls="clr-namespace:Bit.App.Controls"
|
|
x:DataType="pages:GroupingsPageViewModel"
|
|
Title="{Binding PageTitle}"
|
|
x:Name="_page">
|
|
|
|
<ContentPage.BindingContext>
|
|
<pages:GroupingsPageViewModel />
|
|
</ContentPage.BindingContext>
|
|
|
|
<ContentPage.ToolbarItems>
|
|
<controls:ExtendedToolbarItem
|
|
x:Name="_accountAvatar"
|
|
IconImageSource="{Binding AvatarImageSource}"
|
|
Command="{Binding Source={x:Reference _accountListOverlay}, Path=ToggleVisibililtyCommand}"
|
|
Order="Primary"
|
|
Priority="-1"
|
|
UseOriginalImage="True"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n Account}" />
|
|
<ToolbarItem Icon="search.png" Clicked="Search_Clicked"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n Search}" />
|
|
</ContentPage.ToolbarItems>
|
|
|
|
<ContentPage.Resources>
|
|
<ResourceDictionary>
|
|
<u:InverseBoolConverter x:Key="inverseBool" />
|
|
|
|
<ToolbarItem x:Name="_syncItem" x:Key="syncItem" Text="{u:I18n Sync}"
|
|
Clicked="Sync_Clicked" Order="Secondary" />
|
|
<ToolbarItem x:Name="_lockItem" x:Key="lockItem" Text="{u:I18n Lock}"
|
|
Clicked="Lock_Clicked" Order="Secondary" />
|
|
<ToolbarItem x:Name="_exitItem" x:Key="exitItem" Text="{u:I18n Exit}"
|
|
Clicked="Exit_Clicked" Order="Secondary" />
|
|
<ToolbarItem x:Name="_addItem" x:Key="addItem" Icon="plus.png"
|
|
Clicked="AddButton_Clicked" Order="Primary"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n AddItem}" />
|
|
|
|
<DataTemplate x:Key="cipherTemplate"
|
|
x:DataType="pages:GroupingsPageListItem">
|
|
<controls:CipherViewCell
|
|
Cipher="{Binding Cipher}"
|
|
ButtonCommand="{Binding BindingContext.CipherOptionsCommand, Source={x:Reference _page}}"
|
|
WebsiteIconsEnabled="{Binding BindingContext.WebsiteIconsEnabled, Source={x:Reference _page}}" />
|
|
</DataTemplate>
|
|
|
|
<DataTemplate x:Key="groupTemplate"
|
|
x:DataType="pages:GroupingsPageListItem">
|
|
<controls:ExtendedStackLayout Orientation="Horizontal"
|
|
StyleClass="list-row, list-row-platform">
|
|
<controls:IconLabel Text="{Binding Icon, Mode=OneWay}"
|
|
HorizontalOptions="Start"
|
|
VerticalOptions="Center"
|
|
StyleClass="list-icon, list-icon-platform"
|
|
ShouldUpdateFontSizeDynamicallyForAccesibility="True">
|
|
<controls:IconLabel.Effects>
|
|
<effects:FixedSizeEffect />
|
|
</controls:IconLabel.Effects>
|
|
</controls:IconLabel>
|
|
<Label Text="{Binding Name, Mode=OneWay}"
|
|
LineBreakMode="TailTruncation"
|
|
HorizontalOptions="FillAndExpand"
|
|
VerticalOptions="CenterAndExpand"
|
|
StyleClass="list-title"/>
|
|
<Label Text="{Binding ItemCount, Mode=OneWay}"
|
|
HorizontalOptions="End"
|
|
VerticalOptions="CenterAndExpand"
|
|
HorizontalTextAlignment="End"
|
|
StyleClass="list-sub"/>
|
|
</controls:ExtendedStackLayout>
|
|
</DataTemplate>
|
|
|
|
<pages:GroupingsPageListItemSelector x:Key="listItemDataTemplateSelector"
|
|
CipherTemplate="{StaticResource cipherTemplate}"
|
|
GroupTemplate="{StaticResource groupTemplate}" />
|
|
|
|
<StackLayout x:Key="mainLayout" x:Name="_mainLayout">
|
|
<StackLayout
|
|
VerticalOptions="CenterAndExpand"
|
|
Padding="20, 0"
|
|
Spacing="20"
|
|
IsVisible="{Binding ShowNoData}">
|
|
<Label
|
|
Text="{Binding NoDataText}"
|
|
HorizontalTextAlignment="Center"></Label>
|
|
<Button
|
|
Text="{u:I18n AddAnItem}"
|
|
Clicked="AddButton_Clicked"
|
|
IsVisible="{Binding ShowAddCipherButton}"></Button>
|
|
</StackLayout>
|
|
|
|
<RefreshView
|
|
IsVisible="{Binding ShowList}"
|
|
IsRefreshing="{Binding Refreshing}"
|
|
Command="{Binding RefreshCommand}">
|
|
<controls:ExtendedCollectionView
|
|
ItemsSource="{Binding GroupedItems}"
|
|
VerticalOptions="FillAndExpand"
|
|
ItemTemplate="{StaticResource listItemDataTemplateSelector}"
|
|
IsGrouped="True"
|
|
SelectionMode="Single"
|
|
SelectionChanged="RowSelected"
|
|
StyleClass="list, list-platform">
|
|
|
|
<CollectionView.GroupHeaderTemplate>
|
|
<DataTemplate x:DataType="pages:GroupingsPageListGroup">
|
|
<StackLayout
|
|
Spacing="0" Padding="0" VerticalOptions="FillAndExpand"
|
|
StyleClass="list-row-header-container, list-row-header-container-platform">
|
|
<BoxView
|
|
StyleClass="list-section-separator-top, list-section-separator-top-platform"
|
|
IsVisible="{Binding First, Converter={StaticResource inverseBool}}" />
|
|
<StackLayout StyleClass="list-row-header, list-row-header-platform">
|
|
<Label
|
|
Text="{Binding Name}"
|
|
StyleClass="list-header, list-header-platform" />
|
|
<Label
|
|
Text="{Binding ItemCount}"
|
|
StyleClass="list-header-sub" />
|
|
</StackLayout>
|
|
<BoxView StyleClass="list-section-separator-bottom, list-section-separator-bottom-platform" />
|
|
</StackLayout>
|
|
</DataTemplate>
|
|
</CollectionView.GroupHeaderTemplate>
|
|
</controls:ExtendedCollectionView>
|
|
</RefreshView>
|
|
</StackLayout>
|
|
</ResourceDictionary>
|
|
</ContentPage.Resources>
|
|
|
|
<AbsoluteLayout
|
|
x:Name="_absLayout"
|
|
VerticalOptions="FillAndExpand"
|
|
HorizontalOptions="FillAndExpand">
|
|
<ContentView
|
|
x:Name="_mainContent"
|
|
AbsoluteLayout.LayoutFlags="All"
|
|
AbsoluteLayout.LayoutBounds="0, 0, 1, 1">
|
|
</ContentView>
|
|
|
|
<!-- Android FAB -->
|
|
<Button
|
|
x:Name="_fab"
|
|
Image="plus.png"
|
|
Clicked="AddButton_Clicked"
|
|
Style="{StaticResource btn-fab}"
|
|
AbsoluteLayout.LayoutFlags="PositionProportional"
|
|
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n AddItem}">
|
|
<Button.Effects>
|
|
<effects:FabShadowEffect />
|
|
</Button.Effects>
|
|
</Button>
|
|
|
|
<controls:AccountSwitchingOverlayView
|
|
x:Name="_accountListOverlay"
|
|
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
|
|
AbsoluteLayout.LayoutFlags="All"
|
|
MainPage="{Binding Source={x:Reference _page}}"
|
|
MainFab="{Binding Source={x:Reference _fab}, Path=.}"
|
|
BindingContext="{Binding AccountSwitchingOverlayViewModel}"/>
|
|
</AbsoluteLayout>
|
|
|
|
</pages:BaseContentPage>
|