From 1769c0f35487cc5222e9eefad8d2f21d84731649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=B1=EC=88=98/Common=20Platform=20Lab=28SR?= =?UTF-8?q?=29/Staff=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 20 Jul 2021 15:51:51 +0900 Subject: [PATCH] Add Essentials.Samples.Tizen (#24) * Add Essentials.Samples.Tizen * Add guard for null exception * Fix Essentials.Samples for Tizen * Fix csproj for net6 * Remove Forms.Init --- Microsoft.Maui.Tizen.sln | 31 +++++++++++++++++++ .../Core/src/Compatibility.csproj | 2 +- .../Core/src/Tizen/Cells/ViewCellRenderer.cs | 2 +- .../Samples/Platforms/Tizen/Program.cs | 9 ++---- .../Platforms/Tizen/tizen-manifest.xml | 2 +- src/Essentials/src/Email/Email.tizen.cs | 6 ++-- src/Essentials/src/Essentials.csproj | 4 +-- 7 files changed, 41 insertions(+), 15 deletions(-) diff --git a/Microsoft.Maui.Tizen.sln b/Microsoft.Maui.Tizen.sln index 4e8bf48e8000..53f703a58728 100644 --- a/Microsoft.Maui.Tizen.sln +++ b/Microsoft.Maui.Tizen.sln @@ -118,6 +118,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.SourceGen", "src\C EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Sample.Tizen", "src\Controls\samples\Controls.Sample.Tizen\Controls.Sample.Tizen.csproj", "{4D5FF3BF-5C21-4DE9-B752-2F92BCB2F7A6}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Essentials.Samples.Tizen", "src\Essentials\samples\Samples.Tizen\Essentials.Samples.Tizen.csproj", "{64483F36-30C0-412D-8230-F69669486F8A}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution src\Compatibility\ControlGallery\src\Issues.Shared\Compatibility.ControlGallery.Issues.Shared.projitems*{ae2513cb-4e5e-4e5c-8237-88954d4c9433}*SharedItemsImports = 13 @@ -862,6 +864,34 @@ Global {4D5FF3BF-5C21-4DE9-B752-2F92BCB2F7A6}.Release|x64.Build.0 = Release|Any CPU {4D5FF3BF-5C21-4DE9-B752-2F92BCB2F7A6}.Release|x86.ActiveCfg = Release|Any CPU {4D5FF3BF-5C21-4DE9-B752-2F92BCB2F7A6}.Release|x86.Build.0 = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|ARM.ActiveCfg = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|ARM.Build.0 = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|ARM64.Build.0 = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|iPhone.Build.0 = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|x64.ActiveCfg = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|x64.Build.0 = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|x86.ActiveCfg = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Debug|x86.Build.0 = Debug|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|Any CPU.Build.0 = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|ARM.ActiveCfg = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|ARM.Build.0 = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|ARM64.ActiveCfg = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|ARM64.Build.0 = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|iPhone.ActiveCfg = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|iPhone.Build.0 = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|x64.ActiveCfg = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|x64.Build.0 = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|x86.ActiveCfg = Release|Any CPU + {64483F36-30C0-412D-8230-F69669486F8A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -907,6 +937,7 @@ Global {9FAA9654-80E6-4664-9702-47998A04E8FE} = {29AC50BF-B4FB-450B-9386-0C5AD4B84226} {061EC251-FB7A-43B2-A6AD-065D2CCEF1BD} = {D5B986A3-7FC9-437E-8030-349AA4698DFD} {4D5FF3BF-5C21-4DE9-B752-2F92BCB2F7A6} = {806499EB-C2CC-4E85-BC19-613F3DE5E0C3} + {64483F36-30C0-412D-8230-F69669486F8A} = {5817A848-0B04-4035-9F7E-B8621B61CBDD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {650AE971-2F29-46A8-822C-FB4FCDC6A9A0} diff --git a/src/Compatibility/Core/src/Compatibility.csproj b/src/Compatibility/Core/src/Compatibility.csproj index 06649938f982..b0da562aef03 100644 --- a/src/Compatibility/Core/src/Compatibility.csproj +++ b/src/Compatibility/Core/src/Compatibility.csproj @@ -57,7 +57,7 @@ - + diff --git a/src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs b/src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs index 6acda7e5de1f..f2b9c311e19a 100644 --- a/src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs +++ b/src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs @@ -98,7 +98,7 @@ void UpdatePropagateEvent(View view) { if (element is Button || element is Switch) { - var nativeView = Platform.GetRenderer(element).NativeView ?? null; + var nativeView = Platform.GetRenderer(element)?.NativeView ?? null; if (nativeView != null) { nativeView.PropagateEvents = false; diff --git a/src/Essentials/samples/Samples/Platforms/Tizen/Program.cs b/src/Essentials/samples/Samples/Platforms/Tizen/Program.cs index cc8575ab4cbd..888752757c9f 100644 --- a/src/Essentials/samples/Samples/Platforms/Tizen/Program.cs +++ b/src/Essentials/samples/Samples/Platforms/Tizen/Program.cs @@ -5,24 +5,19 @@ namespace Samples.Tizen { - class Program : FormsApplication + class Program : MauiApplication { - static App formsApp; - protected override void OnCreate() { base.OnCreate(); MaterialComponents.Init(DirectoryInfo.Resource); - Microsoft.Maui.Essentials.Platform.Init(MainWindow); - LoadApplication(formsApp ??= new App()); + Microsoft.Maui.Essentials.Platform.Init(CoreUIAppContext.GetInstance(this).MainWindow); } static void Main(string[] args) { var app = new Program(); - Forms.Init(app); - Microsoft.Maui.Essentials.Platform.MapServiceToken = "MAP_SERVICE_KEY"; app.Run(args); } } diff --git a/src/Essentials/samples/Samples/Platforms/Tizen/tizen-manifest.xml b/src/Essentials/samples/Samples/Platforms/Tizen/tizen-manifest.xml index 934859bc5fab..7211c46f6225 100644 --- a/src/Essentials/samples/Samples/Platforms/Tizen/tizen-manifest.xml +++ b/src/Essentials/samples/Samples/Platforms/Tizen/tizen-manifest.xml @@ -1,7 +1,7 @@  - + Samples.Tizen.png diff --git a/src/Essentials/src/Email/Email.tizen.cs b/src/Essentials/src/Email/Email.tizen.cs index dd66cf687673..f12c8f16a5be 100644 --- a/src/Essentials/src/Email/Email.tizen.cs +++ b/src/Essentials/src/Email/Email.tizen.cs @@ -18,15 +18,15 @@ static Task PlatformComposeAsync(EmailMessage message) Uri = "mailto:", }; - if (message.Bcc.Count > 0) + if (message.Bcc?.Count > 0) appControl.ExtraData.Add(AppControlData.Bcc, message.Bcc); if (!string.IsNullOrEmpty(message.Body)) appControl.ExtraData.Add(AppControlData.Text, message.Body); - if (message.Cc.Count > 0) + if (message.Cc?.Count > 0) appControl.ExtraData.Add(AppControlData.Cc, message.Cc); if (!string.IsNullOrEmpty(message.Subject)) appControl.ExtraData.Add(AppControlData.Subject, message.Subject); - if (message.To.Count > 0) + if (message.To?.Count > 0) appControl.ExtraData.Add(AppControlData.To, message.To); AppControl.SendLaunchRequest(appControl); diff --git a/src/Essentials/src/Essentials.csproj b/src/Essentials/src/Essentials.csproj index 871106caca00..330934a7e56e 100644 --- a/src/Essentials/src/Essentials.csproj +++ b/src/Essentials/src/Essentials.csproj @@ -56,11 +56,11 @@ --> - +