Commit 179ef2ae authored by Margaux Clerc's avatar Margaux Clerc

Add refresh register on statusbar

disable focus on addressbar
parent b16e5f7a
......@@ -23,8 +23,6 @@
AcceptsReturn="False"
TextChanged="address_TextChanged"
InputScope="EmailSmtpAddress"
GotFocus="address_GotFocus"
LostFocus="address_LostFocus"
CompositeMode="MinBlend">
</TextBox>
......
......@@ -21,21 +21,13 @@ using Windows.UI.Xaml.Controls;
namespace Linphone.Controls
{
public interface AddressBoxFocused
{
void Focused();
void UnFocused();
}
public partial class AddressBox : UserControl
{
public AddressBoxFocused FocusListener;
public String Text
{
get { return address.Text; }
set { address.Text = value; Debug.WriteLine("Set"); }
set { address.Text = value; }
}
public AddressBox()
......@@ -55,18 +47,6 @@ namespace Linphone.Controls
address.Text = address.Text.Substring(0, address.Text.Length - 1);
}
private void address_GotFocus(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
if (FocusListener != null)
FocusListener.Focused();
}
private void address_LostFocus(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
if (FocusListener != null)
FocusListener.UnFocused();
}
private void address_TextChanged(object sender, TextChangedEventArgs e)
{
if(address.Text.Length > 0)
......
......@@ -125,7 +125,7 @@
<value>en-US</value>
<comment>Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language.</comment>
</data>
<data name="ApplicationTitle" xml:space="preserve">
<data name="ApplicationTitle.Text" xml:space="preserve">
<value>Linphone</value>
</data>
<data name="AboutMenu" xml:space="preserve">
......
......@@ -42,6 +42,22 @@
<Setter Property="Foreground" Value="LightGray"/>
</Style>
<Style x:Key="AccentLongButtonStyle"
TargetType="Button">
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Foreground" Value="{ThemeResource SystemChromeWhiteColor}" />
<Setter Property="Background" Value="{ThemeResource SystemAccentColor}" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Height" Value="72" />
<Setter Property="IsTextScaleFactorEnabled" Value="False" />
</Style>
<Style x:Key="ButtonStyle"
TargetType="Button">
<Setter Property="Template">
......@@ -175,22 +191,13 @@
<Setter Property="ClickMode" Value="Press" />
<Setter Property="Foreground" Value="{ThemeResource SystemBaseHighColor}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template" Value="{StaticResource DialPadButtonTemplate}" />
<Setter Property="IsTextScaleFactorEnabled" Value="False" />
</Style>
<Style x:Key="TextStyle"
TargetType="TextBlock">
<Setter Property="FontSize"
Value="{ThemeResource TextStyleLargeFontSize}" />
<Setter Property="FontFamily"
Value="{ThemeResource PhoneFontFamilyNormal}" />
</Style>
<Style x:Key="DialpadNumberStyle"
TargetType="TextBlock">
<Setter Property="FontSize"
Value="{ThemeResource TextStyleLargeFontSize}" />
Value="{ThemeResource TextStyleExtraLargeFontSize}" />
<Setter Property="FontFamily"
Value="{ThemeResource PhoneFontFamilyNormal}" />
<Setter Property="VerticalAlignment"
......@@ -215,6 +222,16 @@
Value="0,0,0,0" />
</Style>
<Style x:Key="TextStyle"
TargetType="TextBlock">
<Setter Property="FontSize"
Value="16" />
<Setter Property="FontFamily"
Value="{ThemeResource PhoneFontFamilySemiLight}" />
<Setter Property="FontWeight"
Value="ExtraLight"/>
</Style>
<Style x:Key="DialpadIconStyle"
TargetType="FontIcon">
<Setter Property="FontSize"
......
......@@ -30,7 +30,8 @@
HorizontalAlignment="Center"
Margin="0,10,0,0"
FontSize="40"
Text="ApplicationTitle" />
x:Uid="ApplicationTitle"/>
<Image Source="\Assets\Square44x44Logo.scale-200.png"/>
<TextBlock
x:Name="AboutText"
HorizontalAlignment="Center"
......
......@@ -9,100 +9,17 @@
Background="{ThemeResource AppBarBackgroundThemeBrush}"
mc:Ignorable="d">
<Page.Resources>
<Style x:Key="DialpadButtonStyle"
TargetType="Button">
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0,0,1,0" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Height" Value="60" />
<Setter Property="ClickMode" Value="Press" />
<Setter Property="Foreground" Value="{ThemeResource SystemBaseHighColor}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="IsTextScaleFactorEnabled" Value="False" />
</Style>
<Style x:Key="AccentLongButtonStyle"
TargetType="Button">
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Foreground" Value="{ThemeResource SystemChromeWhiteColor}" />
<Setter Property="Background" Value="{ThemeResource SystemAccentColor}" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Height" Value="72" />
<Setter Property="IsTextScaleFactorEnabled" Value="False" />
</Style>
<Style x:Key="DialpadNumberStyle"
TargetType="TextBlock">
<Setter Property="FontSize"
Value="{ThemeResource TextStyleExtraLargeFontSize}" />
<Setter Property="FontFamily"
Value="{ThemeResource PhoneFontFamilyNormal}" />
<Setter Property="VerticalAlignment"
Value="Bottom" />
<Setter Property="HorizontalAlignment"
Value="Center" />
</Style>
<Style x:Key="DialpadLetterStyle"
TargetType="TextBlock">
<Setter Property="FontSize"
Value="12" />
<Setter Property="FontFamily"
Value="{ThemeResource PhoneFontFamilySemiLight}" />
<Setter Property="FontWeight"
Value="ExtraLight" />
<Setter Property="VerticalAlignment"
Value="Bottom" />
<Setter Property="HorizontalAlignment"
Value="Center" />
<Setter Property="Padding"
Value="0,0,0,0" />
</Style>
<Style x:Key="TextStyle"
TargetType="TextBlock">
<Setter Property="FontSize"
Value="16" />
<Setter Property="FontFamily"
Value="{ThemeResource PhoneFontFamilySemiLight}" />
<Setter Property="FontWeight"
Value="ExtraLight"/>
</Style>
<Style x:Key="DialpadIconStyle"
TargetType="FontIcon">
<Setter Property="FontSize"
Value="12" />
<Setter Property="FontFamily"
Value="{ThemeResource PhoneFontFamilySemiLight}" />
<Setter Property="FontWeight"
Value="ExtraLight" />
<Setter Property="VerticalAlignment"
Value="Bottom" />
<Setter Property="HorizontalAlignment"
Value="Center" />
</Style>
</Page.Resources>
<Grid Background="{ThemeResource AppBarBackgroundThemeBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<controls:StatusBar x:Name="status" Grid.Row="0"></controls:StatusBar>
<controls:StatusBar
x:Name="status"
Grid.Row="0"
Tapped="status_Tapped"/>
<Grid x:Name="ContentPanel" Grid.Row="1">
<Grid.RowDefinitions>
......@@ -119,7 +36,12 @@
BorderThickness="0"
FontSize="40"/>
<StackPanel x:Name="numpad" Grid.Row="1" VerticalAlignment="Bottom" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel
x:Name="numpad"
Grid.Row="1"
VerticalAlignment="Bottom"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="12" />
......@@ -287,9 +209,10 @@
</Button>
</Grid>
<Button Background="{ThemeResource SystemControlBackgroundAccentBrush}"
Click="call_Click"
Style="{StaticResource AccentLongButtonStyle}">
<Button
Click="call_Click"
Style="{StaticResource AccentLongButtonStyle}">
<Button.ContentTemplate>
<DataTemplate>
<Grid>
......@@ -333,7 +256,7 @@
</Grid>
<CommandBar Grid.Row="3" VerticalAlignment="Bottom">
<AppBarButton Icon="Clock" Label="History" Click="history_Click" />
<AppBarButton Icon="Clock" Label="History" Click="history_Click"/>
<AppBarButton Icon="Contact" Label="Contacts" Click="contacts_Click"/>
<AppBarButton Icon="Message" Label="Chat" Click="chat_Click"/>
<AppBarButton Icon="Setting" Label="Settings" Click="settings_Click"/>
......@@ -342,7 +265,5 @@
<AppBarButton Label="About" Click="about_Click"/>
</CommandBar.SecondaryCommands>
</CommandBar>
</Grid>
</Page>
......@@ -20,25 +20,18 @@ using Windows.UI.Xaml.Navigation;
using System;
using BelledonneCommunications.Linphone.Native;
using Windows.UI.Xaml;
using System.Diagnostics;
using Linphone.Controls;
using Windows.UI.Xaml.Input;
namespace Linphone.Views
{
/// <summary>
/// Home page for the application, displays a numpad and links to Settings/History/Contacts pages.
/// </summary>
public sealed partial class Dialer : Page, AddressBoxFocused
public sealed partial class Dialer : Page
{
public Dialer()
{
this.InitializeComponent();
addressBox.FocusListener = this;
ContactsManager contactsManager = ContactsManager.Instance;
//addressBox.FocusListener = this;
//ContactsManager.Instance.readContacts();
//Force creation and init of ContactManager
}
private void LogUploadProgressIndication(int offset, int total)
......@@ -58,11 +51,6 @@ namespace Linphone.Views
status.RefreshStatus();
}
/// <summary>
/// Method called when the page is displayed.
/// Check if the uri contains a sip address, if yes, it starts a call to this address.
/// </summary>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
......@@ -108,8 +96,6 @@ namespace Linphone.Views
}
}*/
//status.RefreshStatus(LinphoneManager.Instance.LastKnownState);
if (e.Parameter is String && (e.Parameter as String).Contains("sip") && e.NavigationMode != NavigationMode.Back)
{
String sipAddressToCall = e.Parameter as String;
......@@ -122,17 +108,11 @@ namespace Linphone.Views
String uri = call.RemoteAddress.AsStringUriOnly();
Frame.Navigate(typeof(Views.InCall), uri);
}
Debug.WriteLine(LinphoneManager.Instance.Core.AudioCodecs[0].MimeType);
}
/// <summary>
/// Method called when the page is hidden.
/// </summary>
protected override void OnNavigatedFrom(NavigationEventArgs nee)
{
base.OnNavigatedFrom(nee);
// LinphoneManager.Instance.LogUploadProgressIndicationEH -= LogUploadProgressIndication;
// BugReportUploadPopup.Visibility = Visibility.Collapsed;
}
......@@ -156,7 +136,7 @@ namespace Linphone.Views
String tag = button.Tag as String;
LinphoneManager.Instance.Core.PlayDtmf(Convert.ToChar(tag), 1000);
addressBox.Text += tag;
addressBox.Text += tag;
}
private void VoicemailClick(object sender, RoutedEventArgs e)
......@@ -167,7 +147,7 @@ namespace Linphone.Views
private void zero_Hold(object sender, RoutedEventArgs e)
{
if (addressBox.Text.Length > 0)
addressBox.Text = addressBox.Text.Substring(0, addressBox.Text.Length - 1);
addressBox.Text = addressBox.Text.Substring(0, addressBox.Text.Length - 1);
addressBox.Text += "+";
}
......@@ -218,19 +198,9 @@ namespace Linphone.Views
}
}
public void Focused()
private void status_Tapped(object sender, TappedRoutedEventArgs e)
{
//numpad.Visibility = Visibility.Collapsed;
}
public void UnFocused()
{
//numpad.Visibility = Visibility.Visible;
}
private void call_Click_1(object sender, RoutedEventArgs e)
{
LinphoneManager.Instance.Core.RefreshRegisters();
}
}
}
\ No newline at end of file
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