From f8ce844fd880feacca9bf176defe160f1426dd4f Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Sat, 2 Dec 2017 00:05:22 +0200 Subject: [PATCH] Improvements to the samples for v1.60 --- samples/FormsSample/Android/Android.csproj | 6 +- .../Android/Properties/AndroidManifest.xml | 4 +- samples/FormsSample/Core/Core.csproj | 81 +++---------------- samples/FormsSample/Core/MainPage.xaml.cs | 8 +- .../Core/Properties/AssemblyInfo.cs | 28 ------- samples/FormsSample/Mac/Info.plist | 8 +- samples/FormsSample/Mac/Mac.csproj | 3 +- samples/FormsSample/UWP/Package.appxmanifest | 2 +- samples/FormsSample/UWP/UWP.csproj | 7 +- samples/FormsSample/UWP/project.json | 24 ------ samples/FormsSample/iOS/Info.plist | 4 +- samples/FormsSample/iOS/iOS.csproj | 5 +- samples/MacSample/MacSample/Info.plist | 4 +- samples/MacSample/MacSample/MacSample.csproj | 1 - .../SamplesInitializer.cs | 2 +- .../Samples/SvgSample.cs | 43 ---------- .../Samples/SvgTransparencySample.cs | 43 ---------- .../SkiaSharpSample.Shared.projitems | 8 +- samples/TvSample/TvSample/Info.plist | 4 +- samples/TvSample/TvSample/TvSample.csproj | 1 - .../UWPSample/UWPSample/Package.appxmanifest | 2 +- samples/UWPSample/UWPSample/UWPSample.csproj | 5 +- samples/UWPSample/UWPSample/project.json | 22 ----- samples/WPFSample/WPFSample/WPFSample.csproj | 2 - .../WatchSample.OnWatch/Info.plist | 4 +- .../WatchSample.OnWatchExtension/Info.plist | 4 +- samples/WatchSample/WatchSample/Info.plist | 4 +- .../WindowsSample/WindowsSample.csproj | 2 - 28 files changed, 50 insertions(+), 281 deletions(-) delete mode 100644 samples/FormsSample/Core/Properties/AssemblyInfo.cs delete mode 100644 samples/FormsSample/UWP/project.json delete mode 100644 samples/SkiaSharpSample.Shared/Samples/SvgSample.cs delete mode 100644 samples/SkiaSharpSample.Shared/Samples/SvgTransparencySample.cs delete mode 100644 samples/UWPSample/UWPSample/project.json diff --git a/samples/FormsSample/Android/Android.csproj b/samples/FormsSample/Android/Android.csproj index 387a3721..f6b277c5 100644 --- a/samples/FormsSample/Android/Android.csproj +++ b/samples/FormsSample/Android/Android.csproj @@ -17,7 +17,7 @@ Off Properties\AndroidManifest.xml false - v6.0 + v8.0 armeabi-v7a;x86;arm64-v8a;x86_64 @@ -53,13 +53,11 @@ - - - + diff --git a/samples/FormsSample/Android/Properties/AndroidManifest.xml b/samples/FormsSample/Android/Properties/AndroidManifest.xml index 495a72c9..bf80c761 100644 --- a/samples/FormsSample/Android/Properties/AndroidManifest.xml +++ b/samples/FormsSample/Android/Properties/AndroidManifest.xml @@ -1,8 +1,8 @@  - - + - 11.0 - Debug - AnyCPU - {E01FBABA-8DA1-432B-9253-F4ABE13A3A6A} - Library - Properties + netstandard1.3 + library SkiaSharpSample.FormsSample SkiaSharpSample.FormsSample - 512 - v4.5 - Profile259 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + false - true - full - false + TRACE;DEBUG;NET_STANDARD bin\Debug\ - DEBUG;TRACE - prompt - 4 - pdbonly - true + TRACE;NET_STANDARD bin\Release\ - TRACE - prompt - 4 - - - + - - App.xaml - - - DetailContentsPage.xaml - - - DetailsPage.xaml - - - MainPage.xaml - - - MasterPage.xaml - - - - - - Designer - MSBuild:UpdateDesignTimeXaml - - - Designer - MSBuild:UpdateDesignTimeXaml - - - - - MSBuild:UpdateDesignTimeXaml - Designer - - - - - MSBuild:UpdateDesignTimeXaml - Designer - - - - - MSBuild:UpdateDesignTimeXaml - Designer - + + + - \ No newline at end of file diff --git a/samples/FormsSample/Core/MainPage.xaml.cs b/samples/FormsSample/Core/MainPage.xaml.cs index cb196ccb..ac6bafd7 100644 --- a/samples/FormsSample/Core/MainPage.xaml.cs +++ b/samples/FormsSample/Core/MainPage.xaml.cs @@ -31,13 +31,13 @@ namespace SkiaSharpSample.FormsSample private static SampleBase[] GetPlatformSamples() { - switch (Device.OS) + switch (Device.RuntimePlatform) { - case TargetPlatform.iOS: + case Device.iOS: return SamplesManager.GetSamples(SamplePlatforms.iOS).ToArray(); - case TargetPlatform.Android: + case Device.Android: return SamplesManager.GetSamples(SamplePlatforms.Android).ToArray(); - case TargetPlatform.Windows: + case Device.UWP: return SamplesManager.GetSamples(SamplePlatforms.UWP).ToArray(); default: return SamplesManager.GetSamples(SamplePlatforms.All).ToArray(); diff --git a/samples/FormsSample/Core/Properties/AssemblyInfo.cs b/samples/FormsSample/Core/Properties/AssemblyInfo.cs deleted file mode 100644 index 30237392..00000000 --- a/samples/FormsSample/Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Resources; -using System.Reflection; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SkiaSharpSample.FormsSample")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SkiaSharpSample.FormsSample")] -[assembly: AssemblyCopyright("Copyright © Xamarin Inc. 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: NeutralResourcesLanguage("en")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/FormsSample/Mac/Info.plist b/samples/FormsSample/Mac/Info.plist index 06b0f7e7..6e24efe3 100644 --- a/samples/FormsSample/Mac/Info.plist +++ b/samples/FormsSample/Mac/Info.plist @@ -6,10 +6,6 @@ SkiaSharp for Xamarin.Forms CFBundleIdentifier com.skiasharp.samples.forms - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 LSMinimumSystemVersion 10.10 CFBundleDevelopmentRegion @@ -26,5 +22,9 @@ NSApplication XSAppIconAssets Assets.xcassets/AppIcon.appiconset + CFBundleShortVersionString + 1.60.0.0 + CFBundleVersion + 1600000 diff --git a/samples/FormsSample/Mac/Mac.csproj b/samples/FormsSample/Mac/Mac.csproj index 1e955867..292c2c14 100644 --- a/samples/FormsSample/Mac/Mac.csproj +++ b/samples/FormsSample/Mac/Mac.csproj @@ -58,11 +58,10 @@ - - + diff --git a/samples/FormsSample/UWP/Package.appxmanifest b/samples/FormsSample/UWP/Package.appxmanifest index 76647be1..c08ce90a 100644 --- a/samples/FormsSample/UWP/Package.appxmanifest +++ b/samples/FormsSample/UWP/Package.appxmanifest @@ -1,6 +1,6 @@  - + SkiaSharp for Xamarin.Forms diff --git a/samples/FormsSample/UWP/UWP.csproj b/samples/FormsSample/UWP/UWP.csproj index 47c4b440..f0ec3241 100644 --- a/samples/FormsSample/UWP/UWP.csproj +++ b/samples/FormsSample/UWP/UWP.csproj @@ -22,6 +22,7 @@ False Always x86|x64|arm + PackageReference true @@ -93,13 +94,13 @@ true - - + - + + diff --git a/samples/FormsSample/UWP/project.json b/samples/FormsSample/UWP/project.json deleted file mode 100644 index 5c9a00a5..00000000 --- a/samples/FormsSample/UWP/project.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "dependencies": { - "HarfBuzzSharp": "1.4.6", - "Microsoft.NETCore.UniversalWindowsPlatform": "5.4.0", - "PCLStorage": "1.0.2", - "SkiaSharp": "1.60.0", - "SkiaSharp.HarfBuzz": "1.60.0-beta", - "SkiaSharp.Svg": "1.59.0", - "SkiaSharp.Views": "1.60.0", - "SkiaSharp.Views.Forms": "1.60.0", - "Xamarin.Forms": "2.4.0.18342" - }, - "frameworks": { - "uap10.0.10240": {} - }, - "runtimes": { - "win10-arm": {}, - "win10-arm-aot": {}, - "win10-x86": {}, - "win10-x86-aot": {}, - "win10-x64": {}, - "win10-x64-aot": {} - } -} diff --git a/samples/FormsSample/iOS/Info.plist b/samples/FormsSample/iOS/Info.plist index 4849dfe6..c061d9c3 100644 --- a/samples/FormsSample/iOS/Info.plist +++ b/samples/FormsSample/iOS/Info.plist @@ -28,13 +28,13 @@ CFBundleIdentifier com.skiasharp.samples.forms CFBundleVersion - 10551010 + 1600000 CFBundleIconFiles UILaunchStoryboardName LaunchScreen CFBundleShortVersionString - 1.55.1.0 + 1.60.0.0 UIStatusBarTintParameters UINavigationBar diff --git a/samples/FormsSample/iOS/iOS.csproj b/samples/FormsSample/iOS/iOS.csproj index 95e6774a..1863b214 100644 --- a/samples/FormsSample/iOS/iOS.csproj +++ b/samples/FormsSample/iOS/iOS.csproj @@ -11,7 +11,6 @@ SkiaSharpSample.FormsSample.Platform Resources SkiaSharpSampleFormsSampleiOS - true @@ -114,13 +113,11 @@ - - - + diff --git a/samples/MacSample/MacSample/Info.plist b/samples/MacSample/MacSample/Info.plist index b6192634..8369285a 100644 --- a/samples/MacSample/MacSample/Info.plist +++ b/samples/MacSample/MacSample/Info.plist @@ -7,9 +7,9 @@ CFBundleIdentifier com.companyname.skiasharpsample-macsample CFBundleShortVersionString - 1.55.1.0 + 1.60.0.0 CFBundleVersion - 10551010 + 1600000 LSMinimumSystemVersion 10.10 CFBundleDevelopmentRegion diff --git a/samples/MacSample/MacSample/MacSample.csproj b/samples/MacSample/MacSample/MacSample.csproj index 6dfd12d9..73f386d2 100644 --- a/samples/MacSample/MacSample/MacSample.csproj +++ b/samples/MacSample/MacSample/MacSample.csproj @@ -56,7 +56,6 @@ - diff --git a/samples/SkiaSharpSample.Platform.Shared/SamplesInitializer.cs b/samples/SkiaSharpSample.Platform.Shared/SamplesInitializer.cs index 8e9435ff..a1d98c1f 100644 --- a/samples/SkiaSharpSample.Platform.Shared/SamplesInitializer.cs +++ b/samples/SkiaSharpSample.Platform.Shared/SamplesInitializer.cs @@ -95,7 +95,7 @@ namespace SkiaSharpSample var controller = UIDocumentInteractionController.FromUrl(resourceToOpen); if (!controller.PresentOpenInMenu(vc.View.Bounds, vc.View, true)) { - new UIAlertView("SkiaSharp", "Unable to open file.", null, "OK").Show(); + new UIAlertView("SkiaSharp", "Unable to open file.", (IUIAlertViewDelegate)null, "OK").Show(); } #elif __ANDROID__ // the external / shared location diff --git a/samples/SkiaSharpSample.Shared/Samples/SvgSample.cs b/samples/SkiaSharpSample.Shared/Samples/SvgSample.cs deleted file mode 100644 index 870ec211..00000000 --- a/samples/SkiaSharpSample.Shared/Samples/SvgSample.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Threading.Tasks; -using SkiaSharp; -using SKSvg = SkiaSharp.Extended.Svg.SKSvg; - -namespace SkiaSharpSample.Samples -{ - [Preserve(AllMembers = true)] - public class SvgSample : SampleBase - { - private SKSvg svg; - - [Preserve] - public SvgSample() - { - } - - public override string Title => "SVG"; - - public override SampleCategories Category => SampleCategories.BitmapDecoding | SampleCategories.SVG; - - protected override Task OnInit() - { - svg = new SKSvg(); - using (var stream = SampleMedia.Images.LogosSvg) - svg.Load(stream); - - return base.OnInit(); - } - - protected override void OnDrawSample(SKCanvas canvas, int width, int height) - { - canvas.Clear(SKColors.White); - - float canvasMin = Math.Min(width, height); - float svgMax = Math.Max(svg.Picture.CullRect.Width, svg.Picture.CullRect.Height); - float scale = canvasMin / svgMax; - var matrix = SKMatrix.MakeScale(scale, scale); - - canvas.DrawPicture(svg.Picture, ref matrix); - } - } -} diff --git a/samples/SkiaSharpSample.Shared/Samples/SvgTransparencySample.cs b/samples/SkiaSharpSample.Shared/Samples/SvgTransparencySample.cs deleted file mode 100644 index efa778cd..00000000 --- a/samples/SkiaSharpSample.Shared/Samples/SvgTransparencySample.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Threading.Tasks; -using SkiaSharp; -using SKSvg = SkiaSharp.Extended.Svg.SKSvg; - -namespace SkiaSharpSample.Samples -{ - [Preserve(AllMembers = true)] - public class SvgTransparencySample : SampleBase - { - private SKSvg svg; - - [Preserve] - public SvgTransparencySample() - { - } - - public override string Title => "SVG Transparency"; - - public override SampleCategories Category => SampleCategories.BitmapDecoding | SampleCategories.SVG; - - protected override Task OnInit() - { - svg = new SKSvg(); - using (var stream = SampleMedia.Images.OpacitySvg) - svg.Load(stream); - - return base.OnInit(); - } - - protected override void OnDrawSample(SKCanvas canvas, int width, int height) - { - canvas.Clear(SKColors.White); - - float canvasMin = Math.Min(width, height); - float svgMax = Math.Max(svg.Picture.CullRect.Width, svg.Picture.CullRect.Height); - float scale = canvasMin / svgMax; - var matrix = SKMatrix.MakeScale(scale, scale); - - canvas.DrawPicture(svg.Picture, ref matrix); - } - } -} diff --git a/samples/SkiaSharpSample.Shared/SkiaSharpSample.Shared.projitems b/samples/SkiaSharpSample.Shared/SkiaSharpSample.Shared.projitems index 2118111c..296d35c4 100644 --- a/samples/SkiaSharpSample.Shared/SkiaSharpSample.Shared.projitems +++ b/samples/SkiaSharpSample.Shared/SkiaSharpSample.Shared.projitems @@ -26,7 +26,6 @@ - @@ -58,7 +57,6 @@ - @@ -71,9 +69,13 @@ + - + + + + \ No newline at end of file diff --git a/samples/TvSample/TvSample/Info.plist b/samples/TvSample/TvSample/Info.plist index 9fa7c876..8d45bec0 100644 --- a/samples/TvSample/TvSample/Info.plist +++ b/samples/TvSample/TvSample/Info.plist @@ -9,9 +9,9 @@ CFBundleIdentifier com.companyname.skiasharpsample-tvsample CFBundleShortVersionString - 1.0 + 1.60.0.0 CFBundleVersion - 1.0 + 1600000 MinimumOSVersion 9.0 UIDeviceFamily diff --git a/samples/TvSample/TvSample/TvSample.csproj b/samples/TvSample/TvSample/TvSample.csproj index e663fd9e..83148f9f 100644 --- a/samples/TvSample/TvSample/TvSample.csproj +++ b/samples/TvSample/TvSample/TvSample.csproj @@ -89,7 +89,6 @@ - diff --git a/samples/UWPSample/UWPSample/Package.appxmanifest b/samples/UWPSample/UWPSample/Package.appxmanifest index 55803de2..bc6bdcf3 100644 --- a/samples/UWPSample/UWPSample/Package.appxmanifest +++ b/samples/UWPSample/UWPSample/Package.appxmanifest @@ -1,6 +1,6 @@  - + SkiaSharpSample.UWPSample diff --git a/samples/UWPSample/UWPSample/UWPSample.csproj b/samples/UWPSample/UWPSample/UWPSample.csproj index 2d0ca3cb..afb88731 100644 --- a/samples/UWPSample/UWPSample/UWPSample.csproj +++ b/samples/UWPSample/UWPSample/UWPSample.csproj @@ -18,6 +18,7 @@ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} UWPSample_TemporaryKey.pfx 2022055027C3EEA154DFF420144910E67613D8D6 + PackageReference true @@ -89,12 +90,10 @@ true - - + - diff --git a/samples/UWPSample/UWPSample/project.json b/samples/UWPSample/UWPSample/project.json deleted file mode 100644 index edf68de1..00000000 --- a/samples/UWPSample/UWPSample/project.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "dependencies": { - "HarfBuzzSharp": "1.4.6", - "Microsoft.NETCore.UniversalWindowsPlatform": "5.4.0", - "PCLStorage": "1.0.2", - "SkiaSharp": "1.60.0", - "SkiaSharp.HarfBuzz": "1.60.0-beta", - "SkiaSharp.Svg": "1.59.0", - "SkiaSharp.Views": "1.60.0" - }, - "frameworks": { - "uap10.0": {} - }, - "runtimes": { - "win10-arm": {}, - "win10-arm-aot": {}, - "win10-x86": {}, - "win10-x86-aot": {}, - "win10-x64": {}, - "win10-x64-aot": {} - } -} diff --git a/samples/WPFSample/WPFSample/WPFSample.csproj b/samples/WPFSample/WPFSample/WPFSample.csproj index cb108afe..cc0b2502 100644 --- a/samples/WPFSample/WPFSample/WPFSample.csproj +++ b/samples/WPFSample/WPFSample/WPFSample.csproj @@ -97,10 +97,8 @@ - - diff --git a/samples/WatchSample/WatchSample.OnWatch/Info.plist b/samples/WatchSample/WatchSample.OnWatch/Info.plist index 2119bbd4..5f8228c8 100644 --- a/samples/WatchSample/WatchSample.OnWatch/Info.plist +++ b/samples/WatchSample/WatchSample.OnWatch/Info.plist @@ -11,9 +11,9 @@ CFBundleDevelopmentRegion en CFBundleShortVersionString - 1.0 + 1.60.0.0 CFBundleVersion - 1.0 + 1600000 MinimumOSVersion 2.0 UISupportedInterfaceOrientations diff --git a/samples/WatchSample/WatchSample.OnWatchExtension/Info.plist b/samples/WatchSample/WatchSample.OnWatchExtension/Info.plist index b8109e25..3e5d1255 100644 --- a/samples/WatchSample/WatchSample.OnWatchExtension/Info.plist +++ b/samples/WatchSample/WatchSample.OnWatchExtension/Info.plist @@ -11,9 +11,9 @@ CFBundleDevelopmentRegion en CFBundleShortVersionString - 1.0 + 1.60.0.0 CFBundleVersion - 1.0 + 1600000 MinimumOSVersion 2.0 NSExtension diff --git a/samples/WatchSample/WatchSample/Info.plist b/samples/WatchSample/WatchSample/Info.plist index 6d889d72..17d9b2bf 100644 --- a/samples/WatchSample/WatchSample/Info.plist +++ b/samples/WatchSample/WatchSample/Info.plist @@ -7,9 +7,9 @@ CFBundleIdentifier com.companyname.WatchSample CFBundleShortVersionString - 1.0 + 1.60.0.0 CFBundleVersion - 1.0 + 1600000 LSRequiresIPhoneOS MinimumOSVersion diff --git a/samples/WindowsSample/WindowsSample/WindowsSample.csproj b/samples/WindowsSample/WindowsSample/WindowsSample.csproj index f20793f9..f21a19db 100644 --- a/samples/WindowsSample/WindowsSample/WindowsSample.csproj +++ b/samples/WindowsSample/WindowsSample/WindowsSample.csproj @@ -91,10 +91,8 @@ - -