blob: 41d32d96117cc390491485f830d1c44ec27d745f [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"
22 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
23 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
24 mc:Ignorable="d">
25
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040026 <Page.Resources>
27 <!-- template for contacts. -->
28 <DataTemplate x:Key="ContactTemplate"
29 x:DataType="local:Contact">
30 <Grid>
31 <Grid.RowDefinitions>
32 <RowDefinition Height="60"/>
33 <!-- use the height of _contactBar_ to make it visible or collapsed. -->
34 <RowDefinition x:Name="_contactBar_"
35 Height="0"/>
36 </Grid.RowDefinitions>
37 <Grid Grid.Row="0">
38 <Grid.ColumnDefinitions>
39 <ColumnDefinition Width="60"/>
40 <ColumnDefinition Width="*"
41 MinWidth="200"/>
42 </Grid.ColumnDefinitions>
43 <Image x:Name="_contactAvatar_"
44 VerticalAlignment="Center"
45 HorizontalAlignment="Center"
46 Grid.Column="0"
47 Width="55"
48 Height="55"
49 Source="Assets\TESTS\contactAvatar.png"/>
50 <!-- visual notifications. -->
51 <Border x:Name="_visualNotificationVideoChat_"
52 Visibility="Collapsed"
53 Style="{StaticResource BorderStyle1}">
54 <TextBlock Text="&#xE8AA;"
55 Style="{StaticResource TextSegoeStyle1}"/>
56 <Border.RenderTransform>
57 <TranslateTransform X="17" Y="-14"/>
58 </Border.RenderTransform>
59 </Border>
60 <Border x:Name="_visualNotificationNewMessage_"
61 Visibility="Collapsed"
62 Style="{StaticResource BorderStyle2}">
63 <TextBlock Text="0"
64 Style="{StaticResource TextStyle3}"/>
65 <Border.RenderTransform>
66 <TranslateTransform X="-17" Y="-14"/>
67 </Border.RenderTransform>
68 </Border>
69 <!-- name of the contact. -->
70 <TextBlock x:Name="_contactName_"
71 Grid.Column="1"
72 FontSize="20"
73 Text="{x:Bind name_}">
74 <TextBlock.RenderTransform>
75 <TranslateTransform X="8" Y="3"/>
76 </TextBlock.RenderTransform>
77 </TextBlock>
78 </Grid>
79 <!-- button bar for accept/reject or cancel call. -->
80 <!-- nb : dont use Visibility with the grid, use the height of the hosting row (_contactBar_). -->
81 <Grid Width="320"
82 HorizontalAlignment="Left"
83 Grid.Row="1"
84 Background="DarkGray">
85 <StackPanel Orientation="Horizontal"
86 HorizontalAlignment="Center">
87 <Button x:Name="_acceptIncomingCallBtn_"
88 VerticalAlignment="Center"
89 HorizontalAlignment="Center"
90 Style="{StaticResource ButtonStyle2}"
91 Content="&#xE10B;"/>
92 <Button x:Name="_rejectIncomingCallBtn_"
93 VerticalAlignment="Center"
94 HorizontalAlignment="Center"
95 Style="{StaticResource ButtonStyle2}"
96 Content="&#xE106;"/>
97 </StackPanel>
98 <TextBlock x:Name="_contactCallStatus_"
99 Foreground="DarkGray"
100 Text="Incoming call"
101 HorizontalAlignment="Center">
102 <TextBlock.RenderTransform>
103 <TranslateTransform Y="-30"/>
104 </TextBlock.RenderTransform>
105 </TextBlock>
106 </Grid>
107 </Grid>
108 </DataTemplate>
109 <!-- template for accounts. -->
110 <DataTemplate x:Key="AccountTemplate"
111 x:DataType="local:Account">
112 <Grid>
113 <Grid.ColumnDefinitions>
114 <ColumnDefinition Width="60"/>
atraczyk8ce1dee2016-08-25 18:15:07 -0400115 <ColumnDefinition Width="200"/>
116 <ColumnDefinition Width="60"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400117 </Grid.ColumnDefinitions>
atraczyk8ce1dee2016-08-25 18:15:07 -0400118 <Grid.RowDefinitions>
119 <RowDefinition Height="30"/>
120 <RowDefinition Height="30"/>
121 </Grid.RowDefinitions>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400122 <Image x:Name="_accountAvatar_"
123 VerticalAlignment="Center"
124 HorizontalAlignment="Center"
125 Grid.Column="0"
atraczyk8ce1dee2016-08-25 18:15:07 -0400126 Grid.RowSpan="2"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400127 Width="55"
128 Height="55"
129 Source="Assets\TESTS\contactAvatar.png"/>
130 <TextBlock x:Name="_accountName_"
131 Grid.Column="1"
atraczyk8ce1dee2016-08-25 18:15:07 -0400132 Grid.Row="0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400133 Text="{x:Bind name_}"/>
atraczyk8ce1dee2016-08-25 18:15:07 -0400134 <TextBlock x:Name="_accountType_"
135 Grid.Column="2"
136 Grid.Row="0"
137 TextAlignment="Right"
138 Margin="0,0,10,0"
139 Foreground="ForestGreen"
140 Text="{x:Bind accountType_}"/>
141 <TextBlock x:Name="_ringID_"
142 Grid.Column="1"
143 Grid.ColumnSpan="2"
144 Grid.Row="1"
145 Foreground="Crimson"
146 TextTrimming="CharacterEllipsis"
147 Text="{x:Bind ringID_}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400148 </Grid>
149 </DataTemplate>
150 </Page.Resources>
151
Nicolas Jager998fbd72016-08-08 11:41:28 -0400152 <Grid>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400153 <Grid.RowDefinitions>
154 <!-- where accounts and share menu drop down are. -->
155 <RowDefinition Height="auto"/>
156 <!-- where contacts and settings are. -->
157 <RowDefinition Height="*"/>
158 </Grid.RowDefinitions>
159 <!-- drop down menus. -->
160 <Grid Background="LightBlue">
161 <Grid.RowDefinitions>
162 <!-- where the selected account is shown. -->
163 <RowDefinition x:Name="_selectedAccountRow_"
164 Height="90"/>
165 <!-- where the drop down menus are shown. -->
166 <RowDefinition Height="auto"/>
167 </Grid.RowDefinitions>
168 <!-- selected account. -->
169 <Grid Grid.Row="0">
170 <Grid.ColumnDefinitions>
171 <ColumnDefinition x:Name="_selectedAccountAvatarColumn_"
172 Width="90"/>
173 <ColumnDefinition Width="*"/>
174 <ColumnDefinition Width="50"/>
175 </Grid.ColumnDefinitions>
176 <Image x:Name="_selectedAccountAvatar_"
177 Source="Assets\TESTS\contactAvatar.png"
178 Width="80"
179 Margin="5"
180 Grid.Column="0"
181 Height="80"/>
182 <StackPanel Grid.Column="1"
183 VerticalAlignment="Bottom">
184 <TextBlock Text="TOT fdsfds fdsO"
185 Margin="10"
186 Style="{StaticResource TextStyle2}"/>
187 <StackPanel Orientation="Horizontal">
188 <!--Content="&#xE0A1;-->
189 <ToggleButton x:Name="_accountsMenuButton_"
190 VerticalAlignment="Bottom"
191 Content="&#xE168;"
192 Checked="_accountsMenuButton__Checked"
193 Unchecked="_accountsMenuButton__Unchecked"
194 Style="{StaticResource ToggleButtonStyle1}"/>
195 <ToggleButton x:Name="_shareMenuButton_"
196 VerticalAlignment="Bottom"
197 Content="&#xE72D;"
198 Checked="_shareMenuButton__Checked"
199 Unchecked="_shareMenuButton__Unchecked"
200 Style="{StaticResource ToggleButtonStyle1}"/>
201 </StackPanel>
202 </StackPanel>
203 <ToggleButton x:Name="_settingsTBtn_"
204 Grid.Column="2"
205 VerticalAlignment="Bottom"
206 Content="&#xE115;"
207 Checked="_settings__Checked"
208 Unchecked="_settings__Unchecked"
209 Style="{StaticResource ToggleButtonStyle1}"/>
210 </Grid>
211
212 <!--sub menus like the accounts list or the share menu are just below, technicaly they are nested inside the
213 same row. To sumon them we use the visibility of their own grid, by linking it to a toggle button-->
214
215 <!-- accounts menu. -->
216 <Grid x:Name="_accountsMenuGrid_"
217 MaxHeight="350"
218 Grid.Row="1"
219 Visibility="Collapsed"
220 Background="LightBlue">
221 <Grid.RowDefinitions>
222 <RowDefinition Height="*"/>
223 <RowDefinition Height="30"/>
224 </Grid.RowDefinitions>
225 <ListBox x:Name="_accountsList_"
226 Grid.Row="0"
227 ScrollViewer.HorizontalScrollBarVisibility="Auto"
228 ScrollViewer.HorizontalScrollMode="Enabled"
229 Width="320"
230 ItemContainerStyle="{StaticResource contactsListBoxStyle}"
231 Background="#FFE4F1F9"
232 ItemTemplate="{StaticResource AccountTemplate}"/>
233 <Button x:Name="_addAccountBtn_"
234 Grid.Row="1"
235 VerticalAlignment="Center"
236 HorizontalAlignment="Center"
237 Content="&#xE948;"
238 Click="_addAccountBtn__Click"
239 Style="{StaticResource ButtonStyle2}"/>
240 </Grid>
241 <!-- account creation menu. -->
242 <Grid x:Name="_accountCreationMenuGrid_"
243 Grid.Row="2"
244 Visibility="Collapsed"
245 Background="LightBlue">
246 <Grid.RowDefinitions>
247 <RowDefinition Height="*"/>
248 <RowDefinition Height="30"/>
249 </Grid.RowDefinitions>
250 <StackPanel Orientation="Vertical"
251 Grid.Row="0"
252 Background="#FFE4F1F9">
253 <StackPanel Orientation="Horizontal">
254 <TextBlock VerticalAlignment="Center"
255 Text="Account type : "
256 Margin="10,10,0,10"/>
257 <ComboBox SelectedIndex="0"
258 Margin="10"
259 VerticalAlignment="Center"
260 Width="195">
261 <ComboBoxItem Content="Ring"/>
262 <ComboBoxItem Content="Sip"/>
263 </ComboBox>
264 </StackPanel>
265 <Button x:Name="_avatarWebcamCaptureBtn_"
266 VerticalAlignment="Center"
267 Content="&#xE8B8;"
268 Style="{StaticResource ButtonStyle3}"
269 Click="_avatarWebcamCaptureBtn__Click"
270 HorizontalAlignment="Center"/>
271 <!-- RING account. -->
272 <StackPanel x:Name="_ringAccountCreationStack_"
273 Visibility="Visible">
274 <TextBox Margin="10"
275 PlaceholderText="Enter your username"/>
276 <PasswordBox Margin="10"
277 PlaceholderText="Enter your password"/>
278 <PasswordBox Margin="10"
279 PlaceholderText="Repeat your Password"/>
280 </StackPanel>
281 <!-- SIP account. -->
282 <StackPanel x:Name="_sipAccountCreationStack_"
283 Visibility="Collapsed">
284 <TextBox Margin="10"
285 PlaceholderText="Enter hostname"/>
286 <TextBox Margin="10"
287 PlaceholderText="Enter your username"/>
288 <PasswordBox Margin="10"
289 PlaceholderText="Enter your password"/>
290 <PasswordBox Margin="10"
291 PlaceholderText="Repeat your Password"/>
292 </StackPanel>
293 </StackPanel>
294 <!-- buttons yes/no to create the new account. -->
295 <Grid Grid.Row="1">
296 <StackPanel Orientation="Horizontal"
297 HorizontalAlignment="Center">
298 <Button x:Name="_createAccountYes_"
299 Grid.Row="1"
300 VerticalAlignment="Center"
301 HorizontalAlignment="Center"
302 Content="&#xE081;"
303 Click="_createAccountYes__Click"
304 Style="{StaticResource ButtonStyle2}"/>
305 <Button x:Name="_createAccountNo_"
306 Grid.Row="1"
307 VerticalAlignment="Center"
308 HorizontalAlignment="Center"
309 Content="&#xE106;"
310 Click="_createAccountNo__Click"
311 Style="{StaticResource ButtonStyle2}"/>
312 </StackPanel>
313 </Grid>
314 </Grid>
315 <!-- share menu. -->
316 <Grid x:Name="_shareMenuGrid_"
317 Grid.Row="2"
318 Visibility="Collapsed"
319 Background="LightBlue">
320 <Grid.RowDefinitions>
321 <RowDefinition Height="*"/>
322 <RowDefinition Height="30"/>
323 </Grid.RowDefinitions>
324 <Grid Background="#FFE4F1F9">
325 <Grid.RowDefinitions>
326 <RowDefinition Height="*"/>
327 <RowDefinition Height="auto"/>
328 <RowDefinition Height="auto"/>
329 </Grid.RowDefinitions>
330 <Image x:Name="_selectedAccountQrCode_"
331 Source="Assets\TESTS\qrcode.png"
332 Width="200"
333 Margin="5"
334 Grid.Row="0"
335 Height="200"/>
336 <TextBlock Text="RingId:"
337 Grid.Row="1"
338 HorizontalAlignment="Center"/>
339 <TextBox Style="{StaticResource TextBoxStyle2}"
340 HorizontalAlignment="Center"
341 Text="c4fc649aed8b2497a5e98fd2d856222f07020044"
342 Grid.Row="2"/>
343 </Grid>
344 </Grid>
345 </Grid>
346 <!-- contact list and settings. -->
347 <Grid Grid.Row="1">
348 <!-- contacts list. -->
349 <Grid x:Name="_smartGrid_"
350 Grid.Row="0">
351 <Grid.RowDefinitions>
352 <RowDefinition x:Name="_rowRingTxtBx_"
353 Height="40"/>
354 <RowDefinition Height="*"/>
355 </Grid.RowDefinitions>
356 <TextBox x:Name="_ringTxtBx_"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400357 HorizontalAlignment="Center"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400358 VerticalAlignment="Center"
359 Width="320"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400360 TextWrapping="Wrap"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400361 Style="{StaticResource TextBoxStyle1}"
atraczyk82f8dda2016-08-25 16:34:52 -0400362 KeyDown="_ringTxtBx__KeyDown"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400363 Text=""/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400364 <ListBox x:Name="_smartList_"
365 Grid.Row="1"
366 Margin="0"
367 Padding="0"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400368 SelectionChanged="_smartList__SelectionChanged"
369 ScrollViewer.HorizontalScrollBarVisibility="Auto"
370 ScrollViewer.HorizontalScrollMode="Enabled"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400371 ItemContainerStyle="{StaticResource contactsListBoxStyle}"
372 ItemTemplate="{StaticResource ContactTemplate}"/>
373 </Grid>
374 <!-- settings. -->
375 <Grid x:Name="_settings_"
376 Grid.Row="0"
377 Visibility="Collapsed">
378 <TextBlock>some settings</TextBlock>
379 </Grid>
380 </Grid>
Nicolas Jager998fbd72016-08-08 11:41:28 -0400381 </Grid>
382
383</Page>