Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Functions/SantaTalk.Functions/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions",
"ms-vscode.csharp"
]
}
11 changes: 11 additions & 0 deletions src/Functions/SantaTalk.Functions/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to .NET Functions",
"type": "coreclr",
"request": "attach",
"processId": "${command:azureFunctions.pickProcess}"
}
]
}
7 changes: 7 additions & 0 deletions src/Functions/SantaTalk.Functions/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"azureFunctions.deploySubpath": "bin/Release/netcoreapp3.0/publish",
"azureFunctions.projectLanguage": "C#",
"azureFunctions.projectRuntime": "~2",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.preDeployTask": "publish"
}
69 changes: 69 additions & 0 deletions src/Functions/SantaTalk.Functions/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "clean",
"command": "dotnet",
"args": [
"clean",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile"
},
{
"label": "build",
"command": "dotnet",
"args": [
"build",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile"
},
{
"label": "clean release",
"command": "dotnet",
"args": [
"clean",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"args": [
"publish",
"--configuration",
"Release",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"type": "process",
"dependsOn": "clean release",
"problemMatcher": "$msCompile"
},
{
"type": "func",
"dependsOn": "build",
"options": {
"cwd": "${workspaceFolder}/bin/Debug/netcoreapp3.0"
},
"command": "host start",
"isBackground": true,
"problemMatcher": "$func-watch"
}
]
}
8 changes: 8 additions & 0 deletions src/Functions/SantaTalk.Functions/Answer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;
namespace SantaTalk.Models
{
public class Answer
{
public string answer { get; set; }
}
}
17 changes: 17 additions & 0 deletions src/Functions/SantaTalk.Functions/SantaTalk.Functions.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SantaTalk.Functions", "SantaTalk.Functions.csproj", "{34D9351E-2E3F-41CB-A66A-8A055258C7AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{34D9351E-2E3F-41CB-A66A-8A055258C7AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34D9351E-2E3F-41CB-A66A-8A055258C7AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34D9351E-2E3F-41CB-A66A-8A055258C7AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34D9351E-2E3F-41CB-A66A-8A055258C7AB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
9,863 changes: 9,863 additions & 0 deletions src/SantaTalk.KB/5d298b00-973a-44d5-831a-e8bce3f3eadf-KB.tsv

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/SantaTalk.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<dict>
<key>NSAllowLocalNetworking</key>
<true/>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key>
<array>
Expand Down
1 change: 1 addition & 0 deletions src/SantaTalk/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using SantaTalk.Pages;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

Expand Down
60 changes: 60 additions & 0 deletions src/SantaTalk/ChatPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
NavigationPage.HasNavigationBar="False"
NavigationPage.BackButtonTitle=""
ios:Page.UseSafeArea="True"
BackgroundColor="{StaticResource dark_gradient}"
xmlns:viewmodels="clr-namespace:SantaTalk"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:utils="clr-namespace:SantaTalk.Utils"
xmlns:pancakeview="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"
x:Class="SantaTalk.Pages.ChatPage">
<ContentPage.BindingContext>
<viewmodels:ChatPageViewModel />
</ContentPage.BindingContext>
<ContentPage.Resources>
<ResourceDictionary>
<DataTemplate x:Key="receivedMessageTemplate">
<ViewCell>
<Grid BackgroundColor="Blue">
<Label Text="{Binding Message}"/>
</Grid>
</ViewCell>
</DataTemplate>
<DataTemplate x:Key="sentMessageTemplate">
<ViewCell>
<Grid BackgroundColor="Red">
<Label Text="{Binding Message}"/>
</Grid>
</ViewCell>
</DataTemplate>
<utils:ChatMessageTemplateSelector x:Key="chatMessageTemplateSelector"
SentMessageTemplate="{StaticResource sentMessageTemplate}"
ReceivedMessageTemplate="{StaticResource receivedMessageTemplate}"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" VerticalOptions="Start" Text="ELF INFO CHAT" FontSize="16" TextColor="{StaticResource highlight_text}"/>
<pancakeview:PancakeView Grid.Row="1" BackgroundColor="White" CornerRadius="8">
<ListView ItemsSource="{Binding Messages}" ItemTemplate="{StaticResource chatMessageTemplateSelector}"/>

</pancakeview:PancakeView>
<Grid Grid.Row="2" Margin="0,20,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Entry Grid.Column="0" VerticalOptions="End" PlaceholderColor="White" Placeholder="Enter message" Text="{Binding CurrentMessage}"/>
<Button Grid.Column="1" Text="Send" Command="{Binding SendMessageCommand}"/>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>
17 changes: 10 additions & 7 deletions src/SantaTalk/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
NavigationPage.BackButtonTitle=""
ios:Page.UseSafeArea="True"
BackgroundColor="{StaticResource dark_gradient}"
x:Class="SantaTalk.MainPage">
x:Class="SantaTalk.Pages.MainPage">

<ContentPage.BindingContext>
<viewmodels:MainPageViewModel />
Expand All @@ -22,12 +22,12 @@
BackgroundGradientEndColor="{StaticResource light_gradient}">

<Grid x:Name="MainGrid">
<ScrollView VerticalOptions="FillAndExpand">
<ScrollView VerticalOptions="StartAndExpand">
<StackLayout VerticalOptions="FillAndExpand" Padding="24" Spacing="0">
<StackLayout VerticalOptions="CenterAndExpand">
<StackLayout>
<Label Text="WELCOME TO" FontSize="16" TextColor="{StaticResource highlight_text}"/>
<Label Text="Santa Talk" FontSize="48"/>
<Label Margin="0,24,0,16" FontSize="15" Text="Write Santa a letter, and he'll instantly let you know if you've been naughty or nice!" />
<Label Text="Santa Talk" FontSize="38"/>
<Label Margin="0,12,0,12" FontSize="15" Text="Write Santa a letter, and he'll instantly let you know if you've been naughty or nice!" />
</StackLayout>
<StackLayout Spacing="16" VerticalOptions="CenterAndExpand">
<StackLayout Spacing="8">
Expand All @@ -39,9 +39,12 @@
<Editor Text="{Binding LetterText}" TextColor="White"/>
</StackLayout>
</StackLayout>
<Button VerticalOptions="EndAndExpand" Text="SEND TO SANTA" Margin="16" Command="{Binding SendLetterCommand}" />
<Button VerticalOptions="EndAndExpand" Text="SEND TO SANTA" Margin="16,16,16,0" FontSize="Small" Command="{Binding SendLetterCommand}" />
<Button VerticalOptions="End" BackgroundColor="Transparent" Text="Need more info?" TextColor="White" FontSize="Micro" Margin="0" Command="{Binding ConnectToChatCommand}"/>


</StackLayout>
</ScrollView>
</ScrollView>
</Grid>

</controls:PancakeView>
Expand Down
73 changes: 73 additions & 0 deletions src/SantaTalk/Pages/ChatPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
NavigationPage.HasNavigationBar="False"
NavigationPage.BackButtonTitle=""
ios:Page.UseSafeArea="True"
BackgroundColor="{StaticResource dark_gradient}"
xmlns:viewmodels="clr-namespace:SantaTalk"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:utils="clr-namespace:SantaTalk.Utils"
xmlns:pancakeview="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"
x:Class="SantaTalk.Pages.ChatPage">
<ContentPage.BindingContext>
<viewmodels:ChatPageViewModel />
</ContentPage.BindingContext>
<ContentPage.Resources>
<ResourceDictionary>
<DataTemplate x:Key="receivedMessageTemplate">
<ViewCell>
<Grid Margin="0,7,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="9*"/>
</Grid.ColumnDefinitions>
<pancakeview:PancakeView Grid.Column="1" Margin="2" BackgroundColor="Blue" CornerRadius="6">

<Label Padding="6" Text="{Binding Message}"/>
</pancakeview:PancakeView>
</Grid>
</ViewCell>
</DataTemplate>
<DataTemplate x:Key="sentMessageTemplate">
<ViewCell>
<Grid Margin="0,7,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="9*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<pancakeview:PancakeView Grid.Column="0" Margin="2" BackgroundColor="Red" CornerRadius="6">

<Label Padding="6" Text="{Binding Message}"/>
</pancakeview:PancakeView>
</Grid>
</ViewCell>
</DataTemplate>
<utils:ChatMessageTemplateSelector x:Key="chatMessageTemplateSelector"
SentMessageTemplate="{StaticResource sentMessageTemplate}"
ReceivedMessageTemplate="{StaticResource receivedMessageTemplate}"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<Grid Padding="24,24,24,0" x:Name="MainGrid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" VerticalOptions="Start" Text="ELF INFO CHAT" FontSize="16" Margin="0,0,0,16" TextColor="{StaticResource highlight_text}"/>
<pancakeview:PancakeView Grid.Row="1" BackgroundColor="White" CornerRadius="8">
<ListView HasUnevenRows="True" SeparatorVisibility="None" ItemsSource="{Binding Messages}" ItemTemplate="{StaticResource chatMessageTemplateSelector}"/>
</pancakeview:PancakeView>
<Grid Grid.Row="2" Margin="0,20,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Entry Grid.Column="0" VerticalOptions="End" PlaceholderColor="White" Placeholder="Enter message" Text="{Binding CurrentMessage}"/>
<Button Grid.Column="1" Text="Send" FontSize="Small" Command="{Binding SendMessageCommand}"/>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>
Loading