Commit 1e08c70a authored by Margaux Clerc's avatar Margaux Clerc

Update contact detail interface and add email/numbers

parent 8e548786
......@@ -4,54 +4,60 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="480">
d:DesignHeight="50" d:DesignWidth="480">
<Grid x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock
x:Name="label"
Style="{ThemeResource ListItemHeaderStyle}"
VerticalAlignment="Center"
HorizontalAlignment="Left"/>
<TextBlock
Grid.Column="0"
Grid.Row="0"
Grid.Row="1"
Grid.ColumnSpan="3"
x:Name="phone"
FontSize="30"
Style="{ThemeResource ListItemStyle}"
VerticalAlignment="Center"
HorizontalAlignment="Left" />
<TextBlock
Grid.Column="2"
Grid.Row="1"
x:Name="label"
FontSize="20"
VerticalAlignment="Center"
HorizontalAlignment="Center"/>
<Button
x:Name="button"
Grid.Column="0"
Grid.Column="1"
Grid.Row="1"
BorderThickness="0"
Style="{ThemeResource ButtonStyle}"
Background="Transparent"
VerticalAlignment="Center">
<Image x:Name="action2" Width="48" Height="48">
</Image>
<FontIcon x:Name="action2" FontFamily="Segoe MDL2 Assets" Glyph="&#xE717;" RenderTransformOrigin="0.5,0.5">
<FontIcon.RenderTransform>
<CompositeTransform ScaleX=".75" ScaleY=".75"/>
</FontIcon.RenderTransform>
</FontIcon>
</Button>
<Button
x:Name="button2"
Grid.Column="1"
Grid.Column="2"
Grid.Row="1"
BorderThickness="0"
Style="{ThemeResource ButtonStyle}"
Background="Transparent"
VerticalAlignment="Center">
<Image x:Name="action" Width="48" Height="48">
</Image>
<FontIcon x:Name="action" FontFamily="Segoe MDL2 Assets" Glyph="&#xE8BD;" RenderTransformOrigin="0.5,0.5">
<FontIcon.RenderTransform>
<CompositeTransform ScaleX=".75" ScaleY=".75"/>
</FontIcon.RenderTransform>
</FontIcon>
</Button>
</Grid>
</UserControl>
\ No newline at end of file
......@@ -22,15 +22,11 @@ using Windows.UI.Xaml.Media.Imaging;
namespace Linphone.Controls
{
/// <summary>
/// Custom user control representing a possible action on a phone number or email (in the Contact.xaml view).
/// </summary>
public partial class ContactAction : UserControl
{
private String _action;
/// <summary>
/// URI of an Image that represents the action.
/// </summary>
public String Action
{
get
......@@ -40,14 +36,11 @@ namespace Linphone.Controls
set
{
_action = value;
action2.Source = new BitmapImage(new Uri(value, UriKind.RelativeOrAbsolute)); ;
}
}
private String _action2;
/// <summary>
/// URI of an Image that represents the action.
/// </summary>
public String Action2
{
get
......@@ -57,14 +50,11 @@ namespace Linphone.Controls
set
{
_action2 = value;
action.Source = new BitmapImage(new Uri(value, UriKind.RelativeOrAbsolute)); ;
}
}
private String _label;
/// <summary>
/// Label of the phone number or the email displayed.
/// </summary>
public String Label
{
get
......@@ -79,9 +69,7 @@ namespace Linphone.Controls
}
private String _numberOrAddress;
/// <summary>
/// Phone number or email address to display.
/// </summary>
public String NumberOrAddress
{
get
......@@ -95,9 +83,6 @@ namespace Linphone.Controls
}
}
/// <summary>
/// Event triggered when action image is clicked.
/// </summary>
public RoutedEventHandler Click
{
set
......@@ -108,9 +93,6 @@ namespace Linphone.Controls
get { return null; }
}
/// <summary>
/// Event triggered when action image is clicked.
/// </summary>
public RoutedEventHandler Click2
{
set
......@@ -121,9 +103,6 @@ namespace Linphone.Controls
get { return null; }
}
/// <summary>
/// Public constructor.
/// </summary>
public ContactAction()
{
InitializeComponent();
......
......@@ -15,6 +15,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using Windows.ApplicationModel.Contacts;
using Windows.Storage.Streams;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
......@@ -26,8 +28,8 @@ namespace Linphone.Helpers
private string contactId;
private string contactName;
private ImageSource contactImage;
private string contactNumber;
private string contactEmail;
private IEnumerable<ContactPhone> contactPhones;
private IEnumerable<ContactEmail> contactEmails;
public ContactItem(string ContactId, string ContactName)
{
......@@ -75,5 +77,31 @@ namespace Linphone.Helpers
return contactImage;
}
}
public IEnumerable<ContactPhone> ContactPhones
{
get
{
return contactPhones;
}
set
{
contactPhones = value;
}
}
public IEnumerable<ContactEmail> ContactEmails
{
get
{
return contactEmails;
}
set
{
contactEmails = value;
}
}
}
}
......@@ -292,6 +292,8 @@ namespace Linphone.Model
foreach (Contact c in contactBatch.Contacts)
{
ContactItem contactToAdd = new ContactItem(c.Id, c.DisplayName);
contactToAdd.ContactEmails = c.Emails;
contactToAdd.ContactPhones = c.Phones;
contactToAdd.SetImageAsync(c.Thumbnail);
contactItems.Add(contactToAdd);
}
......
This diff is collapsed.
......@@ -17,26 +17,28 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="12,12,12,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Margin="12,12,12,0" Grid.Column="0" Grid.ColumnSpan="2">
<TextBlock x:Uid="ContactsMenu" Text="CONTACT" Style="{StaticResource HeaderTextStyle}" />
</StackPanel>
<Ellipse Width="50" Height="50" VerticalAlignment="Center" Grid.Row="1">
<Ellipse Width="50" Height="50" Margin="12" VerticalAlignment="Center" Grid.Row="1">
<Ellipse.Fill>
<ImageBrush x:Name="contactPicture" ImageSource="{Binding ContactImage}"/>
</Ellipse.Fill>
</Ellipse>
<StackPanel Grid.Row="2">
<!--<TextBlock Text="" Style="{StaticResource PhoneTextNormalStyle}"/>-->
<TextBlock x:Name="contactName" TextWrapping="Wrap" Margin="9,-7,0,0" />
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="0,12,12,12" VerticalAlignment="Center">
<TextBlock x:Name="contactName" Style="{ThemeResource ListItemHeaderStyle}" TextWrapping="Wrap"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="3" Margin="12,0,12,0">
<Grid x:Name="ContentPanel" Grid.Row="3" Grid.Column="0" Margin="12,0,12,0" Grid.ColumnSpan="2">
<ScrollViewer>
<StackPanel x:Name="actions" Orientation="Vertical" Margin="20,0,0,0">
<StackPanel x:Name="actions" Orientation="Vertical">
</StackPanel>
</ScrollViewer>
</Grid>
......
......@@ -63,11 +63,9 @@ namespace Linphone.Views
contactPicture.ImageSource = contact.ContactImage;
}
/* foreach (ContactPhone phone in contact.Phones)
foreach (ContactPhone phone in contact.ContactPhones)
{
ContactAction entry = new ContactAction();
entry.Action = "/Assets/AppBar/feature.phone.png";
entry.Action2 = "/Assets/AppBar/chat.png";
entry.Label = phone.Kind.ToString();
entry.NumberOrAddress = phone.Number;
entry.Click += action_Click_1;
......@@ -75,17 +73,15 @@ namespace Linphone.Views
actions.Children.Add(entry);
}
foreach (ContactEmail email in contact.Emails)
foreach (ContactEmail email in contact.ContactEmails)
{
ContactAction entry = new ContactAction();
entry.Action = "/Assets/AppBar/feature.phone.png";
entry.Action2 = "/Assets/AppBar/chat.png";
entry.Label = email.Kind.ToString();
entry.NumberOrAddress = email.Address;
entry.Click += action_Click_1;
entry.Click2 += action_Click_2;
actions.Children.Add(entry);
}*/
}
}
private void SetAddressGoToDialerAndCall(String address)
......
......@@ -153,8 +153,8 @@
HorizontalAlignment="Center"
Margin="4">
<TextBlock
FontSize="22"
FontWeight="SemiLight"
FontSize="21"
FontWeight="SemiBold"
Foreground="{ThemeResource SystemControlBackgroundAccentBrush}"
HorizontalAlignment="Center"
Padding="7"
......
......@@ -268,6 +268,7 @@
Text="{Binding MissedCallCount, Mode = TwoWay}"
HorizontalAlignment="Right"
Style="{StaticResource TextStyle}"
FontSize="12"
Padding="0,5,12,0"/>
</Grid>
</AppBarButton.Content>
......@@ -285,6 +286,7 @@
Text="{Binding UnreadMessageCount, Mode = TwoWay}"
HorizontalAlignment="Right"
Style="{StaticResource TextStyle}"
FontSize="12"
Padding="0,5,12,0"/>
</Grid>
</AppBarButton.Content>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment