Skip to content

Commit

Permalink
Merging latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gus33000 committed Aug 5, 2019
1 parent 90de0d3 commit 9729edc
Show file tree
Hide file tree
Showing 22 changed files with 812 additions and 539 deletions.
5 changes: 1 addition & 4 deletions App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using Windows.ApplicationModel;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace Chat
{
Expand Down
3 changes: 1 addition & 2 deletions Chat.BackgroundTasks/BackgroundTaskUtils.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Chat.BackgroundTasks;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Windows.ApplicationModel.Background;
using Windows.Devices.Sms;
Expand Down
1 change: 0 additions & 1 deletion Chat.BackgroundTasks/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down
8 changes: 4 additions & 4 deletions Chat.BackgroundTasks/SmsBackgroundTask.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Microsoft.Toolkit.Uwp.Notifications;
using Chat.Common;
using Microsoft.Toolkit.Uwp.Notifications;
using System;
using System.Threading.Tasks;
using Windows.ApplicationModel.Background;
using Windows.Devices.Sms;
using Windows.UI.Notifications;
using System.Threading.Tasks;
using Chat.Common;
using System;

namespace Chat.BackgroundTasks
{
Expand Down
2 changes: 1 addition & 1 deletion Chat.BackgroundTasks/SmsReplyBackgroundTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private async Task HandleTaskActions(IBackgroundTaskInstance taskInstance)
}
catch
{

}
}
}
Expand Down
14 changes: 8 additions & 6 deletions Chat.Common/ContactUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ public class ContactInformation
public static async Task<Contact> BindPhoneNumberToGlobalContact(string phonenumber)
{
var store = await ContactManager.RequestStoreAsync();
var contacts = await store.FindContactsAsync();

foreach (var contact in contacts)
if (store != null)
{
if (contact.Phones.Any(x => x.Number.ToLower().Replace(" ", "") == phonenumber.ToLower().Replace(" ", "")))
var contacts = await store.FindContactsAsync();

foreach (var contact in contacts)
{
return contact;
if (contact.Phones.Any(x => x.Number.ToLower().Replace(" ", "") == phonenumber.ToLower().Replace(" ", "")))
{
return contact;
}
}
}

Contact blankcontact = new Contact();
blankcontact.Phones.Add(new ContactPhone() { Number = phonenumber, Kind = ContactPhoneKind.Other });

return blankcontact;
}

Expand Down
1 change: 0 additions & 1 deletion Chat.Common/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down
14 changes: 13 additions & 1 deletion Chat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down Expand Up @@ -58,6 +58,9 @@
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="ContentDialogs\AboutContentDialog.xaml.cs">
<DependentUpon>AboutContentDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\CellularLineControl.xaml.cs">
<DependentUpon>CellularLineControl.xaml</DependentUpon>
</Compile>
Expand All @@ -73,6 +76,7 @@
<Compile Include="Controls\TitlebarControl.xaml.cs">
<DependentUpon>TitlebarControl.xaml</DependentUpon>
</Compile>
<Compile Include="Helpers\Observable.cs" />
<Compile Include="Pages\ComposePage.xaml.cs">
<DependentUpon>ComposePage.xaml</DependentUpon>
</Compile>
Expand All @@ -83,6 +87,7 @@
<Compile Include="Shell.xaml.cs">
<DependentUpon>Shell.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModels\AboutViewModel.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
Expand Down Expand Up @@ -154,6 +159,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="ContentDialogs\AboutContentDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\CellularLineControl.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -197,6 +206,9 @@
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
<Version>5.1.1</Version>
</PackageReference>
<PackageReference Include="MvvmLightLibs">
<Version>5.4.1.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="Chat.Common\Chat.Common.csproj">
Expand Down
151 changes: 151 additions & 0 deletions ContentDialogs/AboutContentDialog.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<ContentDialog
x:Class="Chat.ContentDialogs.AboutContentDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Chat.ContentDialogs"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
mc:Ignorable="d"
Background="{ThemeResource SystemControlAcrylicElementBrush}"
BorderBrush="{ThemeResource SystemControlForegroundBaseLowBrush}"
Windows10version1809:CornerRadius="{StaticResource FluentDialogCorners}">

<ContentDialog.Resources>
<Style TargetType="HyperlinkButton">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding}" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</ContentDialog.Resources>

<Grid>
<Windows10version1809:Grid.BackgroundTransition>
<BrushTransition />
</Windows10version1809:Grid.BackgroundTransition>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<!-- Title with back button -->
<StackPanel Grid.Row="0"
Orientation="Horizontal"
Visibility="Visible"
Padding="0,0,0,8"
BorderBrush="{ThemeResource SystemControlBackgroundBaseLowBrush}"
BorderThickness="0,0,0,1">
<Button Style="{ThemeResource FluentDialogButtonBackStyle}"
Command="{x:Bind CloseDialogCommand}"/>
<TextBlock x:Uid="About_Title"
Text="About"
Margin="12,0"
VerticalAlignment="Center"
Style="{ThemeResource FluentSubheaderTextStyle}"/>
</StackPanel>

<!-- Content -->
<ScrollViewer Grid.Row="1">
<StackPanel Padding="0,12,0,0">
<!-- App info -->
<StackPanel Margin="{ThemeResource DialogCategoryMargin}">
<Grid Margin="{ThemeResource DialogTitleMargin}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TextBlock Grid.Column="0"
Grid.Row="0"
Grid.RowSpan="2"
Text="&#xE946;"
Style="{ThemeResource FluentTitleIconStyle}"/>
<!-- App Title -->
<TextBlock Grid.Column="1"
Grid.Row="0"
Text="{x:Bind ViewModel.AppName}"
Style="{ThemeResource FluentTitleTextStyle}"
FontWeight="SemiBold"/>
<!-- Version number -->
<TextBlock Grid.Column="1"
Grid.Row="1"
Text="{x:Bind ViewModel.VersionNumber, Mode=OneWay}"
Style="{ThemeResource CaptionTextBlockStyle}"/>
</Grid>

<!-- About Description -->
<TextBlock Text="Chat, created and maintained by WOA Project, 2018-2019"
x:Uid="About_Description"
TextWrapping="Wrap"
Margin="0,8,0,0"/>
</StackPanel>

<!-- Acknowledgements -->
<StackPanel Margin="{StaticResource DialogCategoryMargin}">
<StackPanel Orientation="Horizontal"
Margin="{ThemeResource DialogTitleMargin}">
<TextBlock Text="&#xE134;"
Style="{ThemeResource FluentTitleIconStyle}" />
<TextBlock x:Uid="About_AcknowledgementsTitle"
Text="Acknowledgements"
Style="{StaticResource FluentTitleTextStyle}" />
</StackPanel>

<!-- Intro -->
<TextBlock x:Uid="About_AcknowledgementsIntro"
Text="This app makes use of code from the following projects:"
TextWrapping="Wrap"
Margin="{StaticResource DialogSubtitleMargin}"/>

<!-- Windows Community Toolkit -->
<HyperlinkButton x:Uid="About_AcknowledgementsWct"
Content="Windows Community Toolkit"
NavigateUri="https://github.com/windows-toolkit/WindowsCommunityToolkit"/>

<!-- FluBase -->
<HyperlinkButton x:Uid="About_AcknowledgementsFlubase"
Content="FLUI Framework"
NavigateUri="https://github.com/Team-FLUI/FluiFramework"/>
</StackPanel>


<!-- Links -->
<StackPanel Margin="{ThemeResource DialogCategoryMargin}">
<StackPanel Orientation="Horizontal"
Margin="{ThemeResource DialogTitleMargin}">
<TextBlock Text="&#xE71B;"
Style="{ThemeResource FluentTitleIconStyle}"/>
<TextBlock x:Uid="About_LinksTitle"
Text="Links"
Style="{ThemeResource FluentTitleTextStyle}" />
</StackPanel>

<!-- GitHub Project -->
<HyperlinkButton x:Uid="About_GitHubLink"
Content="GitHub project"
NavigateUri="https://github.com/WOA-Project/Chat"/>
</StackPanel>
</StackPanel>

</ScrollViewer>

<!-- Dialog background icon -->

<FontIcon Grid.Row="1"
Canvas.ZIndex="5"
Visibility="Visible"
Glyph="&#xE946;"
FontSize="72"
Foreground="{ThemeResource SystemControlForegroundBaseLowBrush}"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"/>
</Grid>
</ContentDialog>
36 changes: 36 additions & 0 deletions ContentDialogs/AboutContentDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Chat.ViewModels;
using GalaSoft.MvvmLight.Command;
using System.Windows.Input;
using Windows.UI.Xaml.Controls;

// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238

namespace Chat.ContentDialogs
{
public sealed partial class AboutContentDialog : ContentDialog
{
public AboutViewModel ViewModel { get; } = new AboutViewModel();

public AboutContentDialog()
{
this.InitializeComponent();
}

private ICommand _closeDialogCommand;
public ICommand CloseDialogCommand
{
get
{
if (_closeDialogCommand == null)
{
_closeDialogCommand = new RelayCommand(
() =>
{
Hide();
});
}
return _closeDialogCommand;
}
}
}
}
Loading

0 comments on commit 9729edc

Please sign in to comment.