diff --git a/cake/UtilsManaged.cake b/cake/UtilsManaged.cake index e608965a..b7815df7 100644 --- a/cake/UtilsManaged.cake +++ b/cake/UtilsManaged.cake @@ -160,9 +160,10 @@ var CreateSamplesZip = new Action ((samplesDirPath Force = true, Recursive = true }; - DeleteDirectories (GetDirectories ($"{workingDir}/**/bin"), settings); - DeleteDirectories (GetDirectories ($"{workingDir}/**/obj"), settings); - DeleteDirectories (GetDirectories ($"{workingDir}/**/AppPackages"), settings); + DeleteDirectories (GetDirectories ($"{workingDir}/*/*/*/bin"), settings); + DeleteDirectories (GetDirectories ($"{workingDir}/*/*/*/obj"), settings); + DeleteDirectories (GetDirectories ($"{workingDir}/*/*/*/AppPackages"), settings); + DeleteDirectories (GetDirectories ($"{workingDir}/*/*/.vs"), settings); // make sure the paths are in the correct format for comparison var dpc = System.IO.Path.DirectorySeparatorChar; diff --git a/samples/Basic/ElmSharp/SkiaSharpSample.sln b/samples/Basic/ElmSharp/SkiaSharpSample.sln new file mode 100644 index 00000000..cf7e29d8 --- /dev/null +++ b/samples/Basic/ElmSharp/SkiaSharpSample.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2010 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SkiaSharp.Views.Shared", "..\..\..\source\SkiaSharp.Views\SkiaSharp.Views.Shared\SkiaSharp.Views.Shared.shproj", "{5A67972C-1C04-4913-9950-06A03BFE9533}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Binding", "..\..\..\binding\Binding\Binding.shproj", "{9C502B9A-25D4-473F-89BD-5A13DDE16354}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Binding.Shared", "..\..\..\binding\Binding.Shared\Binding.Shared.shproj", "{6F8349DC-90AC-441D-8B8B-BE623F46BE6D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharp.Tizen", "..\..\..\binding\SkiaSharp.Tizen\SkiaSharp.Tizen.csproj", "{A7B25831-3EA3-4F88-AA82-4D4CA66B19C6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkiaSharp.Views.Tizen", "..\..\..\source\SkiaSharp.Views\SkiaSharp.Views.Tizen\SkiaSharp.Views.Tizen.csproj", "{E0AAA975-BCF0-46F9-8E95-407FD6931850}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkiaSharpSample", "SkiaSharpSample\SkiaSharpSample.csproj", "{875CA172-1A84-48A7-A55D-A92AC9A56CA6}" +EndProject +Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\..\source\SkiaSharp.Views\SkiaSharp.Views.Shared\SkiaSharp.Views.Shared.projitems*{5a67972c-1c04-4913-9950-06a03bfe9533}*SharedItemsImports = 13 + ..\..\..\binding\Binding.Shared\Binding.Shared.projitems*{6f8349dc-90ac-441d-8b8b-be623f46be6d}*SharedItemsImports = 13 + ..\..\..\binding\Binding\Binding.projitems*{9c502b9a-25d4-473f-89bd-5a13dde16354}*SharedItemsImports = 13 + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A7B25831-3EA3-4F88-AA82-4D4CA66B19C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7B25831-3EA3-4F88-AA82-4D4CA66B19C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7B25831-3EA3-4F88-AA82-4D4CA66B19C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7B25831-3EA3-4F88-AA82-4D4CA66B19C6}.Release|Any CPU.Build.0 = Release|Any CPU + {E0AAA975-BCF0-46F9-8E95-407FD6931850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0AAA975-BCF0-46F9-8E95-407FD6931850}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0AAA975-BCF0-46F9-8E95-407FD6931850}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0AAA975-BCF0-46F9-8E95-407FD6931850}.Release|Any CPU.Build.0 = Release|Any CPU + {875CA172-1A84-48A7-A55D-A92AC9A56CA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {875CA172-1A84-48A7-A55D-A92AC9A56CA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {875CA172-1A84-48A7-A55D-A92AC9A56CA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {875CA172-1A84-48A7-A55D-A92AC9A56CA6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {67EACD19-0CEA-4127-9842-549AA6FB84C9} + EndGlobalSection +EndGlobal diff --git a/samples/Basic/ElmSharp/SkiaSharpSample/App.cs b/samples/Basic/ElmSharp/SkiaSharpSample/App.cs new file mode 100644 index 00000000..477232a8 --- /dev/null +++ b/samples/Basic/ElmSharp/SkiaSharpSample/App.cs @@ -0,0 +1,79 @@ +using System; +using ElmSharp; +using Tizen.Applications; + +using SkiaSharp; +using SkiaSharp.Views.Tizen; + +namespace SkiaSharpSample +{ + public class App : CoreUIApplication + { + public static void Main(string[] args) + { + Elementary.Initialize(); + Elementary.ThemeOverlay(); + + var app = new App(); + app.Run(args); + } + + protected override void OnCreate() + { + base.OnCreate(); + + Initialize(); + } + + private void Initialize() + { + var window = new Window("ElmSharpApp"); + window.BackButtonPressed += OnBackButtonPressed; + window.AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90; + window.Show(); + + var skiaView = new SKCanvasView(window); + skiaView.PaintSurface += OnPaintSurface; + skiaView.Show(); + + var conformant = new Conformant(window); + conformant.Show(); + conformant.SetContent(skiaView); + } + + private void OnPaintSurface(object sender, SKPaintSurfaceEventArgs e) + { + var skiaView = sender as SKCanvasView; + var geo = skiaView.Geometry.ToSKRect(); + + // the the canvas and properties + var canvas = e.Surface.Canvas; + + // get the screen density for scaling + var scale = e.Info.Width / geo.Width; + + // handle the device screen density + canvas.Scale(scale); + + // make sure the canvas is blank + canvas.Clear(SKColors.White); + + // draw some text + var paint = new SKPaint + { + Color = SKColors.Black, + IsAntialias = true, + Style = SKPaintStyle.Fill, + TextAlign = SKTextAlign.Center, + TextSize = 24 + }; + var coord = new SKPoint(geo.Width / 2f, (geo.Height + paint.TextSize) / 2f); + canvas.DrawText("SkiaSharp", coord, paint); + } + + private void OnBackButtonPressed(object sender, EventArgs e) + { + Exit(); + } + } +} diff --git a/samples/Basic/ElmSharp/SkiaSharpSample/SkiaSharpSample.csproj b/samples/Basic/ElmSharp/SkiaSharpSample/SkiaSharpSample.csproj new file mode 100644 index 00000000..77cabcce --- /dev/null +++ b/samples/Basic/ElmSharp/SkiaSharpSample/SkiaSharpSample.csproj @@ -0,0 +1,40 @@ + + + + tizen40 + Exe + + + + portable + + + None + + + + + + + + + + + + + + + + tpkroot\bin\runtimes\tizen-armel\native\libSkiaSharp.so + Always + + + + + + diff --git a/samples/Basic/ElmSharp/SkiaSharpSample/shared/res/SkiaSharpSample.png b/samples/Basic/ElmSharp/SkiaSharpSample/shared/res/SkiaSharpSample.png new file mode 100644 index 00000000..9f3cb986 Binary files /dev/null and b/samples/Basic/ElmSharp/SkiaSharpSample/shared/res/SkiaSharpSample.png differ diff --git a/samples/Basic/ElmSharp/SkiaSharpSample/tizen-manifest.xml b/samples/Basic/ElmSharp/SkiaSharpSample/tizen-manifest.xml new file mode 100644 index 00000000..9a282582 --- /dev/null +++ b/samples/Basic/ElmSharp/SkiaSharpSample/tizen-manifest.xml @@ -0,0 +1,10 @@ + + + + + + SkiaSharpSample.png + + + + diff --git a/samples/Basic/Tizen/SkiaSharpSample/Program.cs b/samples/Basic/Tizen/SkiaSharpSample/Program.cs new file mode 100644 index 00000000..faa14a65 --- /dev/null +++ b/samples/Basic/Tizen/SkiaSharpSample/Program.cs @@ -0,0 +1,21 @@ +using Xamarin.Forms.Platform.Tizen; + +namespace SkiaSharpSample +{ + public class Program : FormsApplication + { + public static void Main(string[] args) + { + var app = new Program(); + Forms.Init(app); + app.Run(args); + } + + protected override void OnCreate() + { + base.OnCreate(); + + LoadApplication(new App()); + } + } +} diff --git a/samples/Basic/Tizen/SkiaSharpSample/SkiaSharpSample.cs b/samples/Basic/Tizen/SkiaSharpSample/SkiaSharpSample.cs deleted file mode 100644 index 015e9513..00000000 --- a/samples/Basic/Tizen/SkiaSharpSample/SkiaSharpSample.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace SkiaSharpSample -{ - class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication - { - protected override void OnCreate() - { - base.OnCreate(); - - LoadApplication(new App()); - } - - static void Main(string[] args) - { - var app = new Program(); - global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); - app.Run(args); - } - } -} diff --git a/samples/Basic/Tizen/SkiaSharpSample/tizen-manifest.xml b/samples/Basic/Tizen/SkiaSharpSample/tizen-manifest.xml index 935106cb..9a282582 100644 --- a/samples/Basic/Tizen/SkiaSharpSample/tizen-manifest.xml +++ b/samples/Basic/Tizen/SkiaSharpSample/tizen-manifest.xml @@ -1,15 +1,10 @@  - - - - - SkiaSharpSample.png + + + + + SkiaSharpSample.png - + +