blob: 0be508501ce5c3c67b9c4dd10640bac15dd6adc6 [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">
atraczyk4a8cffc2016-08-25 20:01:25 -0400184 <TextBlock x:Name="_selectedAccountName_"
185 Text="default name"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400186 Margin="10"
187 Style="{StaticResource TextStyle2}"/>
188 <StackPanel Orientation="Horizontal">
189 <!--Content="&#xE0A1;-->
190 <ToggleButton x:Name="_accountsMenuButton_"
191 VerticalAlignment="Bottom"
192 Content="&#xE168;"
193 Checked="_accountsMenuButton__Checked"
194 Unchecked="_accountsMenuButton__Unchecked"
195 Style="{StaticResource ToggleButtonStyle1}"/>
196 <ToggleButton x:Name="_shareMenuButton_"
197 VerticalAlignment="Bottom"
198 Content="&#xE72D;"
199 Checked="_shareMenuButton__Checked"
200 Unchecked="_shareMenuButton__Unchecked"
201 Style="{StaticResource ToggleButtonStyle1}"/>
202 </StackPanel>
203 </StackPanel>
204 <ToggleButton x:Name="_settingsTBtn_"
205 Grid.Column="2"
206 VerticalAlignment="Bottom"
207 Content="&#xE115;"
208 Checked="_settings__Checked"
209 Unchecked="_settings__Unchecked"
210 Style="{StaticResource ToggleButtonStyle1}"/>
211 </Grid>
212
213 <!--sub menus like the accounts list or the share menu are just below, technicaly they are nested inside the
214 same row. To sumon them we use the visibility of their own grid, by linking it to a toggle button-->
215
216 <!-- accounts menu. -->
217 <Grid x:Name="_accountsMenuGrid_"
218 MaxHeight="350"
219 Grid.Row="1"
220 Visibility="Collapsed"
221 Background="LightBlue">
222 <Grid.RowDefinitions>
223 <RowDefinition Height="*"/>
224 <RowDefinition Height="30"/>
225 </Grid.RowDefinitions>
226 <ListBox x:Name="_accountsList_"
227 Grid.Row="0"
atraczyk4a8cffc2016-08-25 20:01:25 -0400228 SelectionChanged="_accountList__SelectionChanged"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400229 ScrollViewer.HorizontalScrollBarVisibility="Auto"
230 ScrollViewer.HorizontalScrollMode="Enabled"
231 Width="320"
232 ItemContainerStyle="{StaticResource contactsListBoxStyle}"
233 Background="#FFE4F1F9"
234 ItemTemplate="{StaticResource AccountTemplate}"/>
235 <Button x:Name="_addAccountBtn_"
236 Grid.Row="1"
237 VerticalAlignment="Center"
238 HorizontalAlignment="Center"
239 Content="&#xE948;"
240 Click="_addAccountBtn__Click"
241 Style="{StaticResource ButtonStyle2}"/>
242 </Grid>
243 <!-- account creation menu. -->
244 <Grid x:Name="_accountCreationMenuGrid_"
245 Grid.Row="2"
246 Visibility="Collapsed"
247 Background="LightBlue">
248 <Grid.RowDefinitions>
249 <RowDefinition Height="*"/>
250 <RowDefinition Height="30"/>
251 </Grid.RowDefinitions>
252 <StackPanel Orientation="Vertical"
253 Grid.Row="0"
254 Background="#FFE4F1F9">
255 <StackPanel Orientation="Horizontal">
256 <TextBlock VerticalAlignment="Center"
257 Text="Account type : "
258 Margin="10,10,0,10"/>
259 <ComboBox SelectedIndex="0"
260 Margin="10"
261 VerticalAlignment="Center"
262 Width="195">
263 <ComboBoxItem Content="Ring"/>
264 <ComboBoxItem Content="Sip"/>
265 </ComboBox>
266 </StackPanel>
267 <Button x:Name="_avatarWebcamCaptureBtn_"
268 VerticalAlignment="Center"
269 Content="&#xE8B8;"
270 Style="{StaticResource ButtonStyle3}"
271 Click="_avatarWebcamCaptureBtn__Click"
272 HorizontalAlignment="Center"/>
273 <!-- RING account. -->
274 <StackPanel x:Name="_ringAccountCreationStack_"
275 Visibility="Visible">
276 <TextBox Margin="10"
277 PlaceholderText="Enter your username"/>
278 <PasswordBox Margin="10"
279 PlaceholderText="Enter your password"/>
280 <PasswordBox Margin="10"
281 PlaceholderText="Repeat your Password"/>
282 </StackPanel>
283 <!-- SIP account. -->
284 <StackPanel x:Name="_sipAccountCreationStack_"
285 Visibility="Collapsed">
286 <TextBox Margin="10"
287 PlaceholderText="Enter hostname"/>
288 <TextBox Margin="10"
289 PlaceholderText="Enter your username"/>
290 <PasswordBox Margin="10"
291 PlaceholderText="Enter your password"/>
292 <PasswordBox Margin="10"
293 PlaceholderText="Repeat your Password"/>
294 </StackPanel>
295 </StackPanel>
296 <!-- buttons yes/no to create the new account. -->
297 <Grid Grid.Row="1">
298 <StackPanel Orientation="Horizontal"
299 HorizontalAlignment="Center">
300 <Button x:Name="_createAccountYes_"
301 Grid.Row="1"
302 VerticalAlignment="Center"
303 HorizontalAlignment="Center"
304 Content="&#xE081;"
305 Click="_createAccountYes__Click"
306 Style="{StaticResource ButtonStyle2}"/>
307 <Button x:Name="_createAccountNo_"
308 Grid.Row="1"
309 VerticalAlignment="Center"
310 HorizontalAlignment="Center"
311 Content="&#xE106;"
312 Click="_createAccountNo__Click"
313 Style="{StaticResource ButtonStyle2}"/>
314 </StackPanel>
315 </Grid>
316 </Grid>
317 <!-- share menu. -->
318 <Grid x:Name="_shareMenuGrid_"
319 Grid.Row="2"
320 Visibility="Collapsed"
321 Background="LightBlue">
322 <Grid.RowDefinitions>
323 <RowDefinition Height="*"/>
324 <RowDefinition Height="30"/>
325 </Grid.RowDefinitions>
326 <Grid Background="#FFE4F1F9">
327 <Grid.RowDefinitions>
328 <RowDefinition Height="*"/>
329 <RowDefinition Height="auto"/>
330 <RowDefinition Height="auto"/>
331 </Grid.RowDefinitions>
332 <Image x:Name="_selectedAccountQrCode_"
333 Source="Assets\TESTS\qrcode.png"
334 Width="200"
335 Margin="5"
336 Grid.Row="0"
337 Height="200"/>
338 <TextBlock Text="RingId:"
339 Grid.Row="1"
340 HorizontalAlignment="Center"/>
341 <TextBox Style="{StaticResource TextBoxStyle2}"
342 HorizontalAlignment="Center"
343 Text="c4fc649aed8b2497a5e98fd2d856222f07020044"
344 Grid.Row="2"/>
345 </Grid>
346 </Grid>
347 </Grid>
348 <!-- contact list and settings. -->
349 <Grid Grid.Row="1">
350 <!-- contacts list. -->
351 <Grid x:Name="_smartGrid_"
352 Grid.Row="0">
353 <Grid.RowDefinitions>
354 <RowDefinition x:Name="_rowRingTxtBx_"
355 Height="40"/>
356 <RowDefinition Height="*"/>
357 </Grid.RowDefinitions>
358 <TextBox x:Name="_ringTxtBx_"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400359 HorizontalAlignment="Center"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400360 VerticalAlignment="Center"
361 Width="320"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400362 TextWrapping="Wrap"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400363 Style="{StaticResource TextBoxStyle1}"
atraczyk82f8dda2016-08-25 16:34:52 -0400364 KeyDown="_ringTxtBx__KeyDown"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400365 Text=""/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400366 <ListBox x:Name="_smartList_"
367 Grid.Row="1"
368 Margin="0"
369 Padding="0"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400370 SelectionChanged="_smartList__SelectionChanged"
371 ScrollViewer.HorizontalScrollBarVisibility="Auto"
372 ScrollViewer.HorizontalScrollMode="Enabled"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400373 ItemContainerStyle="{StaticResource contactsListBoxStyle}"
374 ItemTemplate="{StaticResource ContactTemplate}"/>
375 </Grid>
376 <!-- settings. -->
377 <Grid x:Name="_settings_"
378 Grid.Row="0"
379 Visibility="Collapsed">
380 <TextBlock>some settings</TextBlock>
381 </Grid>
382 </Grid>
Nicolas Jager998fbd72016-08-08 11:41:28 -0400383 </Grid>
384
385</Page>