Commit 441fd143 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added code to display missed calls on tile and lock screen + setting button to...

Added code to display missed calls on tile and lock screen + setting button to go to system lock screen settings (user need to activate linphone on lock screen manually)
parent 40c6ddc9
No preview for this file type
......@@ -32,6 +32,7 @@ namespace Linphone.Controls
public RoutedEventHandler Click
{
set { button.Click += value; }
get { return null; }
}
public TwoStateButton()
......
......@@ -116,6 +116,7 @@
<Compile Include="Model\ContactPictureConverter.cs" />
<Compile Include="Model\LinphoneManager.cs" />
<Compile Include="Model\SettingsManager.cs" />
<Compile Include="Model\TileManager.cs" />
<Compile Include="Resources\DefaultValues.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
......
......@@ -146,7 +146,8 @@ namespace Linphone.Model
/// <param name="sipAddress">SIP address to call</param>
public void NewOutgoingCall(String sipAddress)
{
//TileManager tileManager = TileManager.Instance;
//tileManager.UpdateTileWithMissedCalls(new Random().Next(10));
}
}
}
using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Linphone.Model
{
public class TileManager
{
private static TileManager singleton;
public static TileManager Instance
{
get
{
if (TileManager.singleton == null)
TileManager.singleton = new TileManager();
return TileManager.singleton;
}
}
public TileManager()
{
}
public void UpdateTileWithMissedCalls(int missedCalls)
{
ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();
var data = new StandardTileData();
data.Count = missedCalls;
tile.Update(data);
}
public void RemoveMissedCallsTile()
{
UpdateTileWithMissedCalls(0);
}
}
}
......@@ -36,12 +36,14 @@
</BackBackgroundImageURI>
<BackTitle>
</BackTitle>
<DeviceLockImageURI>
</DeviceLockImageURI>
<DeviceLockImageURI IsRelative="true" IsResource="false">Assets\AppBar\feature.phone.png</DeviceLockImageURI>
<HasLarge>False</HasLarge>
</TemplateFlip>
</PrimaryToken>
</Tokens>
<Extensions>
<Extension ExtensionName="LockScreen_Notification_IconCount" ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}" TaskID="_default" />
</Extensions>
<ScreenResolutions>
<ScreenResolution Name="ID_RESOLUTION_WVGA" />
<ScreenResolution Name="ID_RESOLUTION_WXGA" />
......
......@@ -219,6 +219,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to LockScreen settings.
/// </summary>
public static string LockScreenSettings {
get {
return ResourceManager.GetString("LockScreenSettings", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to PCMA.
/// </summary>
......
......@@ -212,4 +212,7 @@ http://www.linphone.org/m/help
<data name="TransportUDP" xml:space="preserve">
<value>UDP</value>
</data>
<data name="LockScreenSettings" xml:space="preserve">
<value>LockScreen settings</value>
</data>
</root>
\ No newline at end of file
......@@ -25,6 +25,8 @@ namespace Linphone
BuildLocalizedApplicationBar();
ContactManager contactManager = ContactManager.Instance; //Force creation and init of ContactManager
call.Click += call_Click_1;
}
protected override void OnNavigatedTo(NavigationEventArgs e)
......@@ -39,6 +41,11 @@ namespace Linphone
}
}
private void call_Click_1(object sender, EventArgs e)
{
LinphoneManager.Instance.NewOutgoingCall(numpad.Address.Text);
}
private void history_Click_1(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/Views/History.xaml", UriKind.RelativeOrAbsolute));
......
......@@ -25,6 +25,9 @@ namespace Linphone.Views
protected override void OnNavigatedTo(NavigationEventArgs e)
{
TileManager tileManager = TileManager.Instance;
tileManager.RemoveMissedCallsTile();
List<CallLogs> callsHistory = LinphoneManager.Instance.GetCallsHistory();
history.ItemsSource = callsHistory;
}
......
......@@ -33,6 +33,7 @@
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<toolkit:ToggleSwitch
......@@ -53,6 +54,13 @@
Click="codecs_Click_1"
Margin="0,30,0,0"
Content="{Binding Path=LocalizedResources.CodecsMenu, Source={StaticResource LocalizedStrings}}" />
<Button
Grid.Row="3"
Click="LockScreenSettings_Click_1"
x:Name="LockScreenSettings"
Margin="0,30,0,0"
Content="{Binding Path=LocalizedResources.LockScreenSettings, Source={StaticResource LocalizedStrings}}" />
</Grid>
</Grid>
......
......@@ -69,5 +69,10 @@ namespace Linphone.Views
ApplicationBar.Buttons.Add(appBarCancel);
appBarCancel.Click += cancel_Click_1;
}
private async void LockScreenSettings_Click_1(object sender, RoutedEventArgs e)
{
var op = await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-lock:"));
}
}
}
\ 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