Commit 54ade275 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

About view content + few UI changes

parent 944026ef
......@@ -36,6 +36,7 @@
<NoConfig>true</NoConfig>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Bin\Debug\Linphone.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......
......@@ -8,6 +8,9 @@ using System.Threading.Tasks;
namespace Linphone.Model
{
/// <summary>
/// Extended list to allow sorting items alphabetically
/// </summary>
public class AlphaKeyGroup<T> : List<T>
{
/// <summary>
......
......@@ -9,6 +9,9 @@ using System.Threading.Tasks;
namespace Linphone.Model
{
/// <summary>
/// Converter to get contacts' images without having to call Contact object methods
/// </summary>
public class ContactPictureConverter : System.Windows.Data.IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
......
......@@ -21,7 +21,6 @@ namespace Linphone.Model
/// Set the debug value for liblinphone
/// </summary>
/// <param name="enable">true to enable debug traces, false to disable them</param>
/// <returns></returns>
public void EnableDebug(bool enable)
{
......@@ -71,6 +70,7 @@ namespace Linphone.Model
/// <summary>
/// Remove one or many entries from the calls' history
/// </summary>
/// <param name="logsToRemove">A list of CallLog to remove from history</param>
/// <returns>A list of CallLogs, without the removed entries</returns>
public List<CallLogs> RemoveCallLogs(IEnumerable<CallLog> logsToRemove)
{
......
......@@ -32,9 +32,7 @@ namespace Linphone.Model
/// Update a setting value for our application. If the setting does not
/// exist, then add the setting.
/// </summary>
/// <param name="Key"></param>
/// <param name="value"></param>
/// <returns></returns>
/// <returns>true if the value changed, false otherwise</returns>
public bool AddOrUpdateValue(string Key, Object value)
{
bool valueChanged = false;
......@@ -59,10 +57,6 @@ namespace Linphone.Model
/// Get the current value of the setting, or if it is not found, set the
/// setting to the default setting.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="Key"></param>
/// <param name="defaultValue"></param>
/// <returns></returns>
public T GetValueOrDefault<T>(string Key, T defaultValue)
{
T value;
......
......@@ -69,6 +69,21 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Linphone SIP (rfc 3261) compatible phone under GNU Public License V2
///http://www.linphone.org
///
///Instructions
///http://www.linphone.org/m/help
///
///©2013 Belledonne Communications.
/// </summary>
public static string AboutText {
get {
return ResourceManager.GetString("AboutText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Number or address.
/// </summary>
......
......@@ -161,4 +161,13 @@
<data name="DialerMenu" xml:space="preserve">
<value>Dialer</value>
</data>
<data name="AboutText" xml:space="preserve">
<value>Linphone SIP (rfc 3261) compatible phone under GNU Public License V2
http://www.linphone.org
Instructions
http://www.linphone.org/m/help
©2013 Belledonne Communications</value>
</data>
</root>
\ No newline at end of file
......@@ -6,6 +6,7 @@
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
......@@ -21,14 +22,32 @@
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,0">
<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.AboutMenu, 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,0,12,0">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<Image
HorizontalAlignment="Center"
Source="/Assets/AppIcon.png"
Width="80" />
<TextBlock
HorizontalAlignment="Center"
Margin="0,10,0,0"
FontSize="40"
Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" />
<RichTextBox
x:Name="AboutText"
IsReadOnly="True"
HorizontalAlignment="Center"
Margin="0,20,0,0"
TextWrapping="Wrap"
FontSize="25"
TextAlignment="Center" />
</StackPanel>
</Grid>
</Grid>
......
......@@ -7,6 +7,10 @@ using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Windows.Documents;
using Linphone.Resources;
using System.Globalization;
using System.Resources;
namespace Linphone.Views
{
......@@ -15,6 +19,31 @@ namespace Linphone.Views
public About()
{
InitializeComponent();
ResourceManager resourceManager = new ResourceManager("Linphone.Resources.AppResources", typeof(AppResources).Assembly);
int i = 0;
string text = resourceManager.GetString("AboutText", CultureInfo.CurrentCulture);
Paragraph paragraph = new Paragraph();
foreach (var line in text.Split('\n'))
{
if (line.StartsWith("http://"))
{
Hyperlink link = new Hyperlink();
link.NavigateUri = new Uri(line);
link.Inlines.Add(line);
link.TargetName = "_blank";
paragraph.Inlines.Add(link);
paragraph.Inlines.Add(new LineBreak());
i++;
}
else
{
paragraph.Inlines.Add(line);
paragraph.Inlines.Add(new LineBreak());
}
}
AboutText.Blocks.Add(paragraph);
}
}
}
\ No newline at end of file
......@@ -22,7 +22,7 @@
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,0">
<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.ContactsMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
......@@ -55,7 +55,8 @@
HideEmptyGroups="True"
LayoutMode="List"
JumpListStyle="{StaticResource ContactsJumpListStyle}"
ItemsSource="{Binding}">
ItemsSource="{Binding}"
SelectionChanged="contactsList_SelectionChanged_1">
<phone:LongListSelector.GroupHeaderTemplate>
<DataTemplate>
<Border Background="Transparent" Padding="0, 0, 0, 5">
......
......@@ -20,5 +20,10 @@ namespace Linphone.Views
contactsList.ItemsSource = ContactManager.Instance.GetContactsGroupedByLetters();
}
private void contactsList_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
Contact selectedContact = ((sender as LongListSelector).SelectedItem as Contact);
}
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,0,0,0">
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,5,0,0">
<TextBlock Text="{Binding Path=LocalizedResources.DialerMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
......
......@@ -69,7 +69,7 @@ namespace Linphone
appBarHistory.Click += history_Click_1;
ApplicationBarIconButton appBarContacts = new ApplicationBarIconButton(new Uri("/Assets/AppBar/people.contacts.png", UriKind.Relative));
appBarContacts.Text = AppResources.SettingsMenu;
appBarContacts.Text = AppResources.ContactsMenu;
ApplicationBar.Buttons.Add(appBarContacts);
appBarContacts.Click += contacts_Click_1;
......
......@@ -22,7 +22,7 @@
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,0">
<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>
......
......@@ -22,7 +22,7 @@
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel Grid.Row="0" Margin="12,17,0,0">
<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.SettingsMenu, Source={StaticResource LocalizedStrings}}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
......
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