/
DocumentsListPage.xaml
201 lines (178 loc) · 9.4 KB
/
DocumentsListPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="EssentialUIKit.Views.Navigation.DocumentsListPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:behaviors="clr-namespace:EssentialUIKit.Behaviors"
xmlns:border="clr-namespace:Syncfusion.XForms.Border;assembly=Syncfusion.Core.XForms"
xmlns:buttons="clr-namespace:Syncfusion.XForms.Buttons;assembly=Syncfusion.Buttons.XForms"
xmlns:controls="clr-namespace:EssentialUIKit.Controls"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="documentList"
BackgroundColor="{DynamicResource Gray-Bg}"
NavigationPage.HasNavigationBar="False"
mc:Ignorable="d">
<ContentPage.Content>
<Grid
ColumnSpacing="0"
RowDefinitions="Auto, Auto, *"
RowSpacing="0">
<StackLayout
x:Name="TitleView"
Grid.Row="0"
Padding="8,8"
BackgroundColor="{DynamicResource Gray-Bg}"
HorizontalOptions="FillAndExpand"
Orientation="Horizontal"
Spacing="0">
<StackLayout
x:Name="TitleLayout"
HorizontalOptions="FillAndExpand"
IsVisible="True"
Orientation="Horizontal"
Spacing="0"
VerticalOptions="FillAndExpand">
<!-- Back button command -->
<buttons:SfButton
x:Name="backButton"
Command="{Binding BackButtonCommand}"
CommandParameter="{x:Reference backButton}"
Style="{StaticResource IconButtonStyle}"
Text="{StaticResource Back}" />
<!-- Documents List page Title -->
<Label
Margin="16,0"
FontFamily="Montserrat-Medium"
HorizontalOptions="FillAndExpand"
Style="{StaticResource TitleLabelStyle}"
Text="Documents List"
VerticalOptions="Center"
VerticalTextAlignment="Center" />
</StackLayout>
<StackLayout
x:Name="Search"
HorizontalOptions="EndAndExpand"
IsVisible="False"
Orientation="Horizontal"
Spacing="0">
<!-- Back to title layout -->
<buttons:SfButton
x:Name="BackToTitle"
Style="{StaticResource IconButtonStyle}"
Text="{StaticResource Back}">
<buttons:SfButton.Behaviors>
<behaviors:SearchBarAnimationBehavior AnimationType="shrink" />
</buttons:SfButton.Behaviors>
</buttons:SfButton>
<!-- Rounded Search Entry -->
<border:SfBorder Style="{DynamicResource ThemeBorderStyle}">
<controls:BorderlessEntry
x:Name="SearchEntry"
BindingContext="{x:Reference DocumentsList}"
HorizontalOptions="FillAndExpand"
Placeholder="Search here"
Style="{StaticResource BorderlessEntryStyle}"
Text="{Binding SearchText, Mode=TwoWay}" />
</border:SfBorder>
</StackLayout>
<!-- Search Button -->
<buttons:SfButton
x:Name="SearchButton"
IsVisible="True"
Style="{StaticResource IconButtonStyle}"
Text="{StaticResource Search}">
<buttons:SfButton.Behaviors>
<behaviors:SearchBarAnimationBehavior AnimationType="expand" />
</buttons:SfButton.Behaviors>
</buttons:SfButton>
</StackLayout>
<BoxView Grid.Row="1" Style="{DynamicResource HorizontalSeparatorStyle}" />
<StackLayout Grid.Row="2" Spacing="0">
<controls:SearchableDocumentsList
x:Name="DocumentsList"
AllowSwiping="True"
AutoFitMode="Height"
IsScrollBarVisible="False"
ItemSpacing="0"
ItemsSource="{Binding DocumentsList}"
SearchText="{Binding SearchText}"
SelectionBackgroundColor="{DynamicResource Gray-200}"
SelectionGesture="Tap"
SelectionMode="Single"
TapCommand="{Binding ItemTappedCommand}"
VerticalOptions="FillAndExpand">
<controls:SearchableDocumentsList.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Spacing="0">
<Grid
ColumnDefinitions="Auto, Auto, Auto, *"
ColumnSpacing="0"
HeightRequest="72"
RowDefinitions="Auto, Auto, Auto"
RowSpacing="0">
<!-- Account Icon -->
<Label
Grid.RowSpan="3"
Margin="17,0"
FontFamily="FontIcons"
FontSize="18"
Text="{StaticResource Account}"
TextColor="{DynamicResource Gray-600}"
VerticalOptions="CenterAndExpand" />
<!-- Document Name -->
<Label
Grid.Column="1"
Grid.ColumnSpan="3"
Margin="0,13,0,0"
FontFamily="Montserrat-Medium"
FontSize="16"
HeightRequest="24"
Text="{Binding DocumentName}"
TextColor="{DynamicResource Gray-900}" />
<!-- Time -->
<Label
Grid.Row="1"
Grid.Column="1"
Margin="0,0,0,14"
FontFamily="Montserrat-Medium"
FontSize="14"
HeightRequest="21"
Text="{Binding Time}"
TextColor="{DynamicResource Gray-700}" />
<!-- Document Size -->
<Label
Grid.Row="1"
Grid.Column="2"
Margin="24,0,0,14"
FontFamily="Montserrat-Medium"
FontSize="14"
HeightRequest="21"
Text="{Binding DocumentSize}"
TextColor="{DynamicResource Gray-700}" />
<!-- More Button -->
<buttons:SfButton
Grid.RowSpan="3"
Grid.Column="3"
Margin="15,0,15,0"
Command="{Binding Path=BindingContext.MenuCommand, Source={x:Reference documentList}}"
CornerRadius="4"
HorizontalOptions="End"
Style="{StaticResource IconButtonStyle}"
Text="{StaticResource Menu}" />
<!-- Seperator -->
<BoxView
Grid.Row="2"
Grid.ColumnSpan="4"
Style="{DynamicResource HorizontalSeparatorStyle}" />
</Grid>
</StackLayout>
</ViewCell>
</DataTemplate>
</controls:SearchableDocumentsList.ItemTemplate>
</controls:SearchableDocumentsList>
</StackLayout>
</Grid>
</ContentPage.Content>
</ContentPage>