From 7028ea0b8ba80c5ad9a0547decc314aaa7a2ac20 Mon Sep 17 00:00:00 2001 From: Jonathan Dick Date: Tue, 11 May 2021 19:50:59 -0400 Subject: [PATCH 001/270] Update templates to work on p4 (#1010) --- .../.template.config/template.json | 6 +- .../Android/Resources/values/colors.xml | 6 ++ .../Android/Resources/values/styles.xml | 16 +++ src/Templates/src/maui-mobile/App.xaml | 19 +++- src/Templates/src/maui-mobile/App.xaml.cs | 6 +- src/Templates/src/maui-mobile/MainPage.xaml | 51 ++++++---- .../src/maui-mobile/MainPage.xaml.cs | 7 +- src/Templates/src/maui-mobile/MainWindow.cs | 16 --- .../src/maui-mobile/MauiApp1.in.csproj | 2 + .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 96932 bytes .../Resources/Images/dotnet_bot.svg | 93 ++++++++++++++++++ src/Templates/src/maui-mobile/Startup.cs | 6 +- 12 files changed, 177 insertions(+), 51 deletions(-) create mode 100644 src/Templates/src/maui-mobile/Android/Resources/values/colors.xml create mode 100644 src/Templates/src/maui-mobile/Android/Resources/values/styles.xml delete mode 100644 src/Templates/src/maui-mobile/MainWindow.cs create mode 100644 src/Templates/src/maui-mobile/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 src/Templates/src/maui-mobile/Resources/Images/dotnet_bot.svg diff --git a/src/Templates/src/maui-mobile/.template.config/template.json b/src/Templates/src/maui-mobile/.template.config/template.json index 27d8fa5ee94d..0a57b0afb59f 100644 --- a/src/Templates/src/maui-mobile/.template.config/template.json +++ b/src/Templates/src/maui-mobile/.template.config/template.json @@ -1,10 +1,10 @@ { "$schema": "http://json.schemastore.org/template", "author": "Microsoft", - "classifications": [ "Maui", "Android", "iOS", "macOS", "Catalyst" ], + "classifications": [ "MAUI", "Android", "iOS", "macOS", "Mac Catalyst" ], "identity": "Microsoft.Maui.SingleProject", - "name": ".NET Maui Mobile Application", - "description": "A project for creating a .NET MAUI application for iOS, Android and macOS", + "name": ".NET MAUI (Multi-platform App UI) Application", + "description": "A project for creating a .NET MAUI application for iOS, Android, and Mac Catalyst", "shortName": "maui", "tags": { "language": "C#", diff --git a/src/Templates/src/maui-mobile/Android/Resources/values/colors.xml b/src/Templates/src/maui-mobile/Android/Resources/values/colors.xml new file mode 100644 index 000000000000..c04d7492abf8 --- /dev/null +++ b/src/Templates/src/maui-mobile/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/src/Templates/src/maui-mobile/Android/Resources/values/styles.xml b/src/Templates/src/maui-mobile/Android/Resources/values/styles.xml new file mode 100644 index 000000000000..b749b6081443 --- /dev/null +++ b/src/Templates/src/maui-mobile/Android/Resources/values/styles.xml @@ -0,0 +1,16 @@ + + + + + + + + diff --git a/src/Templates/src/maui-mobile/App.xaml.cs b/src/Templates/src/maui-mobile/App.xaml.cs index 4ea5e101cf50..b50784230048 100644 --- a/src/Templates/src/maui-mobile/App.xaml.cs +++ b/src/Templates/src/maui-mobile/App.xaml.cs @@ -10,11 +10,11 @@ public App() InitializeComponent(); } - public override IWindow CreateWindow(IActivationState activationState) + protected override IWindow CreateWindow(IActivationState activationState) { Microsoft.Maui.Controls.Compatibility.Forms.Init(activationState); - return new MainWindow(); + return new Microsoft.Maui.Controls.Window(new MainPage()); } } -} \ No newline at end of file +} diff --git a/src/Templates/src/maui-mobile/MainPage.xaml b/src/Templates/src/maui-mobile/MainPage.xaml index 5b5e14136d4c..820558ec21fc 100644 --- a/src/Templates/src/maui-mobile/MainPage.xaml +++ b/src/Templates/src/maui-mobile/MainPage.xaml @@ -1,28 +1,41 @@ + BackgroundColor="{DynamicResource PageBackgroundColor}"> - + + -