Commit f13fc69f authored by Sylvain Berfini's avatar Sylvain Berfini

Improved UI for white theme + added missing messages + fix several crashes +...

Improved UI for white theme + added missing messages + fix several crashes + updated interface to be more WP like
parent d2c6b627
......@@ -44,9 +44,13 @@
Grid.Row="1"
BorderThickness="0"
VerticalAlignment="Center">
<Image
x:Name="action"
Stretch="None" />
<Rectangle Fill="{StaticResource PhoneForegroundBrush}" Width="48" Height="48">
<Rectangle.OpacityMask>
<ImageBrush
x:Name="action"
Stretch="None"/>
</Rectangle.OpacityMask>
</Rectangle>
</Button>
<Button
......@@ -55,9 +59,13 @@
Grid.Row="1"
BorderThickness="0"
VerticalAlignment="Center">
<Image
x:Name="action2"
Stretch="None"/>
<Rectangle Fill="{StaticResource PhoneForegroundBrush}" Width="48" Height="48">
<Rectangle.OpacityMask>
<ImageBrush
x:Name="action2"
Stretch="None"/>
</Rectangle.OpacityMask>
</Rectangle>
</Button>
</Grid>
</UserControl>
\ No newline at end of file
......@@ -23,7 +23,7 @@ namespace Linphone.Controls
set
{
_action = value;
action.Source = new BitmapImage(new Uri(value, UriKind.RelativeOrAbsolute)); ;
action.ImageSource = new BitmapImage(new Uri(value, UriKind.RelativeOrAbsolute)); ;
}
}
......@@ -40,7 +40,7 @@ namespace Linphone.Controls
set
{
_action2 = value;
action2.Source = new BitmapImage(new Uri(value, UriKind.RelativeOrAbsolute)); ;
action2.ImageSource = new BitmapImage(new Uri(value, UriKind.RelativeOrAbsolute)); ;
}
}
......
......@@ -11,6 +11,7 @@ using Linphone.Model;
using Linphone.Views;
using System.Windows.Media.Imaging;
using Microsoft.Xna.Framework.Media;
using Linphone.Resources;
namespace Linphone.Controls
{
......@@ -77,7 +78,8 @@ namespace Linphone.Controls
private void Save_Click(object sender, RoutedEventArgs e)
{
Utils.SavePictureInMediaLibrary(ChatMessage.ImageURL);
bool result = Utils.SavePictureInMediaLibrary(ChatMessage.ImageURL);
MessageBox.Show(result ? AppResources.FileSavingSuccess : AppResources.FileSavingFailure, AppResources.FileSaving, MessageBoxButton.OK);
}
/// <summary>
......
......@@ -12,6 +12,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Media;
using Linphone.Model;
using Linphone.Views;
using Linphone.Resources;
namespace Linphone.Controls
{
......@@ -126,7 +127,8 @@ namespace Linphone.Controls
private void Save_Click(object sender, RoutedEventArgs e)
{
Utils.SavePictureInMediaLibrary(ChatMessage.ImageURL);
bool result = Utils.SavePictureInMediaLibrary(ChatMessage.ImageURL);
MessageBox.Show(result ? AppResources.FileSavingSuccess : AppResources.FileSavingFailure, AppResources.FileSaving, MessageBoxButton.OK);
}
/// <summary>
......
......@@ -6,8 +6,65 @@
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
d:DesignHeight="150" d:DesignWidth="420">
<UserControl.Resources>
<Style x:Key="ChatTextBox" TargetType="TextBox">
<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}"/>
<Setter Property="SelectionBackground" Value="{StaticResource PhoneAccentBrush}"/>
<Setter Property="SelectionForeground" Value="{StaticResource PhoneTextBoxSelectionForegroundBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Grid Background="Transparent">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="MainBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="MainBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBorderBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="MainBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="MainBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneTextBoxEditBorderBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="MainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Margin="{StaticResource PhoneTouchTargetOverhang}"/>
<Border x:Name="ReadonlyBorder" BorderBrush="{StaticResource PhoneDisabledBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent" Margin="{StaticResource PhoneTouchTargetOverhang}" Visibility="Collapsed"/>
<Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent" Margin="{StaticResource PhoneTouchTargetOverhang}">
<ContentControl x:Name="ContentElement" BorderThickness="0" HorizontalContentAlignment="Stretch" Margin="{StaticResource PhoneTextBoxInnerMargin}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="Stretch"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid Margin="60,10,5,15">
<Grid.RowDefinitions>
......@@ -15,21 +72,20 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle Fill="White"/>
<Rectangle Fill="WhiteSmoke"/>
<TextBox
Grid.Row="0"
x:Name="Message"
TextChanged="Message_TextChanged"
InputScope="Chat"
BorderThickness="0"
Background="White"
TextAlignment="Left"/>
TextAlignment="Left"
Style="{StaticResource ChatTextBox}"/>
<Path
Grid.Row="1"
Data="m 0,0 l 16,0 l 0,16 l -16,-16"
Fill="White"
Fill="WhiteSmoke"
Margin="0,-1,10,0"
HorizontalAlignment="Right"/>
</Grid>
......
......@@ -4,6 +4,7 @@ using Linphone.Core;
using Linphone.Core.OutOfProcess;
using Linphone.Resources;
using Linphone.Views;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Net.NetworkInformation;
using Microsoft.Phone.Networking.Voip;
using System;
......@@ -781,7 +782,7 @@ namespace Linphone.Model
/// <summary>
/// Custom message box to display incoming messages when not in chat view
/// </summary>
public MessageReceivedNotification MessageReceivedNotification { get; set; }
public CustomMessageBox MessageReceivedNotification { get; set; }
/// <summary>
/// Callback for LinphoneCoreListener
......@@ -825,21 +826,28 @@ namespace Linphone.Model
//Displays the message as a popup
if (MessageReceivedNotification != null)
{
MessageReceivedNotification.Hide();
MessageReceivedNotification.Dismiss();
}
Popup messageNotif = new Popup();
messageNotif.Width = Application.Current.Host.Content.ActualWidth;
messageNotif.Height = Application.Current.Host.Content.ActualHeight;
messageNotif.VerticalOffset = 25;
MessageReceivedNotification = new MessageReceivedNotification(messageNotif, msg);
MessageReceivedNotification.ShowClicked += (sender, chatMessage) =>
MessageReceivedNotification = new CustomMessageBox()
{
BaseModel.CurrentPage.NavigationService.Navigate(new Uri("/Views/Chat.xaml?sip=" + chatMessage.Contact, UriKind.RelativeOrAbsolute));
Caption = url.Length > 0 ? AppResources.ImageMessageReceived : AppResources.MessageReceived,
Message = url.Length > 0 ? "" : message.GetText(),
LeftButtonContent = AppResources.Show,
RightButtonContent = AppResources.Close
};
messageNotif.Child = MessageReceivedNotification;
messageNotif.IsOpen = true;
MessageReceivedNotification.Dismissed += (s, e) =>
{
switch (e.Result)
{
case CustomMessageBoxResult.LeftButton:
BaseModel.CurrentPage.NavigationService.Navigate(new Uri("/Views/Chat.xaml?sip=" + msg.Contact, UriKind.RelativeOrAbsolute));
break;
}
};
MessageReceivedNotification.Show();
//Update tile
UpdateLiveTile();
......
......@@ -480,6 +480,33 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Saving picture.
/// </summary>
public static string FileSaving {
get {
return ResourceManager.GetString("FileSaving", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Operation failed.
/// </summary>
public static string FileSavingFailure {
get {
return ResourceManager.GetString("FileSavingFailure", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Operation successful.
/// </summary>
public static string FileSavingSuccess {
get {
return ResourceManager.GetString("FileSavingSuccess", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to G722.
/// </summary>
......@@ -606,6 +633,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Message received.
/// </summary>
public static string MessageReceived {
get {
return ResourceManager.GetString("MessageReceived", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to mute.
/// </summary>
......
......@@ -473,4 +473,16 @@ http://www.linphone.org/m/help
<data name="VibratorSetting" xml:space="preserve">
<value>Vibrate on incoming message</value>
</data>
<data name="FileSaving" xml:space="preserve">
<value>Saving picture</value>
</data>
<data name="FileSavingFailure" xml:space="preserve">
<value>Operation failed</value>
</data>
<data name="FileSavingSuccess" xml:space="preserve">
<value>Operation successful</value>
</data>
<data name="MessageReceived" xml:space="preserve">
<value>Message received</value>
</data>
</root>
\ No newline at end of file
......@@ -30,10 +30,11 @@
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<Image
HorizontalAlignment="Center"
Source="/Assets/AppIcon.png"
Width="80" />
<Rectangle Fill="{StaticResource PhoneForegroundBrush}" Width="80" Height="80">
<Rectangle.OpacityMask>
<ImageBrush ImageSource="/Assets/AppIcon.png"/>
</Rectangle.OpacityMask>
</Rectangle>
<TextBlock
HorizontalAlignment="Center"
Margin="0,10,0,0"
......
......@@ -41,6 +41,16 @@ namespace Linphone.Views
}
}
/// <summary>
/// Method called when the page is displayed.
/// </summary>
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
// Create LinphoneCore if not created yet, otherwise do nothing
await LinphoneManager.Instance.InitLinphoneCore();
}
private void cancel_Click_1(object sender, EventArgs e)
{
NavigationService.GoBack();
......
......@@ -56,6 +56,16 @@ namespace Linphone.Views
TunnelPanel.Visibility = LinphoneManager.Instance.LinphoneCore.IsTunnelAvailable() && false ? Visibility.Visible : Visibility.Collapsed; //Hidden properties for now
}
/// <summary>
/// Method called when the page is displayed.
/// </summary>
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
// Create LinphoneCore if not created yet, otherwise do nothing
await LinphoneManager.Instance.InitLinphoneCore();
}
private void cancel_Click_1(object sender, EventArgs e)
{
NavigationService.GoBack();
......
......@@ -114,6 +114,7 @@
Grid.Row="3"
x:Name="ECCalibratorStatusButton"
IsEnabled="False"
BorderThickness="0"
Margin="0,30,0,0"
Content="{Binding Path=LocalizedResources.ECCalibrationNotRun, Source={StaticResource LocalizedStrings}}" />
</StackPanel>
......
......@@ -33,6 +33,18 @@ namespace Linphone.Views
ILBC.IsChecked = _settings.ILBC;
SILK16.IsChecked = _settings.SILK16;
GSM.IsChecked = _settings.GSM;
}
/// <summary>
/// Method called when the page is displayed.
/// </summary>
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
LinphoneManager.Instance.ECListener = this;
// Create LinphoneCore if not created yet, otherwise do nothing
await LinphoneManager.Instance.InitLinphoneCore();
}
private void cancel_Click_1(object sender, EventArgs e)
......@@ -85,14 +97,6 @@ namespace Linphone.Views
appBarCancel.Click += cancel_Click_1;
}
/// <summary>
/// Actualises the echo calibrator listener when the pages changes.
/// </summary>
protected override void OnNavigatedTo(NavigationEventArgs nea)
{
LinphoneManager.Instance.ECListener = this;
}
/// <summary>
/// Actualises the echo calibrator listener when the pages changes.
/// </summary>
......
......@@ -69,19 +69,5 @@ namespace Linphone
this.ViewModel.OnNavigatedFrom(nee);
}
/// <summary>
/// Can cancel back action if custom popup is open to close it
/// </summary>
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
if (LinphoneManager.Instance.MessageReceivedNotification != null && LinphoneManager.Instance.MessageReceivedNotification.IsVisible)
{
LinphoneManager.Instance.MessageReceivedNotification.Hide();
e.Cancel = true;
}
base.OnBackKeyPress(e);
}
}
}
......@@ -42,11 +42,8 @@
<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="CaretBrush" Value="White"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="{StaticResource PhoneTextBoxBrush}"/>
<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
<Setter Property="SelectionBackground" Value="{StaticResource PhoneAccentBrush}"/>
<Setter Property="SelectionForeground" Value="{StaticResource PhoneTextBoxSelectionForegroundBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="2"/>
<Setter Property="Template">
......@@ -71,7 +68,11 @@
<Button Grid.Column="2" x:Name="ChooseContact" BorderThickness="0" Click="ChooseContact_Click">
<Button.Template>
<ControlTemplate>
<Image Source="/Assets/AppBar/people.contacts.png"/>
<Rectangle Fill="{StaticResource PhoneForegroundBrush}" Width="48" Height="48">
<Rectangle.OpacityMask>
<ImageBrush ImageSource="/Assets/AppBar/people.contacts.png"/>
</Rectangle.OpacityMask>
</Rectangle>
</ControlTemplate>
</Button.Template>
</Button>
......
......@@ -25,12 +25,6 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="1" Margin="12,5,0,0">
<!--<TextBlock Foreground="Black" Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>-->
<TextBlock Text="{Binding Path=LocalizedResources.ContactsMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="2" Margin="12,0,12,0">
<Grid.Resources>
......@@ -217,7 +211,7 @@
</Grid.Resources>
<!--End of the hack-->
<phone:Pivot SelectionChanged="Pivot_SelectionChanged">
<phone:Pivot SelectionChanged="Pivot_SelectionChanged" Title="{Binding Path=LocalizedResources.ContactsMenu, Source={StaticResource LocalizedStrings}}">
<phone:PivotItem Header="{Binding Path=LocalizedResources.ContactsAll, Source={StaticResource LocalizedStrings}}">
<phone:LongListSelector
x:Name="contactsList"
......
......@@ -61,7 +61,8 @@ namespace Linphone.Views
ApplicationBar.Buttons.Add(appBarSave);
appBarSave.Click += (sender, e) =>
{
Utils.SavePictureInMediaLibrary(_fileName);
bool result = Utils.SavePictureInMediaLibrary(_fileName);
MessageBox.Show(result ? AppResources.FileSavingSuccess : AppResources.FileSavingFailure, AppResources.FileSaving, MessageBoxButton.OK);
};
}
}
......
......@@ -28,15 +28,9 @@
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,5,0,0">
<!--<TextBlock Foreground="Black" Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Style="{StaticResource PhoneTextNormalStyle}"/>-->
<TextBlock Text="{Binding Path=LocalizedResources.HistoryMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,10,12,0">
<phone:Pivot>
<phone:Pivot Title="{Binding Path=LocalizedResources.HistoryMenu, Source={StaticResource LocalizedStrings}}">
<phone:PivotItem Header="{Binding Path=LocalizedResources.HistoryAll, Source={StaticResource LocalizedStrings}}">
<toolkit:LongListMultiSelector x:Name="Calls" SelectionChanged="calls_SelectionChanged_1">
<toolkit:LongListMultiSelector.ItemTemplate>
......@@ -62,13 +56,6 @@
</StackPanel>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemTemplate>
<toolkit:LongListMultiSelector.ItemInfoTemplate>
<DataTemplate>
<Border Width="30" Margin="5,0,5,0">
<Image Source="{Binding StatusIcon}" Stretch="Uniform"/>
</Border>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemInfoTemplate>
</toolkit:LongListMultiSelector>
</phone:PivotItem>
......@@ -97,13 +84,6 @@
</StackPanel>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemTemplate>
<toolkit:LongListMultiSelector.ItemInfoTemplate>
<DataTemplate>
<Border Width="30" Margin="5,0,5,0">
<Image Source="{Binding StatusIcon}" Stretch="Uniform"/>
</Border>
</DataTemplate>
</toolkit:LongListMultiSelector.ItemInfoTemplate>
</toolkit:LongListMultiSelector>
</phone:PivotItem>
</phone:Pivot>
......
......@@ -26,6 +26,17 @@ namespace Linphone.Views
Video.Visibility = _settings.HideVideoSettings ? Visibility.Collapsed : Visibility.Visible;
}
/// <summary>
/// Method called when the page is displayed.
/// </summary>
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
// Create LinphoneCore if not created yet, otherwise do nothing
await LinphoneManager.Instance.InitLinphoneCore();
}
private void cancel_Click_1(object sender, EventArgs e)
{
NavigationService.GoBack();
......
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