blob: 307c9c13416f913b7f12a6068f15d8d1b5385d3e [file] [log] [blame]
Nicolas Jager998fbd72016-08-08 11:41:28 -04001<!-- **********************************************************************
2* Copyright (C) 2016 by Savoir-faire Linux *
3* Author: Jäger Nicolas<nicolas.jager@savoirfairelinux.com> *
4* *
5* This program is free software; you can redistribute it and/or modify *
6* it under the terms of the GNU General Public License as published by *
7* the Free Software Foundation; either version 3 of the License, or *
8* (at your option) any later version. *
9* *
10* This program is distributed in the hope that it will be useful, *
11* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13* GNU General Public License for more details. *
14* *
15* You should have received a copy of the GNU General Public License *
16* along with this program. If not, see <http://www.gnu.org/licenses/> . *
17*********************************************************************** -->
18<Page x:Class="RingClientUWP.Views.SmartPanel"
19 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
20 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
21 xmlns:local="using:RingClientUWP"
Nicolas Jager7c409f32016-09-08 09:35:16 -040022 xmlns:controls="using:RingClientUWP.Controls"
Nicolas Jager998fbd72016-08-08 11:41:28 -040023 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
24 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
25 mc:Ignorable="d">
26
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040027 <Page.Resources>
28 <!-- template for contacts. -->
29 <DataTemplate x:Key="ContactTemplate"
30 x:DataType="local:Contact">
31 <Grid>
32 <Grid.RowDefinitions>
33 <RowDefinition Height="60"/>
34 <!-- use the height of _contactBar_ to make it visible or collapsed. -->
35 <RowDefinition x:Name="_contactBar_"
Nicolas Jagerf6a10322016-09-06 08:17:49 -040036 Height="{x:Bind _contactBarHeight, Mode=OneWay}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040037 </Grid.RowDefinitions>
38 <Grid Grid.Row="0">
39 <Grid.ColumnDefinitions>
40 <ColumnDefinition Width="60"/>
41 <ColumnDefinition Width="*"
42 MinWidth="200"/>
43 </Grid.ColumnDefinitions>
44 <Image x:Name="_contactAvatar_"
45 VerticalAlignment="Center"
46 HorizontalAlignment="Center"
47 Grid.Column="0"
48 Width="55"
49 Height="55"
50 Source="Assets\TESTS\contactAvatar.png"/>
51 <!-- visual notifications. -->
52 <Border x:Name="_visualNotificationVideoChat_"
53 Visibility="Collapsed"
54 Style="{StaticResource BorderStyle1}">
55 <TextBlock Text="&#xE8AA;"
56 Style="{StaticResource TextSegoeStyle1}"/>
57 <Border.RenderTransform>
58 <TranslateTransform X="17" Y="-14"/>
59 </Border.RenderTransform>
60 </Border>
61 <Border x:Name="_visualNotificationNewMessage_"
Nicolas Jager0788e962016-08-26 15:41:06 -040062 Visibility="{x:Bind notificationNewMessage, Mode=OneWay}"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040063 Style="{StaticResource BorderStyle2}">
Nicolas Jager0788e962016-08-26 15:41:06 -040064 <TextBlock Text="{x:Bind unreadMessages, Mode=OneWay}"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040065 Style="{StaticResource TextStyle3}"/>
66 <Border.RenderTransform>
67 <TranslateTransform X="-17" Y="-14"/>
68 </Border.RenderTransform>
69 </Border>
Nicolas Jagerd76940f2016-08-31 14:44:04 -040070 <Grid Grid.Column="1">
71 <Grid.RowDefinitions>
72 <RowDefinition Height="30"/>
73 <RowDefinition Height="30"/>
74 </Grid.RowDefinitions>
75 <!-- name of the contact. -->
76 <TextBlock x:Name="_contactName_"
77 Grid.Row="0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040078 Text="{x:Bind name_}">
Nicolas Jagerd76940f2016-08-31 14:44:04 -040079 </TextBlock>
80 <!-- call status. -->
81 <StackPanel MaxWidth="240"
82 MinWidth="240"
83 Grid.Row="1"
84 HorizontalAlignment="Left">
85 <TextBlock x:Name="_contactCallStatus_"
86 Foreground="DarkGray"
87 Text="{x:Bind _call.state, Mode=OneWay}"
88 Visibility="Visible"
89 HorizontalAlignment="Center">
90 </TextBlock>
91 </StackPanel>
92 </Grid>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040093 </Grid>
94 <!-- button bar for accept/reject or cancel call. -->
95 <!-- nb : dont use Visibility with the grid, use the height of the hosting row (_contactBar_). -->
96 <Grid Width="320"
97 HorizontalAlignment="Left"
Nicolas Jagerd76940f2016-08-31 14:44:04 -040098 Grid.Row="2"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040099 Background="DarkGray">
100 <StackPanel Orientation="Horizontal"
Nicolas Jagerd76940f2016-08-31 14:44:04 -0400101 Grid.Row="0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400102 HorizontalAlignment="Center">
103 <Button x:Name="_acceptIncomingCallBtn_"
Nicolas Jagerf6a10322016-09-06 08:17:49 -0400104 Click="_acceptIncomingCallBtn__Click"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400105 VerticalAlignment="Center"
106 HorizontalAlignment="Center"
Nicolas Jagerd76940f2016-08-31 14:44:04 -0400107 Content="Accept"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400108 <Button x:Name="_rejectIncomingCallBtn_"
Nicolas Jagerf6a10322016-09-06 08:17:49 -0400109 Click="_rejectIncomingCallBtn__Click"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400110 VerticalAlignment="Center"
111 HorizontalAlignment="Center"
Nicolas Jagerd76940f2016-08-31 14:44:04 -0400112 Content="Reject"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400113 </StackPanel>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400114 </Grid>
115 </Grid>
116 </DataTemplate>
117 <!-- template for accounts. -->
118 <DataTemplate x:Key="AccountTemplate"
119 x:DataType="local:Account">
120 <Grid>
121 <Grid.ColumnDefinitions>
atraczyk2425ddd2016-09-01 13:16:22 -0400122 <ColumnDefinition Width="260"/>
atraczyk8ce1dee2016-08-25 18:15:07 -0400123 <ColumnDefinition Width="60"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400124 </Grid.ColumnDefinitions>
atraczyk8ce1dee2016-08-25 18:15:07 -0400125 <Grid.RowDefinitions>
126 <RowDefinition Height="30"/>
127 <RowDefinition Height="30"/>
128 </Grid.RowDefinitions>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400129 <TextBlock x:Name="_accountName_"
atraczyk2425ddd2016-09-01 13:16:22 -0400130 Grid.Column="0"
atraczyk8ce1dee2016-08-25 18:15:07 -0400131 Grid.Row="0"
atraczyk2425ddd2016-09-01 13:16:22 -0400132 Margin="10,5,10,0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400133 Text="{x:Bind name_}"/>
atraczyk8ce1dee2016-08-25 18:15:07 -0400134 <TextBlock x:Name="_accountType_"
atraczyk2425ddd2016-09-01 13:16:22 -0400135 Grid.Column="1"
atraczyk8ce1dee2016-08-25 18:15:07 -0400136 Grid.Row="0"
137 TextAlignment="Right"
atraczyk196936e2016-09-02 15:31:53 -0400138 Margin="0,5,18,0"
atraczyk8ce1dee2016-08-25 18:15:07 -0400139 Foreground="ForestGreen"
140 Text="{x:Bind accountType_}"/>
141 <TextBlock x:Name="_ringID_"
atraczyk2425ddd2016-09-01 13:16:22 -0400142 Grid.Column="0"
atraczyk8ce1dee2016-08-25 18:15:07 -0400143 Grid.ColumnSpan="2"
144 Grid.Row="1"
145 Foreground="Crimson"
atraczyk2425ddd2016-09-01 13:16:22 -0400146 Margin="10,5,10,0"
147 FontSize="14"
atraczyk8ce1dee2016-08-25 18:15:07 -0400148 TextTrimming="CharacterEllipsis"
149 Text="{x:Bind ringID_}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400150 </Grid>
151 </DataTemplate>
Nicolas Jager7c409f32016-09-08 09:35:16 -0400152 <!-- template for calls. -->
153 <DataTemplate x:Key="CallTemplate" x:DataType="local:Call">
154 <Grid Width="320"
155 HorizontalAlignment="Left"
156
157 Background="DarkGray">
158 <Grid.RowDefinitions>
159 <RowDefinition Height="30"/>
160 <RowDefinition Height="30"/>
161 </Grid.RowDefinitions>
162 <TextBlock x:Name="_contactCallStatus_"
163 Grid.Row="0"
164 Foreground="White"
165 Text="{x:Bind state, Mode=OneWay}"
166 Visibility="Visible"
167 HorizontalAlignment="Center">
168 </TextBlock>
169 <StackPanel Orientation="Horizontal"
170 Grid.Row="1"
171 HorizontalAlignment="Center">
172 <Button x:Name="_acceptIncomingCallBtn_"
173 Click="_acceptIncomingCallBtn__Click"
174 VerticalAlignment="Center"
175 HorizontalAlignment="Center"
176 Content="Accept"/>
177 <Button x:Name="_rejectIncomingCallBtn_"
178 Click="_rejectIncomingCallBtn__Click"
179 VerticalAlignment="Center"
180 HorizontalAlignment="Center"
181 Content="Reject"/>
182 </StackPanel>
183 </Grid>
184 </DataTemplate>
185 <!-- template for smartpanelitems. -->
186 <DataTemplate x:Key="SmartPanelItemsTemplate"
187 x:DataType="controls:SmartPanelItem">
188 <Grid>
189 <Grid.RowDefinitions>
190 <RowDefinition Height="auto"/>
191 <RowDefinition Height="auto"/>
192 </Grid.RowDefinitions>
193 <ListBoxItem x:Name="_contactItem_"
194 Padding="0"
195 Margin="0"
196 IsHitTestVisible="False"
197 Grid.Row="0"
198 ContentTemplate="{StaticResource ContactTemplate}"
199 Content="{x:Bind _contact, Mode=OneWay}"/>
200 <ListBoxItem x:Name="_callItem_"
201 Grid.Row="1"
202 Visibility="{x:Bind _callBar, Mode=OneWay}"
203 Padding="0"
204 Margin="0"
205 ContentTemplate="{StaticResource CallTemplate}"
206 Content="{x:Bind _call, Mode=OneWay}"/>
207 </Grid>
208 </DataTemplate>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400209 </Page.Resources>
210
Nicolas Jager998fbd72016-08-08 11:41:28 -0400211 <Grid>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400212 <Grid.RowDefinitions>
213 <!-- where accounts and share menu drop down are. -->
214 <RowDefinition Height="auto"/>
215 <!-- where contacts and settings are. -->
216 <RowDefinition Height="*"/>
217 </Grid.RowDefinitions>
218 <!-- drop down menus. -->
219 <Grid Background="LightBlue">
220 <Grid.RowDefinitions>
221 <!-- where the selected account is shown. -->
222 <RowDefinition x:Name="_selectedAccountRow_"
223 Height="90"/>
224 <!-- where the drop down menus are shown. -->
225 <RowDefinition Height="auto"/>
226 </Grid.RowDefinitions>
227 <!-- selected account. -->
228 <Grid Grid.Row="0">
229 <Grid.ColumnDefinitions>
230 <ColumnDefinition x:Name="_selectedAccountAvatarColumn_"
231 Width="90"/>
232 <ColumnDefinition Width="*"/>
233 <ColumnDefinition Width="50"/>
234 </Grid.ColumnDefinitions>
atraczyk2425ddd2016-09-01 13:16:22 -0400235 <Ellipse
236 x:Name="_selectedAccountAvatarContainer_"
237 Height="80"
238 Width="80"
239 Grid.Column="0"
240 Margin="5">
241 <Ellipse.Fill>
242 <ImageBrush
243 x:Name="_selectedAccountAvatar_"
244 ImageSource="Assets\TESTS\contactAvatar.png"/>
245 </Ellipse.Fill>
246 </Ellipse>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400247 <StackPanel Grid.Column="1"
248 VerticalAlignment="Bottom">
atraczyk4a8cffc2016-08-25 20:01:25 -0400249 <TextBlock x:Name="_selectedAccountName_"
250 Text="default name"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400251 Margin="10"
252 Style="{StaticResource TextStyle2}"/>
253 <StackPanel Orientation="Horizontal">
254 <!--Content="&#xE0A1;-->
255 <ToggleButton x:Name="_accountsMenuButton_"
256 VerticalAlignment="Bottom"
257 Content="&#xE168;"
258 Checked="_accountsMenuButton__Checked"
259 Unchecked="_accountsMenuButton__Unchecked"
260 Style="{StaticResource ToggleButtonStyle1}"/>
261 <ToggleButton x:Name="_shareMenuButton_"
262 VerticalAlignment="Bottom"
263 Content="&#xE72D;"
264 Checked="_shareMenuButton__Checked"
265 Unchecked="_shareMenuButton__Unchecked"
266 Style="{StaticResource ToggleButtonStyle1}"/>
267 </StackPanel>
268 </StackPanel>
269 <ToggleButton x:Name="_settingsTBtn_"
270 Grid.Column="2"
271 VerticalAlignment="Bottom"
272 Content="&#xE115;"
273 Checked="_settings__Checked"
274 Unchecked="_settings__Unchecked"
275 Style="{StaticResource ToggleButtonStyle1}"/>
276 </Grid>
277
278 <!--sub menus like the accounts list or the share menu are just below, technicaly they are nested inside the
279 same row. To sumon them we use the visibility of their own grid, by linking it to a toggle button-->
280
281 <!-- accounts menu. -->
282 <Grid x:Name="_accountsMenuGrid_"
283 MaxHeight="350"
284 Grid.Row="1"
285 Visibility="Collapsed"
286 Background="LightBlue">
287 <Grid.RowDefinitions>
288 <RowDefinition Height="*"/>
289 <RowDefinition Height="30"/>
290 </Grid.RowDefinitions>
atraczyk196936e2016-09-02 15:31:53 -0400291 <ScrollViewer x:Name="_accountsListScrollView_"
292 ScrollViewer.VerticalScrollBarVisibility="Auto"
293 ScrollViewer.VerticalScrollMode="Enabled">
294 <ListBox x:Name="_accountsList_"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400295 Grid.Row="0"
atraczyk4a8cffc2016-08-25 20:01:25 -0400296 SelectionChanged="_accountList__SelectionChanged"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400297 Width="320"
298 ItemContainerStyle="{StaticResource contactsListBoxStyle}"
299 Background="#FFE4F1F9"
300 ItemTemplate="{StaticResource AccountTemplate}"/>
atraczyk196936e2016-09-02 15:31:53 -0400301 </ScrollViewer>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400302 <Button x:Name="_addAccountBtn_"
303 Grid.Row="1"
304 VerticalAlignment="Center"
305 HorizontalAlignment="Center"
306 Content="&#xE948;"
307 Click="_addAccountBtn__Click"
308 Style="{StaticResource ButtonStyle2}"/>
309 </Grid>
310 <!-- account creation menu. -->
311 <Grid x:Name="_accountCreationMenuGrid_"
312 Grid.Row="2"
313 Visibility="Collapsed"
314 Background="LightBlue">
315 <Grid.RowDefinitions>
316 <RowDefinition Height="*"/>
317 <RowDefinition Height="30"/>
318 </Grid.RowDefinitions>
319 <StackPanel Orientation="Vertical"
320 Grid.Row="0"
321 Background="#FFE4F1F9">
322 <StackPanel Orientation="Horizontal">
323 <TextBlock VerticalAlignment="Center"
324 Text="Account type : "
325 Margin="10,10,0,10"/>
atraczyk196936e2016-09-02 15:31:53 -0400326 <ComboBox x:Name="_accountTypeComboBox_"
327 SelectedIndex="0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400328 Margin="10"
329 VerticalAlignment="Center"
330 Width="195">
331 <ComboBoxItem Content="Ring"/>
332 <ComboBoxItem Content="Sip"/>
333 </ComboBox>
334 </StackPanel>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400335 <!-- RING account. -->
336 <StackPanel x:Name="_ringAccountCreationStack_"
337 Visibility="Visible">
atraczyk196936e2016-09-02 15:31:53 -0400338 <TextBox x:Name="_aliasTextBox_"
339 Margin="10"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400340 PlaceholderText="Enter your username"/>
341 <PasswordBox Margin="10"
342 PlaceholderText="Enter your password"/>
343 <PasswordBox Margin="10"
344 PlaceholderText="Repeat your Password"/>
345 </StackPanel>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400346 </StackPanel>
347 <!-- buttons yes/no to create the new account. -->
348 <Grid Grid.Row="1">
349 <StackPanel Orientation="Horizontal"
350 HorizontalAlignment="Center">
351 <Button x:Name="_createAccountYes_"
352 Grid.Row="1"
353 VerticalAlignment="Center"
354 HorizontalAlignment="Center"
355 Content="&#xE081;"
356 Click="_createAccountYes__Click"
atraczyk196936e2016-09-02 15:31:53 -0400357 Style="{StaticResource ButtonStyle5}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400358 <Button x:Name="_createAccountNo_"
359 Grid.Row="1"
360 VerticalAlignment="Center"
361 HorizontalAlignment="Center"
362 Content="&#xE106;"
363 Click="_createAccountNo__Click"
atraczyk196936e2016-09-02 15:31:53 -0400364 Style="{StaticResource ButtonStyle5}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400365 </StackPanel>
366 </Grid>
367 </Grid>
368 <!-- share menu. -->
369 <Grid x:Name="_shareMenuGrid_"
370 Grid.Row="2"
371 Visibility="Collapsed"
372 Background="LightBlue">
373 <Grid.RowDefinitions>
374 <RowDefinition Height="*"/>
375 <RowDefinition Height="30"/>
376 </Grid.RowDefinitions>
377 <Grid Background="#FFE4F1F9">
378 <Grid.RowDefinitions>
379 <RowDefinition Height="*"/>
380 <RowDefinition Height="auto"/>
381 <RowDefinition Height="auto"/>
382 </Grid.RowDefinitions>
383 <Image x:Name="_selectedAccountQrCode_"
384 Source="Assets\TESTS\qrcode.png"
385 Width="200"
386 Margin="5"
387 Grid.Row="0"
388 Height="200"/>
389 <TextBlock Text="RingId:"
390 Grid.Row="1"
391 HorizontalAlignment="Center"/>
392 <TextBox Style="{StaticResource TextBoxStyle2}"
393 HorizontalAlignment="Center"
394 Text="c4fc649aed8b2497a5e98fd2d856222f07020044"
395 Grid.Row="2"/>
396 </Grid>
397 </Grid>
398 </Grid>
Nicolas Jager7c409f32016-09-08 09:35:16 -0400399 <!-- smartList and settings. -->
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400400 <Grid Grid.Row="1">
Nicolas Jager7c409f32016-09-08 09:35:16 -0400401 <!-- contacts + calls => smartpanelitems. -->
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400402 <Grid x:Name="_smartGrid_"
403 Grid.Row="0">
404 <Grid.RowDefinitions>
405 <RowDefinition x:Name="_rowRingTxtBx_"
406 Height="40"/>
407 <RowDefinition Height="*"/>
408 </Grid.RowDefinitions>
409 <TextBox x:Name="_ringTxtBx_"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400410 HorizontalAlignment="Center"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400411 VerticalAlignment="Center"
412 Width="320"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400413 TextWrapping="Wrap"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400414 Style="{StaticResource TextBoxStyle1}"
atraczyk82f8dda2016-08-25 16:34:52 -0400415 KeyDown="_ringTxtBx__KeyDown"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400416 Text=""/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400417 <ListBox x:Name="_smartList_"
418 Grid.Row="1"
419 Margin="0"
420 Padding="0"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400421 SelectionChanged="_smartList__SelectionChanged"
422 ScrollViewer.HorizontalScrollBarVisibility="Auto"
423 ScrollViewer.HorizontalScrollMode="Enabled"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400424 ItemContainerStyle="{StaticResource contactsListBoxStyle}"
Nicolas Jager7c409f32016-09-08 09:35:16 -0400425 ItemTemplate="{StaticResource SmartPanelItemsTemplate}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400426 </Grid>
427 <!-- settings. -->
428 <Grid x:Name="_settings_"
429 Grid.Row="0"
430 Visibility="Collapsed">
431 <TextBlock>some settings</TextBlock>
432 </Grid>
433 </Grid>
Nicolas Jager998fbd72016-08-08 11:41:28 -0400434 </Grid>
435
436</Page>