blob: 65d05435c8a82b63c0dfb96d2a3f5ec5311122a2 [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_"
Nicolas Jagerf6a10322016-09-06 08:17:49 -040035 Height="{x:Bind _contactBarHeight, Mode=OneWay}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040036 </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_"
Nicolas Jager0788e962016-08-26 15:41:06 -040061 Visibility="{x:Bind notificationNewMessage, Mode=OneWay}"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040062 Style="{StaticResource BorderStyle2}">
Nicolas Jager0788e962016-08-26 15:41:06 -040063 <TextBlock Text="{x:Bind unreadMessages, Mode=OneWay}"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040064 Style="{StaticResource TextStyle3}"/>
65 <Border.RenderTransform>
66 <TranslateTransform X="-17" Y="-14"/>
67 </Border.RenderTransform>
68 </Border>
Nicolas Jagerd76940f2016-08-31 14:44:04 -040069 <Grid Grid.Column="1">
70 <Grid.RowDefinitions>
71 <RowDefinition Height="30"/>
72 <RowDefinition Height="30"/>
73 </Grid.RowDefinitions>
74 <!-- name of the contact. -->
75 <TextBlock x:Name="_contactName_"
76 Grid.Row="0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040077 Text="{x:Bind name_}">
Nicolas Jagerd76940f2016-08-31 14:44:04 -040078 </TextBlock>
79 <!-- call status. -->
80 <StackPanel MaxWidth="240"
81 MinWidth="240"
82 Grid.Row="1"
83 HorizontalAlignment="Left">
84 <TextBlock x:Name="_contactCallStatus_"
85 Foreground="DarkGray"
86 Text="{x:Bind _call.state, Mode=OneWay}"
87 Visibility="Visible"
88 HorizontalAlignment="Center">
89 </TextBlock>
90 </StackPanel>
91 </Grid>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040092 </Grid>
93 <!-- button bar for accept/reject or cancel call. -->
94 <!-- nb : dont use Visibility with the grid, use the height of the hosting row (_contactBar_). -->
95 <Grid Width="320"
96 HorizontalAlignment="Left"
Nicolas Jagerd76940f2016-08-31 14:44:04 -040097 Grid.Row="2"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040098 Background="DarkGray">
99 <StackPanel Orientation="Horizontal"
Nicolas Jagerd76940f2016-08-31 14:44:04 -0400100 Grid.Row="0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400101 HorizontalAlignment="Center">
102 <Button x:Name="_acceptIncomingCallBtn_"
Nicolas Jagerf6a10322016-09-06 08:17:49 -0400103 Click="_acceptIncomingCallBtn__Click"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400104 VerticalAlignment="Center"
105 HorizontalAlignment="Center"
Nicolas Jagerd76940f2016-08-31 14:44:04 -0400106 Content="Accept"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400107 <Button x:Name="_rejectIncomingCallBtn_"
Nicolas Jagerf6a10322016-09-06 08:17:49 -0400108 Click="_rejectIncomingCallBtn__Click"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400109 VerticalAlignment="Center"
110 HorizontalAlignment="Center"
Nicolas Jagerd76940f2016-08-31 14:44:04 -0400111 Content="Reject"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400112 </StackPanel>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400113 </Grid>
114 </Grid>
115 </DataTemplate>
116 <!-- template for accounts. -->
117 <DataTemplate x:Key="AccountTemplate"
118 x:DataType="local:Account">
119 <Grid>
120 <Grid.ColumnDefinitions>
atraczyk2425ddd2016-09-01 13:16:22 -0400121 <ColumnDefinition Width="260"/>
atraczyk8ce1dee2016-08-25 18:15:07 -0400122 <ColumnDefinition Width="60"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400123 </Grid.ColumnDefinitions>
atraczyk8ce1dee2016-08-25 18:15:07 -0400124 <Grid.RowDefinitions>
125 <RowDefinition Height="30"/>
126 <RowDefinition Height="30"/>
127 </Grid.RowDefinitions>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400128 <TextBlock x:Name="_accountName_"
atraczyk2425ddd2016-09-01 13:16:22 -0400129 Grid.Column="0"
atraczyk8ce1dee2016-08-25 18:15:07 -0400130 Grid.Row="0"
atraczyk2425ddd2016-09-01 13:16:22 -0400131 Margin="10,5,10,0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400132 Text="{x:Bind name_}"/>
atraczyk8ce1dee2016-08-25 18:15:07 -0400133 <TextBlock x:Name="_accountType_"
atraczyk2425ddd2016-09-01 13:16:22 -0400134 Grid.Column="1"
atraczyk8ce1dee2016-08-25 18:15:07 -0400135 Grid.Row="0"
136 TextAlignment="Right"
atraczyk196936e2016-09-02 15:31:53 -0400137 Margin="0,5,18,0"
atraczyk8ce1dee2016-08-25 18:15:07 -0400138 Foreground="ForestGreen"
139 Text="{x:Bind accountType_}"/>
140 <TextBlock x:Name="_ringID_"
atraczyk2425ddd2016-09-01 13:16:22 -0400141 Grid.Column="0"
atraczyk8ce1dee2016-08-25 18:15:07 -0400142 Grid.ColumnSpan="2"
143 Grid.Row="1"
144 Foreground="Crimson"
atraczyk2425ddd2016-09-01 13:16:22 -0400145 Margin="10,5,10,0"
146 FontSize="14"
atraczyk8ce1dee2016-08-25 18:15:07 -0400147 TextTrimming="CharacterEllipsis"
148 Text="{x:Bind ringID_}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400149 </Grid>
150 </DataTemplate>
151 </Page.Resources>
152
Nicolas Jager998fbd72016-08-08 11:41:28 -0400153 <Grid>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400154 <Grid.RowDefinitions>
155 <!-- where accounts and share menu drop down are. -->
156 <RowDefinition Height="auto"/>
157 <!-- where contacts and settings are. -->
158 <RowDefinition Height="*"/>
159 </Grid.RowDefinitions>
160 <!-- drop down menus. -->
161 <Grid Background="LightBlue">
162 <Grid.RowDefinitions>
163 <!-- where the selected account is shown. -->
164 <RowDefinition x:Name="_selectedAccountRow_"
165 Height="90"/>
166 <!-- where the drop down menus are shown. -->
167 <RowDefinition Height="auto"/>
168 </Grid.RowDefinitions>
169 <!-- selected account. -->
170 <Grid Grid.Row="0">
171 <Grid.ColumnDefinitions>
172 <ColumnDefinition x:Name="_selectedAccountAvatarColumn_"
173 Width="90"/>
174 <ColumnDefinition Width="*"/>
175 <ColumnDefinition Width="50"/>
176 </Grid.ColumnDefinitions>
atraczyk2425ddd2016-09-01 13:16:22 -0400177 <Ellipse
178 x:Name="_selectedAccountAvatarContainer_"
179 Height="80"
180 Width="80"
181 Grid.Column="0"
182 Margin="5">
183 <Ellipse.Fill>
184 <ImageBrush
185 x:Name="_selectedAccountAvatar_"
186 ImageSource="Assets\TESTS\contactAvatar.png"/>
187 </Ellipse.Fill>
188 </Ellipse>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400189 <StackPanel Grid.Column="1"
190 VerticalAlignment="Bottom">
atraczyk4a8cffc2016-08-25 20:01:25 -0400191 <TextBlock x:Name="_selectedAccountName_"
192 Text="default name"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400193 Margin="10"
194 Style="{StaticResource TextStyle2}"/>
195 <StackPanel Orientation="Horizontal">
196 <!--Content="&#xE0A1;-->
197 <ToggleButton x:Name="_accountsMenuButton_"
198 VerticalAlignment="Bottom"
199 Content="&#xE168;"
200 Checked="_accountsMenuButton__Checked"
201 Unchecked="_accountsMenuButton__Unchecked"
202 Style="{StaticResource ToggleButtonStyle1}"/>
203 <ToggleButton x:Name="_shareMenuButton_"
204 VerticalAlignment="Bottom"
205 Content="&#xE72D;"
206 Checked="_shareMenuButton__Checked"
207 Unchecked="_shareMenuButton__Unchecked"
208 Style="{StaticResource ToggleButtonStyle1}"/>
209 </StackPanel>
210 </StackPanel>
211 <ToggleButton x:Name="_settingsTBtn_"
212 Grid.Column="2"
213 VerticalAlignment="Bottom"
214 Content="&#xE115;"
215 Checked="_settings__Checked"
216 Unchecked="_settings__Unchecked"
217 Style="{StaticResource ToggleButtonStyle1}"/>
218 </Grid>
219
220 <!--sub menus like the accounts list or the share menu are just below, technicaly they are nested inside the
221 same row. To sumon them we use the visibility of their own grid, by linking it to a toggle button-->
222
223 <!-- accounts menu. -->
224 <Grid x:Name="_accountsMenuGrid_"
225 MaxHeight="350"
226 Grid.Row="1"
227 Visibility="Collapsed"
228 Background="LightBlue">
229 <Grid.RowDefinitions>
230 <RowDefinition Height="*"/>
231 <RowDefinition Height="30"/>
232 </Grid.RowDefinitions>
atraczyk196936e2016-09-02 15:31:53 -0400233 <ScrollViewer x:Name="_accountsListScrollView_"
234 ScrollViewer.VerticalScrollBarVisibility="Auto"
235 ScrollViewer.VerticalScrollMode="Enabled">
236 <ListBox x:Name="_accountsList_"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400237 Grid.Row="0"
atraczyk4a8cffc2016-08-25 20:01:25 -0400238 SelectionChanged="_accountList__SelectionChanged"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400239 Width="320"
240 ItemContainerStyle="{StaticResource contactsListBoxStyle}"
241 Background="#FFE4F1F9"
242 ItemTemplate="{StaticResource AccountTemplate}"/>
atraczyk196936e2016-09-02 15:31:53 -0400243 </ScrollViewer>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400244 <Button x:Name="_addAccountBtn_"
245 Grid.Row="1"
246 VerticalAlignment="Center"
247 HorizontalAlignment="Center"
248 Content="&#xE948;"
249 Click="_addAccountBtn__Click"
250 Style="{StaticResource ButtonStyle2}"/>
251 </Grid>
252 <!-- account creation menu. -->
253 <Grid x:Name="_accountCreationMenuGrid_"
254 Grid.Row="2"
255 Visibility="Collapsed"
256 Background="LightBlue">
257 <Grid.RowDefinitions>
258 <RowDefinition Height="*"/>
259 <RowDefinition Height="30"/>
260 </Grid.RowDefinitions>
261 <StackPanel Orientation="Vertical"
262 Grid.Row="0"
263 Background="#FFE4F1F9">
264 <StackPanel Orientation="Horizontal">
265 <TextBlock VerticalAlignment="Center"
266 Text="Account type : "
267 Margin="10,10,0,10"/>
atraczyk196936e2016-09-02 15:31:53 -0400268 <ComboBox x:Name="_accountTypeComboBox_"
269 SelectedIndex="0"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400270 Margin="10"
271 VerticalAlignment="Center"
272 Width="195">
273 <ComboBoxItem Content="Ring"/>
274 <ComboBoxItem Content="Sip"/>
275 </ComboBox>
276 </StackPanel>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400277 <!-- RING account. -->
278 <StackPanel x:Name="_ringAccountCreationStack_"
279 Visibility="Visible">
atraczyk196936e2016-09-02 15:31:53 -0400280 <TextBox x:Name="_aliasTextBox_"
281 Margin="10"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400282 PlaceholderText="Enter your username"/>
283 <PasswordBox Margin="10"
284 PlaceholderText="Enter your password"/>
285 <PasswordBox Margin="10"
286 PlaceholderText="Repeat your Password"/>
287 </StackPanel>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400288 </StackPanel>
289 <!-- buttons yes/no to create the new account. -->
290 <Grid Grid.Row="1">
291 <StackPanel Orientation="Horizontal"
292 HorizontalAlignment="Center">
293 <Button x:Name="_createAccountYes_"
294 Grid.Row="1"
295 VerticalAlignment="Center"
296 HorizontalAlignment="Center"
297 Content="&#xE081;"
298 Click="_createAccountYes__Click"
atraczyk196936e2016-09-02 15:31:53 -0400299 Style="{StaticResource ButtonStyle5}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400300 <Button x:Name="_createAccountNo_"
301 Grid.Row="1"
302 VerticalAlignment="Center"
303 HorizontalAlignment="Center"
304 Content="&#xE106;"
305 Click="_createAccountNo__Click"
atraczyk196936e2016-09-02 15:31:53 -0400306 Style="{StaticResource ButtonStyle5}"/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400307 </StackPanel>
308 </Grid>
309 </Grid>
310 <!-- share menu. -->
311 <Grid x:Name="_shareMenuGrid_"
312 Grid.Row="2"
313 Visibility="Collapsed"
314 Background="LightBlue">
315 <Grid.RowDefinitions>
316 <RowDefinition Height="*"/>
317 <RowDefinition Height="30"/>
318 </Grid.RowDefinitions>
319 <Grid Background="#FFE4F1F9">
320 <Grid.RowDefinitions>
321 <RowDefinition Height="*"/>
322 <RowDefinition Height="auto"/>
323 <RowDefinition Height="auto"/>
324 </Grid.RowDefinitions>
325 <Image x:Name="_selectedAccountQrCode_"
326 Source="Assets\TESTS\qrcode.png"
327 Width="200"
328 Margin="5"
329 Grid.Row="0"
330 Height="200"/>
331 <TextBlock Text="RingId:"
332 Grid.Row="1"
333 HorizontalAlignment="Center"/>
334 <TextBox Style="{StaticResource TextBoxStyle2}"
335 HorizontalAlignment="Center"
336 Text="c4fc649aed8b2497a5e98fd2d856222f07020044"
337 Grid.Row="2"/>
338 </Grid>
339 </Grid>
340 </Grid>
341 <!-- contact list and settings. -->
342 <Grid Grid.Row="1">
343 <!-- contacts list. -->
344 <Grid x:Name="_smartGrid_"
345 Grid.Row="0">
346 <Grid.RowDefinitions>
347 <RowDefinition x:Name="_rowRingTxtBx_"
348 Height="40"/>
349 <RowDefinition Height="*"/>
350 </Grid.RowDefinitions>
351 <TextBox x:Name="_ringTxtBx_"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400352 HorizontalAlignment="Center"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400353 VerticalAlignment="Center"
354 Width="320"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400355 TextWrapping="Wrap"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400356 Style="{StaticResource TextBoxStyle1}"
atraczyk82f8dda2016-08-25 16:34:52 -0400357 KeyDown="_ringTxtBx__KeyDown"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400358 Text=""/>
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400359 <ListBox x:Name="_smartList_"
360 Grid.Row="1"
361 Margin="0"
362 Padding="0"
Nicolas Jager8a85e1f2016-08-15 15:11:06 -0400363 SelectionChanged="_smartList__SelectionChanged"
364 ScrollViewer.HorizontalScrollBarVisibility="Auto"
365 ScrollViewer.HorizontalScrollMode="Enabled"
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -0400366 ItemContainerStyle="{StaticResource contactsListBoxStyle}"
367 ItemTemplate="{StaticResource ContactTemplate}"/>
368 </Grid>
369 <!-- settings. -->
370 <Grid x:Name="_settings_"
371 Grid.Row="0"
372 Visibility="Collapsed">
373 <TextBlock>some settings</TextBlock>
374 </Grid>
375 </Grid>
Nicolas Jager998fbd72016-08-08 11:41:28 -0400376 </Grid>
377
378</Page>