Skip to content

Commit

Permalink
Add Essentials.Samples.Tizen (#24)
Browse files Browse the repository at this point in the history
* Add Essentials.Samples.Tizen

* Add guard for null exception

* Fix Essentials.Samples for Tizen

* Fix csproj for net6

* Remove Forms.Init
  • Loading branch information
sung-su authored and rookiejava committed Nov 9, 2021
1 parent c9471ba commit 4a4199b
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 15 deletions.
31 changes: 31 additions & 0 deletions ._Microsoft.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,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", "{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Compatibility\ControlGallery\src\Issues.Shared\Compatibility.ControlGallery.Issues.Shared.projitems*{ae2513cb-4e5e-4e5c-8237-88954d4c9433}*SharedItemsImports = 13
Expand Down Expand Up @@ -751,6 +753,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
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|ARM.ActiveCfg = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|ARM.Build.0 = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|ARM64.Build.0 = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|iPhone.Build.0 = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|x64.ActiveCfg = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|x64.Build.0 = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|x86.ActiveCfg = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Debug|x86.Build.0 = Debug|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|Any CPU.Build.0 = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|ARM.ActiveCfg = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|ARM.Build.0 = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|ARM64.ActiveCfg = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|ARM64.Build.0 = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|iPhone.ActiveCfg = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|iPhone.Build.0 = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|x64.ActiveCfg = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|x64.Build.0 = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|x86.ActiveCfg = Release|Any CPU
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -791,6 +821,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}
{8B44D770-0239-43A4-8F1D-7C8BD2C8CE7B} = {5817A848-0B04-4035-9F7E-B8621B61CBDD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {650AE971-2F29-46A8-822C-FB4FCDC6A9A0}
Expand Down
31 changes: 31 additions & 0 deletions Microsoft.Maui.Tizen.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion src/Compatibility/Core/src/Compatibility-net6.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<ProjectReference Include="..\..\Android.FormsViewGroup\src\Compatibility.Android.FormsViewGroup-net6.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'tizen'" >
<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'net6.0-tizen'" >
<Compile Include="$(TizenRoot)**\*.cs"></Compile>
<EmbeddedResource Include="$(TizenRoot)Resources\*.resx" />
<EmbeddedResource Include="$(TizenRoot)Resources\*.png" />
Expand Down
2 changes: 1 addition & 1 deletion src/Compatibility/Core/src/Tizen/Cells/ViewCellRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 2 additions & 7 deletions src/Essentials/samples/Samples/Platforms/Tizen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@

namespace Samples.Tizen
{
class Program : FormsApplication
class Program : MauiApplication<Startup>
{
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);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.microsoft.maui.essentials" version="1.0.0" api-version="4" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="com.microsoft.maui.essentials" exec="Samples.Tizen.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" splash-screen-display="true" launch_mode="single">
<ui-application appid="com.microsoft.maui.essentials" exec="Essentials.Samples.Tizen.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" splash-screen-display="true" launch_mode="single">
<label>Essentials</label>
<icon>Samples.Tizen.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
Expand Down
6 changes: 3 additions & 3 deletions src/Essentials/src/Email/Email.tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Essentials/src/Essentials-net6.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@
<Compile Include="**\*.watchos.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<Compile Include="**\*.watchos.*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup> -->
<!-- <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'tizen' ">
<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'tizen' ">
<PackageReference Include="Tizen.NET" Version="4.0.0" PrivateAssets="All" />
<Compile Include="**\*.tizen.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<Compile Include="**\*.tizen.*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup> -->
</ItemGroup>
<!-- <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'macos' ">
<Compile Include="**\*.macos.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
<Compile Include="**\*.macos.*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
Expand Down

0 comments on commit 4a4199b

Please sign in to comment.