mirror of
https://github.com/bitwarden/android.git
synced 2025-01-24 16:53:50 +03:00
137 lines
6.6 KiB
XML
137 lines
6.6 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:controls="clr-namespace:Bit.App.Controls"
|
|
xmlns:fab="clr-namespace:Refractored.FabControl;assembly=Refractored.FabControl"
|
|
x:DataType="pages:GroupingsPageViewModel"
|
|
Title="{Binding PageTitle}"
|
|
x:Name="_page">
|
|
|
|
<ContentPage.BindingContext>
|
|
<pages:GroupingsPageViewModel />
|
|
</ContentPage.BindingContext>
|
|
|
|
<ContentPage.ToolbarItems>
|
|
<ToolbarItem Icon="search.png" Clicked="Search_Clicked" />
|
|
</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" />
|
|
|
|
<DataTemplate x:Key="cipherTemplate"
|
|
x:DataType="pages:GroupingsPageListItem">
|
|
<controls:CipherViewCell
|
|
Cipher="{Binding Cipher}"
|
|
ButtonCommand="{Binding BindingContext.CipherOptionsCommand, Source={x:Reference _page}}" />
|
|
</DataTemplate>
|
|
|
|
<DataTemplate x:Key="groupTemplate"
|
|
x:DataType="pages:GroupingsPageListItem">
|
|
<ViewCell>
|
|
<StackLayout Orientation="Horizontal"
|
|
StyleClass="list-row, list-row-platform">
|
|
<controls:FaLabel Text="{Binding Icon, Mode=OneWay}"
|
|
HorizontalOptions="Start"
|
|
VerticalOptions="Center"
|
|
StyleClass="list-icon" />
|
|
<Label Text="{Binding Name, Mode=OneWay}"
|
|
LineBreakMode="TailTruncation"
|
|
HorizontalOptions="StartAndExpand"
|
|
VerticalOptions="CenterAndExpand"
|
|
StyleClass="list-title"/>
|
|
<Label Text="{Binding ItemCount, Mode=OneWay}"
|
|
HorizontalOptions="End"
|
|
VerticalOptions="CenterAndExpand"
|
|
HorizontalTextAlignment="End"
|
|
StyleClass="list-sub"/>
|
|
</StackLayout>
|
|
</ViewCell>
|
|
</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>
|
|
|
|
<controls:ExtendedListView
|
|
IsVisible="{Binding ShowList}"
|
|
ItemsSource="{Binding GroupedItems}"
|
|
VerticalOptions="FillAndExpand"
|
|
HasUnevenRows="true"
|
|
RefreshCommand="{Binding RefreshCommand}"
|
|
IsPullToRefreshEnabled="true"
|
|
IsRefreshing="{Binding Refreshing}"
|
|
ItemTemplate="{StaticResource listItemDataTemplateSelector}"
|
|
IsGroupingEnabled="True"
|
|
ItemSelected="RowSelected"
|
|
StyleClass="list, list-platform">
|
|
<x:Arguments>
|
|
<ListViewCachingStrategy>RecycleElement</ListViewCachingStrategy>
|
|
</x:Arguments>
|
|
|
|
<ListView.GroupHeaderTemplate>
|
|
<DataTemplate x:DataType="pages:GroupingsPageListGroup">
|
|
<ViewCell>
|
|
<StackLayout Spacing="0" Padding="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" />
|
|
<Label
|
|
Text="{Binding ItemCount}"
|
|
StyleClass="list-header-sub" />
|
|
</StackLayout>
|
|
</StackLayout>
|
|
</ViewCell>
|
|
</DataTemplate>
|
|
</ListView.GroupHeaderTemplate>
|
|
</controls:ExtendedListView>
|
|
</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>
|
|
<fab:FloatingActionButtonView
|
|
x:Name="_fab"
|
|
ImageName="plus.png"
|
|
AbsoluteLayout.LayoutFlags="PositionProportional"
|
|
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize">
|
|
</fab:FloatingActionButtonView>
|
|
</AbsoluteLayout>
|
|
|
|
</pages:BaseContentPage>
|