diff --git a/.gitignore b/.gitignore index 7184ff87d09..579107c2eec 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ caketools/ .XamarinFormsVersionFile.txt .idea Visual Studio 2019/** +build/packages diff --git a/.nuspec/Xamarin.Forms.AppLinks.nuspec b/.nuspec/Xamarin.Forms.AppLinks.nuspec index 4a192d4ed1d..d3933ca99eb 100644 --- a/.nuspec/Xamarin.Forms.AppLinks.nuspec +++ b/.nuspec/Xamarin.Forms.AppLinks.nuspec @@ -7,7 +7,7 @@ microsoft xamarin xamarin forms applinks xamarinforms xamarin.forms MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -36,6 +36,8 @@ + + diff --git a/.nuspec/Xamarin.Forms.DualScreen.nuspec b/.nuspec/Xamarin.Forms.DualScreen.nuspec index 24bb81621f6..5883436d1f7 100644 --- a/.nuspec/Xamarin.Forms.DualScreen.nuspec +++ b/.nuspec/Xamarin.Forms.DualScreen.nuspec @@ -7,7 +7,7 @@ microsoft xamarin xamarin forms twopaneview DualScreen xamarinforms xamarinformsdualscreen xamarin.forms.dualscreen MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -26,7 +26,8 @@ - + + diff --git a/.nuspec/Xamarin.Forms.Maps.GTK.nuspec b/.nuspec/Xamarin.Forms.Maps.GTK.nuspec index ac71741e2b1..51b7594d305 100644 --- a/.nuspec/Xamarin.Forms.Maps.GTK.nuspec +++ b/.nuspec/Xamarin.Forms.Maps.GTK.nuspec @@ -7,7 +7,7 @@ microsoft xamarin xamarin forms maps xamarinforms xamarinformsmaps xamarin.forms.maps gtk gtk-sharp linux MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -21,6 +21,8 @@ + + diff --git a/.nuspec/Xamarin.Forms.Maps.WPF.nuspec b/.nuspec/Xamarin.Forms.Maps.WPF.nuspec index ece574b178c..df56e85acdf 100644 --- a/.nuspec/Xamarin.Forms.Maps.WPF.nuspec +++ b/.nuspec/Xamarin.Forms.Maps.WPF.nuspec @@ -7,7 +7,7 @@ microsoft xamarin xamarin forms maps xamarinforms xamarinformsmaps xamarin.forms.maps wpf MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -24,6 +24,8 @@ + + diff --git a/.nuspec/Xamarin.Forms.Maps.nuspec b/.nuspec/Xamarin.Forms.Maps.nuspec index d0768fe5ac1..337fa0a9073 100644 --- a/.nuspec/Xamarin.Forms.Maps.nuspec +++ b/.nuspec/Xamarin.Forms.Maps.nuspec @@ -7,7 +7,7 @@ microsoft xamarin xamarin forms maps xamarinforms xamarinformsmaps xamarin.forms.maps MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -38,6 +38,8 @@ + + diff --git a/.nuspec/Xamarin.Forms.Pages.Azure.nuspec b/.nuspec/Xamarin.Forms.Pages.Azure.nuspec index 3824e0a0a5f..cad7e5debe9 100644 --- a/.nuspec/Xamarin.Forms.Pages.Azure.nuspec +++ b/.nuspec/Xamarin.Forms.Pages.Azure.nuspec @@ -6,7 +6,7 @@ Microsoft microsoft xamarin MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -21,6 +21,8 @@ + + diff --git a/.nuspec/Xamarin.Forms.Pages.nuspec b/.nuspec/Xamarin.Forms.Pages.nuspec index 9f78e54ad7a..ca3809fa830 100644 --- a/.nuspec/Xamarin.Forms.Pages.nuspec +++ b/.nuspec/Xamarin.Forms.Pages.nuspec @@ -6,7 +6,7 @@ Microsoft microsoft xamarin MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -20,6 +20,8 @@ + + diff --git a/.nuspec/Xamarin.Forms.Platform.GTK.nuspec b/.nuspec/Xamarin.Forms.Platform.GTK.nuspec index 1798800c1f7..6d743ff11ec 100644 --- a/.nuspec/Xamarin.Forms.Platform.GTK.nuspec +++ b/.nuspec/Xamarin.Forms.Platform.GTK.nuspec @@ -7,7 +7,7 @@ microsoft xamarin xamarin forms xamarinforms xamarin.forms gtk gtk-sharp linux MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -21,6 +21,8 @@ + + diff --git a/.nuspec/Xamarin.Forms.Platform.WPF.nuspec b/.nuspec/Xamarin.Forms.Platform.WPF.nuspec index 26dbb7a3f2d..d60dbbcd315 100644 --- a/.nuspec/Xamarin.Forms.Platform.WPF.nuspec +++ b/.nuspec/Xamarin.Forms.Platform.WPF.nuspec @@ -7,22 +7,25 @@ microsoft xamarin xamarin forms xamarinforms xamarin.forms wpf MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true Xamarin Forms Renderer to build native UIs for WPF © Microsoft Corporation. All rights reserved. - - - - - + + + - - + + + + + + + diff --git a/.nuspec/Xamarin.Forms.Visual.Material.nuspec b/.nuspec/Xamarin.Forms.Visual.Material.nuspec index 998fb4382e1..5e919ea1185 100644 --- a/.nuspec/Xamarin.Forms.Visual.Material.nuspec +++ b/.nuspec/Xamarin.Forms.Visual.Material.nuspec @@ -7,7 +7,7 @@ microsoft xamarin xamarin forms visual material xamarinforms xamarinformsvisualmaterial xamarin.forms.visual.material MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -38,7 +38,8 @@ - + + diff --git a/.nuspec/Xamarin.Forms.nuspec b/.nuspec/Xamarin.Forms.nuspec index 496b444d9ee..2f0209071af 100644 --- a/.nuspec/Xamarin.Forms.nuspec +++ b/.nuspec/Xamarin.Forms.nuspec @@ -7,7 +7,7 @@ microsoft xamarin xamarin forms xamarinforms xamarin.forms MIT - https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/Assets/xamarin_128x128.png + Assets\xamarin_128x128.png http://xamarin.com/forms true @@ -37,7 +37,7 @@ - + @@ -100,7 +100,8 @@ - + + diff --git a/.nuspec/Xamarin.Forms.targets b/.nuspec/Xamarin.Forms.targets index 2a3e666293e..cd9f89fce33 100644 --- a/.nuspec/Xamarin.Forms.targets +++ b/.nuspec/Xamarin.Forms.targets @@ -84,7 +84,8 @@ Inputs="@(_XamlGInputs)" Outputs="@(_XamlGOutputs)"> - @(ReferencePath) + @(ReferencePath) + $(_ReferencedAssemblies) + diff --git a/Directory.Build.props b/Directory.Build.props index 2064154c2ec..bd083c26d47 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/DualScreen/DualScreen/TwoPanePropertiesGallery.xaml.cs b/DualScreen/DualScreen/TwoPanePropertiesGallery.xaml.cs index 2f358067415..67f61fe1c09 100644 --- a/DualScreen/DualScreen/TwoPanePropertiesGallery.xaml.cs +++ b/DualScreen/DualScreen/TwoPanePropertiesGallery.xaml.cs @@ -38,18 +38,18 @@ protected override void OnAppearing() TallModeConfiguration.SelectedIndex = 1; WideModeConfiguration.SelectedIndex = 1; - //DualScreenInfo.Current.HingeAngleChanged += OnHingeAngleChanged; + DualScreenInfo.Current.HingeAngleChanged += OnHingeAngleChanged; } protected override void OnDisappearing() { - //DualScreenInfo.Current.HingeAngleChanged -= OnHingeAngleChanged; + DualScreenInfo.Current.HingeAngleChanged -= OnHingeAngleChanged; } - //void OnHingeAngleChanged(object sender, DualScreen.HingeAngleChangedEventArgs e) - //{ - // lblHingeAngle.Text = e.HingeAngleInDegrees.ToString(); - //} + void OnHingeAngleChanged(object sender, HingeAngleChangedEventArgs e) + { + lblHingeAngle.Text = e.HingeAngleInDegrees.ToString(); + } void Setup(double width, double height) { @@ -72,4 +72,4 @@ void OnReset(object sender, EventArgs e) Pane2Length.Value = 0.5; } } -} \ No newline at end of file +} diff --git a/Environment.Build.props b/Environment.Build.props index a39567fd2e6..ff76b375092 100644 --- a/Environment.Build.props +++ b/Environment.Build.props @@ -4,7 +4,8 @@ - + + false true @@ -45,4 +46,4 @@ True True - \ No newline at end of file + diff --git a/GitInfo.txt b/GitInfo.txt index 6016e8addc4..f6cdf40983f 100644 --- a/GitInfo.txt +++ b/GitInfo.txt @@ -1 +1 @@ -4.6.0 +4.7.0 diff --git a/Nuget.targets b/Nuget.targets new file mode 100644 index 00000000000..518a38de3f0 --- /dev/null +++ b/Nuget.targets @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/Nuget/.gitignore b/Nuget/.gitignore new file mode 100644 index 00000000000..86d0cb2726c --- /dev/null +++ b/Nuget/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/PagesGallery/PagesGallery.Droid/PagesGallery.Droid.csproj b/PagesGallery/PagesGallery.Droid/PagesGallery.Droid.csproj index 05da9049ef8..011e8fe85fa 100644 --- a/PagesGallery/PagesGallery.Droid/PagesGallery.Droid.csproj +++ b/PagesGallery/PagesGallery.Droid/PagesGallery.Droid.csproj @@ -114,12 +114,8 @@ Xamarin.Forms.Xaml + {343ebf1b-f26d-4d4d-b7d9-f6e25247af31} PagesGallery - {7B5F9E6A-6334-4C74-9B77-A55B3DA60E41} - - - {e1586ce6-8eac-4388-a15a-1aabf108b5f8} - Xamarin.Forms.Material.Android @@ -286,4 +282,4 @@ - + \ No newline at end of file diff --git a/PagesGallery/PagesGallery.UWP/PagesGallery.UWP.csproj b/PagesGallery/PagesGallery.UWP/PagesGallery.UWP.csproj index 278c7f29691..95289841899 100644 --- a/PagesGallery/PagesGallery.UWP/PagesGallery.UWP.csproj +++ b/PagesGallery/PagesGallery.UWP/PagesGallery.UWP.csproj @@ -157,11 +157,11 @@ 6.0.15 - 2.3.191211002 + 2.4.2 14.0 - + \ No newline at end of file diff --git a/README.md b/README.md index dc87f7628ad..1a783ca6b28 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ You should now be able to run any of the UWP UI Tests. ## Coding Style ## -We follow the style used by the [.NET Foundation](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md), with a few exceptions: +We follow the style used by the [.NET Foundation](https://github.com/dotnet/runtime/blob/master/docs/coding-guidelines/coding-style.md), with a few exceptions: - We do not use the `private` keyword as it is the default accessibility level in C#. - We use hard tabs over spaces. You can change this setting in Visual Studio for Windows via `Tools > Options` and navigating to `Text Editor > C#` and selecting the "Keep tabs" radio option. In Visual Studio for Mac it's set via preferences in `Source Code > Code Formatting > C# source code` and disabling the checkbox for `Convert tabs to spaces`. diff --git a/Stubs/Xamarin.Forms.Platform.cs b/Stubs/Xamarin.Forms.Platform.cs index 3e8331b88c5..1dd7032c1ec 100644 --- a/Stubs/Xamarin.Forms.Platform.cs +++ b/Stubs/Xamarin.Forms.Platform.cs @@ -174,6 +174,26 @@ internal class _RefreshViewRenderer { } [RenderWith(typeof(SwipeViewRenderer))] internal class _SwipeViewRenderer { } + +#if !TIZEN4_0 + [RenderWith(typeof(PathRenderer))] + internal class _PathRenderer { } + + [RenderWith(typeof(EllipseRenderer))] + internal class _EllipseRenderer { } + + [RenderWith(typeof(LineRenderer))] + internal class _LineRenderer { } + + [RenderWith(typeof(PolylineRenderer))] + internal class _PolylineRenderer { } + + [RenderWith(typeof(PolygonRenderer))] + internal class _PolygonRenderer { } + + [RenderWith(typeof(RectangleRenderer))] + internal class _RectangleRenderer { } +#endif } diff --git a/UWP.Build.props b/UWP.Build.props index f7762a17cb0..a96966cf411 100644 --- a/UWP.Build.props +++ b/UWP.Build.props @@ -1,11 +1,27 @@ - - uap10.0.14393;uap10.0.16299; + + $(UwpMinTargetFrameworks) + + + uap10.0.14393;uap10.0.16299 + netstandard2.0 + + 10.0.16299.0 10.0.18362.0 + 10.0.19559.0 - + + $(DefineConstants);UWP + + $(DefineConstants);UWP_14393 + + $(DefineConstants);UWP_18362 + + + $(DefineConstants);UWP_18362;UWP_19000 + diff --git a/UWP.Build.targets b/UWP.Build.targets index 8fd6159a13c..614d6a57b86 100644 --- a/UWP.Build.targets +++ b/UWP.Build.targets @@ -2,11 +2,16 @@ - + Windows Mobile Extensions for the UWP + + + Windows Mobile Extensions for the UWP + + diff --git a/Xamarin.Forms.Build.Tasks/CssGenerator.cs b/Xamarin.Forms.Build.Tasks/CssGenerator.cs index 276e352aa04..16db7e4c746 100644 --- a/Xamarin.Forms.Build.Tasks/CssGenerator.cs +++ b/Xamarin.Forms.Build.Tasks/CssGenerator.cs @@ -1,12 +1,11 @@ using System.CodeDom; using System.CodeDom.Compiler; using System.IO; - using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using Microsoft.CSharp; - using Xamarin.Forms.Xaml; +using IOPath = System.IO.Path; namespace Xamarin.Forms.Build.Tasks { @@ -79,7 +78,7 @@ public bool Execute() void GenerateCode() { //Create the target directory if required - Directory.CreateDirectory(Path.GetDirectoryName(OutputFile)); + Directory.CreateDirectory(IOPath.GetDirectoryName(OutputFile)); var ccu = new CodeCompileUnit(); ccu.AssemblyCustomAttributes.Add( diff --git a/Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs b/Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs index 25be35bbdd4..cd83090e020 100644 --- a/Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs +++ b/Xamarin.Forms.Build.Tasks/DebugXamlCTask.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; - using Mono.Cecil; using Mono.Cecil.Cil; using Mono.Cecil.Rocks; - using static Microsoft.Build.Framework.MessageImportance; +using IOPath = System.IO.Path; namespace Xamarin.Forms.Build.Tasks { @@ -28,7 +26,7 @@ public override bool Execute(out IList thrownExceptions) if (!string.IsNullOrEmpty(ReferencePath)) { var paths = ReferencePath.Replace("//", "/").Split(';'); foreach (var p in paths) { - var searchpath = Path.GetDirectoryName(p); + var searchpath = IOPath.GetDirectoryName(p); LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Adding searchpath {searchpath}"); resolver.AddSearchDirectory(searchpath); } diff --git a/Xamarin.Forms.Build.Tasks/XamlCTask.cs b/Xamarin.Forms.Build.Tasks/XamlCTask.cs index 465b877c16a..1d8a7d3f601 100644 --- a/Xamarin.Forms.Build.Tasks/XamlCTask.cs +++ b/Xamarin.Forms.Build.Tasks/XamlCTask.cs @@ -5,14 +5,12 @@ using System.Linq; using System.Xml; using Microsoft.Build.Framework; - using Mono.Cecil; using Mono.Cecil.Cil; - using Xamarin.Forms.Xaml; - using static Microsoft.Build.Framework.MessageImportance; using static Mono.Cecil.Cil.OpCodes; +using IOPath = System.IO.Path; namespace Xamarin.Forms.Build.Tasks { @@ -65,7 +63,7 @@ public override bool Execute(out IList thrownExceptions) if (!string.IsNullOrEmpty(ReferencePath)) { var paths = ReferencePath.Replace("//", "/").Split(';').Distinct(); foreach (var p in paths) { - var searchpath = Path.GetDirectoryName(p); + var searchpath = IOPath.GetDirectoryName(p); LoggingHelper.LogMessage(Low, $"{new string(' ', 2)}Adding searchpath {searchpath}"); xamlCResolver.AddSearchDirectory(searchpath); } @@ -82,7 +80,7 @@ public override bool Execute(out IList thrownExceptions) ReadSymbols = debug && !ValidateOnly, // We don't need symbols for ValidateOnly, since we won't be writing }; - using (var assemblyDefinition = AssemblyDefinition.ReadAssembly(Path.GetFullPath(Assembly),readerParameters)) { + using (var assemblyDefinition = AssemblyDefinition.ReadAssembly(IOPath.GetFullPath(Assembly),readerParameters)) { CustomAttribute xamlcAttr; if (assemblyDefinition.HasCustomAttributes && (xamlcAttr = diff --git a/Xamarin.Forms.Build.Tasks/XamlGTask.cs b/Xamarin.Forms.Build.Tasks/XamlGTask.cs index 2cbbf9ed6a8..4a8f6311d19 100644 --- a/Xamarin.Forms.Build.Tasks/XamlGTask.cs +++ b/Xamarin.Forms.Build.Tasks/XamlGTask.cs @@ -1,9 +1,9 @@ using System; using System.IO; using System.Xml; - using Microsoft.Build.Framework; using Microsoft.Build.Utilities; +using IOPath = System.IO.Path; namespace Xamarin.Forms.Build.Tasks { @@ -38,9 +38,9 @@ public override bool Execute() for (int i = 0; i < XamlFiles.Length; i++) { var xamlFile = XamlFiles[i]; var outputFile = OutputFiles[i].ItemSpec; - if (Path.DirectorySeparatorChar == '/' && outputFile.Contains(@"\")) + if (IOPath.DirectorySeparatorChar == '/' && outputFile.Contains(@"\")) outputFile = outputFile.Replace('\\','/'); - else if (Path.DirectorySeparatorChar == '\\' && outputFile.Contains(@"/")) + else if (IOPath.DirectorySeparatorChar == '\\' && outputFile.Contains(@"/")) outputFile = outputFile.Replace('/', '\\'); var generator = new XamlGenerator(xamlFile, Language, AssemblyName, outputFile, References, Log); @@ -52,10 +52,12 @@ public override bool Execute() } catch (XmlException xe) { Log.LogError(null, null, null, xamlFile.ItemSpec, xe.LineNumber, xe.LinePosition, 0, 0, xe.Message, xe.HelpLink, xe.Source); + Log.LogMessage(MessageImportance.Low, xe.StackTrace); success = false; } catch (Exception e) { Log.LogError(null, null, null, xamlFile.ItemSpec, 0, 0, 0, 0, e.Message, e.HelpLink, e.Source); + Log.LogMessage(MessageImportance.Low, e.StackTrace); success = false; } } diff --git a/Xamarin.Forms.Build.Tasks/XamlGenerator.cs b/Xamarin.Forms.Build.Tasks/XamlGenerator.cs index 9d4f87e0bc8..049abbff7f7 100644 --- a/Xamarin.Forms.Build.Tasks/XamlGenerator.cs +++ b/Xamarin.Forms.Build.Tasks/XamlGenerator.cs @@ -11,6 +11,7 @@ using Xamarin.Forms.Xaml; using Xamarin.Forms.Internals; using Mono.Cecil; +using IOPath = System.IO.Path; namespace Xamarin.Forms.Build.Tasks { @@ -173,7 +174,7 @@ internal bool ParseXaml(TextReader xaml) void GenerateCode() { //Create the target directory if required - Directory.CreateDirectory(Path.GetDirectoryName(OutputFile)); + Directory.CreateDirectory(IOPath.GetDirectoryName(OutputFile)); var ccu = new CodeCompileUnit(); ccu.AssemblyCustomAttributes.Add( @@ -351,8 +352,6 @@ CodeTypeReference GetType(XmlType xmlType, static string GetClrNamespace(string namespaceuri) { - if (namespaceuri == XamlParser.XFUri) - return "Xamarin.Forms"; if (namespaceuri == XamlParser.X2009Uri) return "System"; if (namespaceuri != XamlParser.X2006Uri && @@ -390,7 +389,7 @@ void GatherXmlnsDefinitionAttributes() string[] paths = References.Split(';').Distinct().ToArray(); foreach (var path in paths) { - string asmName = Path.GetFileName(path); + string asmName = IOPath.GetFileName(path); if (AssemblyIsSystem(asmName)) // Skip the myriad "System." assemblies and others continue; @@ -408,6 +407,8 @@ void GatherXmlnsDefinitionAttributes() bool AssemblyIsSystem(string name) { + if (name.StartsWith("System.Maui", StringComparison.CurrentCultureIgnoreCase)) + return false; if (name.StartsWith("System.", StringComparison.CurrentCultureIgnoreCase)) return true; else if (name.Equals("mscorlib.dll", StringComparison.CurrentCultureIgnoreCase)) @@ -430,7 +431,7 @@ CodeTypeReference GetCustomNamespaceUrlType(XmlType xmlType) (typeInfo) => { ModuleDefinition module = null; - if (!_xmlnsModules.TryGetValue(typeInfo.AssemblyName, out module)) + if (typeInfo.AssemblyName == null || !_xmlnsModules.TryGetValue(typeInfo.AssemblyName, out module)) return null; string typeName = typeInfo.TypeName.Replace('+', '/'); //Nested types string fullName = $"{typeInfo.ClrNamespace}.{typeInfo.TypeName}"; diff --git a/Xamarin.Forms.ControlGallery.Android/Android10.Build.targets b/Xamarin.Forms.ControlGallery.Android/Android10.Build.targets index 64e2aef9027..9406850d2ac 100644 --- a/Xamarin.Forms.ControlGallery.Android/Android10.Build.targets +++ b/Xamarin.Forms.ControlGallery.Android/Android10.Build.targets @@ -9,4 +9,4 @@ - \ No newline at end of file + diff --git a/Xamarin.Forms.ControlGallery.Android/CacheService.cs b/Xamarin.Forms.ControlGallery.Android/CacheService.cs index 1f371656d25..fb86a8fa9d1 100644 --- a/Xamarin.Forms.ControlGallery.Android/CacheService.cs +++ b/Xamarin.Forms.ControlGallery.Android/CacheService.cs @@ -1,6 +1,6 @@ -using System.IO; using System.IO.IsolatedStorage; using Xamarin.Forms.Controls; +using IOPath = System.IO.Path; namespace Xamarin.Forms.ControlGallery.Android { @@ -15,9 +15,9 @@ static void DeleteFilesInDirectory (string directory) { using (IsolatedStorageFile isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication ()) { if (isolatedStorage.DirectoryExists (directory)) { - var files = isolatedStorage.GetFileNames (Path.Combine (directory, "*")); + var files = isolatedStorage.GetFileNames (IOPath.Combine (directory, "*")); foreach (string file in files) { - isolatedStorage.DeleteFile (Path.Combine (directory, file)); + isolatedStorage.DeleteFile (IOPath.Combine (directory, file)); } } } diff --git a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs index 7282a91a105..049db3a33fd 100644 --- a/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs +++ b/Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs @@ -30,9 +30,9 @@ using FragmentTransaction = Android.Support.V4.App.FragmentTransaction; using NestedScrollView = global::Android.Support.V4.Widget.NestedScrollView; #endif -using System.IO; using AMenuItemCompat = global::Android.Support.V4.View.MenuItemCompat; using Android.Support.V4.Content; +using IOPath = System.IO.Path; [assembly: ExportRenderer(typeof(Issue5461.ScrollbarFadingEnabledFalseScrollView), typeof(ScrollbarFadingEnabledFalseScrollViewRenderer))] [assembly: ExportRenderer(typeof(Issue1942.CustomGrid), typeof(Issue1942GridRenderer))] @@ -104,7 +104,7 @@ protected override void UpdateMenuItemIcon(Context context, IMenuItem menuItem, if (toolBarItem.IconImageSource is FileImageSource fileImageSource) { - var name = Path.GetFileNameWithoutExtension(fileImageSource.File); + var name = IOPath.GetFileNameWithoutExtension(fileImageSource.File); var id = Xamarin.Forms.Platform.Android.ResourceManager.GetDrawableByName(name); if (id != 0) { diff --git a/Xamarin.Forms.ControlGallery.Android/Directory.Build.targets b/Xamarin.Forms.ControlGallery.Android/Directory.Build.targets index fe3b8e64991..680415c9bd3 100644 --- a/Xamarin.Forms.ControlGallery.Android/Directory.Build.targets +++ b/Xamarin.Forms.ControlGallery.Android/Directory.Build.targets @@ -1,3 +1,6 @@ - \ No newline at end of file + + + + diff --git a/Xamarin.Forms.ControlGallery.Android/Nuget2017.Build.targets b/Xamarin.Forms.ControlGallery.Android/Nuget2017.Build.targets new file mode 100644 index 00000000000..d5c7b72cec8 --- /dev/null +++ b/Xamarin.Forms.ControlGallery.Android/Nuget2017.Build.targets @@ -0,0 +1,7 @@ + + + + 0.4.11 + + + \ No newline at end of file diff --git a/Xamarin.Forms.ControlGallery.Android/Nuget2019.Build.targets b/Xamarin.Forms.ControlGallery.Android/Nuget2019.Build.targets new file mode 100644 index 00000000000..aea0f99001a --- /dev/null +++ b/Xamarin.Forms.ControlGallery.Android/Nuget2019.Build.targets @@ -0,0 +1,17 @@ + + + + 0.10.0 + + + + + 1.0.0 + + + + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.ControlGallery.Android/PlatformSpecificCoreGalleryFactory.cs b/Xamarin.Forms.ControlGallery.Android/PlatformSpecificCoreGalleryFactory.cs index bb739bd7c01..d5a5df24af5 100644 --- a/Xamarin.Forms.ControlGallery.Android/PlatformSpecificCoreGalleryFactory.cs +++ b/Xamarin.Forms.ControlGallery.Android/PlatformSpecificCoreGalleryFactory.cs @@ -3,11 +3,13 @@ using Xamarin.Forms; using Xamarin.Forms.ControlGallery.Android; using Xamarin.Forms.Controls; +using Xamarin.Forms.Internals; [assembly: Dependency(typeof(PlatformSpecificCoreGalleryFactory))] namespace Xamarin.Forms.ControlGallery.Android { + [Preserve(AllMembers = true)] public class PlatformSpecificCoreGalleryFactory : IPlatformSpecificCoreGalleryFactory { public string Title => "Android Core Gallery"; diff --git a/Xamarin.Forms.ControlGallery.Android/StaggeredCollectionViewRenderer.cs b/Xamarin.Forms.ControlGallery.Android/StaggeredCollectionViewRenderer.cs index 2b27c4f3a41..58d193450f8 100644 --- a/Xamarin.Forms.ControlGallery.Android/StaggeredCollectionViewRenderer.cs +++ b/Xamarin.Forms.ControlGallery.Android/StaggeredCollectionViewRenderer.cs @@ -1,6 +1,5 @@ using System; using Android.Content; -using Android.Graphics; #if __ANDROID_29__ using AndroidX.AppCompat.Widget; using AndroidX.RecyclerView.Widget; @@ -11,6 +10,7 @@ using Xamarin.Forms.ControlGallery.Android; using Xamarin.Forms.Controls.GalleryPages.CollectionViewGalleries.AlternateLayoutGalleries; using Xamarin.Forms.Platform.Android; +using ARect = Android.Graphics.Rect; using AView = Android.Views.View; [assembly: ExportRenderer(typeof(StaggeredCollectionView), typeof(StaggeredCollectionViewRenderer))] @@ -70,7 +70,7 @@ public SpacingItemDecoration(StaggeredGridItemsLayout itemsLayout) } } - public override void GetItemOffsets(Rect outRect, AView view, RecyclerView parent, RecyclerView.State state) + public override void GetItemOffsets(ARect outRect, AView view, RecyclerView parent, RecyclerView.State state) { base.GetItemOffsets(outRect, view, parent, state); diff --git a/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj b/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj index 238627685fd..7d7cafc2403 100644 --- a/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj +++ b/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj @@ -132,6 +132,7 @@ + @@ -178,11 +179,7 @@ - - - {6e53feb1-1100-46ae-8013-17bba35cc197} - Xamarin.Forms.Platform.Android (Forwarders) - + {cb9c96ce-125c-4a68-b6a1-c3ff1fbf93e1} Xamarin.Forms.Controls @@ -191,6 +188,19 @@ {4dcd0420-1168-4b77-86db-6196ee4bd491} Xamarin.Forms.CustomAttributes + + {a4c57790-71d1-467c-a69e-2bd84cb6666c} + Xamarin.Forms.Platform.Android.UnitTests + + + + + proguard.cfg + + + {6e53feb1-1100-46ae-8013-17bba35cc197} + Xamarin.Forms.Platform.Android (Forwarders) + {bd50b39a-ebc5-408f-9c5e-923a8ebae473} Xamarin.Forms.Maps.Android @@ -207,10 +217,6 @@ {3b72465b-acae-43ae-9327-10f372fe5f80} Xamarin.Forms.Platform.Android.FormsViewGroup - - {a4c57790-71d1-467c-a69e-2bd84cb6666c} - Xamarin.Forms.Platform.Android.UnitTests - {0e16e70a-d6dd-4323-ad5d-363abff42d6a} Xamarin.Forms.Platform.Android @@ -342,9 +348,6 @@ 3.0.2 - - 0.7.1 - @@ -378,11 +381,6 @@ - - - proguard.cfg - - @@ -412,4 +410,4 @@ - \ No newline at end of file + diff --git a/Xamarin.Forms.ControlGallery.Android/_10940CustomRenderer.cs b/Xamarin.Forms.ControlGallery.Android/_10940CustomRenderer.cs new file mode 100644 index 00000000000..ae1cffc753a --- /dev/null +++ b/Xamarin.Forms.ControlGallery.Android/_10940CustomRenderer.cs @@ -0,0 +1,27 @@ +using Android.Content; +using Xamarin.Forms; +using Xamarin.Forms.ControlGallery.Android; +using Xamarin.Forms.Controls.Issues; +using Xamarin.Forms.Platform.Android; + +[assembly: ExportRenderer(typeof(CustomEntry), typeof(CustomEntryRenderer))] +[assembly: ExportRenderer(typeof(CustomSwipeView), typeof(CustomSwipeViewRenderer))] +namespace Xamarin.Forms.ControlGallery.Android +{ + public class CustomEntryRenderer : EntryRenderer + { + public CustomEntryRenderer(Context context) : base(context) + { + System.Diagnostics.Debug.WriteLine("Create CustomEntry"); + } + } + + public class CustomSwipeViewRenderer : SwipeViewRenderer + { + + public CustomSwipeViewRenderer(Context context) : base(context) + { + + } + } +} \ No newline at end of file diff --git a/Xamarin.Forms.ControlGallery.MacOS/NativeServices.cs b/Xamarin.Forms.ControlGallery.MacOS/NativeServices.cs index df0b19c03ca..27f0378b3b3 100644 --- a/Xamarin.Forms.ControlGallery.MacOS/NativeServices.cs +++ b/Xamarin.Forms.ControlGallery.MacOS/NativeServices.cs @@ -1,12 +1,15 @@ using System; using System.IO; +using AppKit; using Xamarin.Forms; using Xamarin.Forms.ControlGallery.MacOS; using Xamarin.Forms.Controls; using Xamarin.Forms.Platform.MacOS; +using IOPath = System.IO.Path; [assembly: Dependency(typeof(TestCloudService))] [assembly: Dependency(typeof(CacheService))] +[assembly: Dependency(typeof(NativeColorService))] [assembly: ExportRenderer(typeof(DisposePage), typeof(DisposePageRenderer))] [assembly: ExportRenderer(typeof(DisposeLabel), typeof(DisposeLabelRenderer))] @@ -17,7 +20,7 @@ public class CacheService : ICacheService public void ClearImageCache() { var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - var cache = Path.Combine(documents, ".config", ".isolated-storage", "ImageLoaderCache"); + var cache = IOPath.Combine(documents, ".config", ".isolated-storage", "ImageLoaderCache"); foreach (var file in Directory.GetFiles(cache)) { File.Delete(file); @@ -25,6 +28,17 @@ public void ClearImageCache() } } + public class NativeColorService : INativeColorService + { + public Color GetConvertedColor(bool shouldCrash) + { + if (shouldCrash) + return NSColor.ControlText.ToColor(); + + return NSColor.ControlText.ToColor(NSColorSpace.DeviceRGBColorSpace); + } + } + public class DisposePageRenderer : PageRenderer { protected override void Dispose(bool disposing) diff --git a/Xamarin.Forms.ControlGallery.Tizen/ControlGallery.Tizen.cs b/Xamarin.Forms.ControlGallery.Tizen/ControlGallery.Tizen.cs index c737c052a71..9ef12bd05ac 100644 --- a/Xamarin.Forms.ControlGallery.Tizen/ControlGallery.Tizen.cs +++ b/Xamarin.Forms.ControlGallery.Tizen/ControlGallery.Tizen.cs @@ -22,7 +22,7 @@ static void Main(string[] args) { var app = new MainApplication(); FormsMaps.Init("HERE", "write-your-API-key-here"); - Forms.SetFlags("CollectionView_Experimental", "Shell_Experimental", "MediaElement_Experimental", "IndicatorView_Experimental"); + Forms.SetFlags("CollectionView_Experimental", "Shell_Experimental", "MediaElement_Experimental"); Forms.Init(app); FormsMaterial.Init(); app.Run(args); diff --git a/Xamarin.Forms.ControlGallery.WPF/Renderers/Issue6693ControlRenderer.cs b/Xamarin.Forms.ControlGallery.WPF/Renderers/Issue6693ControlRenderer.cs index 124f14cba1b..c5b03607035 100644 --- a/Xamarin.Forms.ControlGallery.WPF/Renderers/Issue6693ControlRenderer.cs +++ b/Xamarin.Forms.ControlGallery.WPF/Renderers/Issue6693ControlRenderer.cs @@ -1,17 +1,11 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; +using System.Windows; using System.Windows.Media; using Xamarin.Forms.ControlGallery.WPF.Renderers; using Xamarin.Forms.Controls.Issues; using Xamarin.Forms.Platform.WPF; -using WColor = System.Windows.Media.Color; +using WRect = System.Windows.Rect; -[assembly:ExportRenderer(typeof(Issue6693Control), typeof(Issue6693ControlRenderer))] +[assembly: ExportRenderer(typeof(Issue6693Control), typeof(Issue6693ControlRenderer))] namespace Xamarin.Forms.ControlGallery.WPF.Renderers { public class Issue6693ControlRenderer:ViewRenderer @@ -35,7 +29,7 @@ public WIssue6693Control() protected override void OnRender(DrawingContext drawingContext) { - drawingContext.DrawRectangle(Brushes.LightGray, new Pen(Brushes.Black, 1), new Rect(0,0,ActualWidth, ActualHeight)); + drawingContext.DrawRectangle(Brushes.LightGray, new Pen(Brushes.Black, 1), new WRect(0,0,ActualWidth, ActualHeight)); var isEnabledText = IsEnabled ? "I'm enabled :)" : "I'm disabled :("; drawingContext.DrawText(new FormattedText(isEnabledText, System.Globalization.CultureInfo.CurrentCulture, diff --git a/Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj b/Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj index f7538980f57..ed555198aed 100644 --- a/Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj +++ b/Xamarin.Forms.ControlGallery.WPF/Xamarin.Forms.ControlGallery.WPF.csproj @@ -142,5 +142,8 @@ + + + \ No newline at end of file diff --git a/Xamarin.Forms.ControlGallery.WPF/crimson.jpg b/Xamarin.Forms.ControlGallery.WPF/crimson.jpg new file mode 100644 index 00000000000..e0be19c886f Binary files /dev/null and b/Xamarin.Forms.ControlGallery.WPF/crimson.jpg differ diff --git a/Xamarin.Forms.ControlGallery.WindowsUniversal/BrokenNativeControl.cs b/Xamarin.Forms.ControlGallery.WindowsUniversal/BrokenNativeControl.cs index 6d98aefc2b1..b66d86bad62 100644 --- a/Xamarin.Forms.ControlGallery.WindowsUniversal/BrokenNativeControl.cs +++ b/Xamarin.Forms.ControlGallery.WindowsUniversal/BrokenNativeControl.cs @@ -1,10 +1,10 @@ -using Windows.Foundation; using Windows.Graphics.Display; using Windows.UI; using Windows.UI.ViewManagement; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; +using WRect = Windows.Foundation.Rect; namespace Xamarin.Forms.ControlGallery.WindowsUniversal { @@ -47,7 +47,7 @@ public string Text protected override Windows.Foundation.Size ArrangeOverride(Windows.Foundation.Size finalSize) { - _textBlock.Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height)); + _textBlock.Arrange(new WRect(0, 0, finalSize.Width, finalSize.Height)); return finalSize; } @@ -57,7 +57,7 @@ protected override Windows.Foundation.Size MeasureOverride (Windows.Foundation. _textBlock.Measure (availableSize); // This deliberately does something wrong so we can demo fixing it - Rect bounds = ApplicationView.GetForCurrentView ().VisibleBounds; + WRect bounds = ApplicationView.GetForCurrentView ().VisibleBounds; double scaleFactor = DisplayInformation.GetForCurrentView ().RawPixelsPerViewPixel; var size = new Size (bounds.Width * scaleFactor, bounds.Height * scaleFactor); diff --git a/Xamarin.Forms.ControlGallery.WindowsUniversal/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.WindowsUniversal/CustomRenderers.cs index 0cc317d10b8..152a42d27ff 100644 --- a/Xamarin.Forms.ControlGallery.WindowsUniversal/CustomRenderers.cs +++ b/Xamarin.Forms.ControlGallery.WindowsUniversal/CustomRenderers.cs @@ -5,10 +5,11 @@ using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Shapes; using Xamarin.Forms.ControlGallery.WindowsUniversal; using Xamarin.Forms.Controls.Issues; using Xamarin.Forms.Platform.UWP; +using WEllipse = Windows.UI.Xaml.Shapes.Ellipse; +using WShape = Windows.UI.Xaml.Shapes.Shape; [assembly: ExportRenderer(typeof(Xamarin.Forms.Controls.Issues.Bugzilla42602.TextBoxView), typeof(Xamarin.Forms.ControlGallery.WindowsUniversal.TextBoxViewRenderer))] [assembly: ExportRenderer(typeof(Issue1683.EntryKeyboardFlags), typeof(EntryRendererKeyboardFlags))] @@ -143,7 +144,7 @@ protected override void OnElementChanged(ElementChangedEventArgs e) Children.Add(m_Canvas); //ellipse - Shape ellipse = new Ellipse() + WShape ellipse = new WEllipse() { Width = 100, Height = 100, diff --git a/Xamarin.Forms.ControlGallery.WindowsUniversal/Directory.Build.targets b/Xamarin.Forms.ControlGallery.WindowsUniversal/Directory.Build.targets new file mode 100644 index 00000000000..6f72129c885 --- /dev/null +++ b/Xamarin.Forms.ControlGallery.WindowsUniversal/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/Xamarin.Forms.ControlGallery.WindowsUniversal/MainPage.xaml.cs b/Xamarin.Forms.ControlGallery.WindowsUniversal/MainPage.xaml.cs index 63c56eb4f20..d095e91118e 100644 --- a/Xamarin.Forms.ControlGallery.WindowsUniversal/MainPage.xaml.cs +++ b/Xamarin.Forms.ControlGallery.WindowsUniversal/MainPage.xaml.cs @@ -9,13 +9,12 @@ using Windows.UI.ViewManagement; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Xamarin.Forms; -using Xamarin.Forms.ControlGallery.WindowsUniversal; using Xamarin.Forms.Controls; using Xamarin.Forms.Platform.UWP; - +using WRectangleGeometry = Windows.UI.Xaml.Media.RectangleGeometry; +using WRect = Windows.Foundation.Rect; namespace Xamarin.Forms.ControlGallery.WindowsUniversal { @@ -119,17 +118,17 @@ void AddNativeControls(NestedNativeControlGalleryPage page) // The broken control always tries to size itself to the screen width // So figure that out and we'll know how far off it's laying itself out - Rect bounds = ApplicationView.GetForCurrentView().VisibleBounds; + WRect bounds = ApplicationView.GetForCurrentView().VisibleBounds; double scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; var screenWidth = new Size(bounds.Width * scaleFactor, bounds.Height * scaleFactor); // We can re-center it by offsetting it during the Arrange call double diff = Math.Abs(screenWidth.Width - finalSize.Width) / -2; - frameworkElement.Arrange(new Rect(diff, 0, finalSize.Width - diff, finalSize.Height)); + frameworkElement.Arrange(new WRect(diff, 0, finalSize.Width - diff, finalSize.Height)); // Arranging the control to the left will make it show up past the edge of the stack layout // We can fix that by clipping it manually - var clip = new RectangleGeometry { Rect = new Rect(-diff, 0, finalSize.Width, finalSize.Height) }; + var clip = new RectangleGeometry { Rect = new WRect(-diff, 0, finalSize.Width, finalSize.Height) }; frameworkElement.Clip = clip; return finalSize; diff --git a/Xamarin.Forms.ControlGallery.WindowsUniversal/Xamarin.Forms.ControlGallery.WindowsUniversal.csproj b/Xamarin.Forms.ControlGallery.WindowsUniversal/Xamarin.Forms.ControlGallery.WindowsUniversal.csproj index 69f63d2da39..b95d75edd95 100644 --- a/Xamarin.Forms.ControlGallery.WindowsUniversal/Xamarin.Forms.ControlGallery.WindowsUniversal.csproj +++ b/Xamarin.Forms.ControlGallery.WindowsUniversal/Xamarin.Forms.ControlGallery.WindowsUniversal.csproj @@ -101,6 +101,18 @@ {cb9c96ce-125c-4a68-b6a1-c3ff1fbf93e1} Xamarin.Forms.Controls + + {8f245976-f555-4814-b935-9ad58f4d2871} + Xamarin.Forms.Platform.UAP.UnitTests + + + + + {4dcd0420-1168-4b77-86db-6196ee4bd491} + Xamarin.Forms.CustomAttributes + + + {57b8b73d-c3b5-4c42-869e-7b2f17d354ac} Xamarin.Forms.Core @@ -113,10 +125,6 @@ {7d13bac2-c6a4-416a-b07e-c169b199e52b} Xamarin.Forms.Maps - - {8f245976-f555-4814-b935-9ad58f4d2871} - Xamarin.Forms.Platform.UAP.UnitTests - {00d8d049-ffaa-4759-8fc9-1eca30777f72} Xamarin.Forms.Platform.UAP @@ -249,7 +257,7 @@ 6.2.9 - 2.3.191211002 + 2.4.2 11.0.2 diff --git a/Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs b/Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs index 15f825bb989..ed7b3c7c52b 100644 --- a/Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs +++ b/Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs @@ -10,6 +10,7 @@ using Xamarin.Forms.Controls; using Xamarin.Forms.Controls.Issues; using Xamarin.Forms.Platform.iOS; +using IOPath = System.IO.Path; [assembly: Dependency(typeof(TestCloudService))] [assembly: Dependency(typeof(CacheService))] @@ -40,7 +41,7 @@ public class CacheService : ICacheService public void ClearImageCache() { var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - var cache = Path.Combine(documents, ".config", ".isolated-storage", "ImageLoaderCache"); + var cache = IOPath.Combine(documents, ".config", ".isolated-storage", "ImageLoaderCache"); foreach (var file in Directory.GetFiles(cache)) { File.Delete(file); diff --git a/Xamarin.Forms.ControlGallery.iOS/Directory.Build.targets b/Xamarin.Forms.ControlGallery.iOS/Directory.Build.targets new file mode 100644 index 00000000000..6f72129c885 --- /dev/null +++ b/Xamarin.Forms.ControlGallery.iOS/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj index 3a9a3d518b6..155811707c9 100644 --- a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj +++ b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj @@ -3,7 +3,8 @@ Debug - iPhone + iPhone + iPhoneSimulator {C7131F14-274F-4B55-ACA9-E81731AD012F} {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Exe @@ -148,6 +149,20 @@ {cb9c96ce-125c-4a68-b6a1-c3ff1fbf93e1} Xamarin.Forms.Controls + + {52c50e88-7f15-45fe-a63c-8e7c76ca2bae} + Xamarin.Forms.Platform.iOS.UnitTests + false + false + + + + + {4dcd0420-1168-4b77-86db-6196ee4bd491} + Xamarin.Forms.CustomAttributes + + + {aba078c4-f9bb-4924-8b2b-10fe0d2f5491} Xamarin.Forms.Maps.iOS @@ -162,12 +177,6 @@ {57B8B73D-C3B5-4C42-869E-7B2F17D354AC} Xamarin.Forms.Core - - {52c50e88-7f15-45fe-a63c-8e7c76ca2bae} - Xamarin.Forms.Platform.iOS.UnitTests - false - false - {271193c1-6e7c-429c-a36d-3f1be5267231} Xamarin.Forms.Platform.iOS @@ -429,4 +438,4 @@ - \ No newline at end of file + diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Controls/INativeColorService.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Controls/INativeColorService.cs new file mode 100644 index 00000000000..48cf5363dad --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Controls/INativeColorService.cs @@ -0,0 +1,7 @@ +namespace Xamarin.Forms.Controls +{ + public interface INativeColorService + { + Color GetConvertedColor(bool shouldCrash); + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10134.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10134.cs new file mode 100644 index 00000000000..c3aea8d4990 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10134.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.Forms.Core.UITests; +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ +#if UITEST + [Category(UITestCategories.Shell)] +#endif + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10134, "Shell Top Tabbar focus issue", PlatformAffected.iOS)] + public class Issue10134 : TestShell + { + protected override void Init() + { + ContentPage page1 = AddTopTab("Tab 1"); + page1.Title = "Top Bar Page 1"; + + for(int i = 2; i < 20; i++) + { + AddTopTab($"Tab {i}"); + } + + page1.Content = + new StackLayout() + { + Children = + { + new Label() + { + Text = "Scroll and click on any of the currently non visible tabs. After clicking, if the Top Tabs don't scroll back to the beginninig the test has passed" + } + } + }; + } + +#if UITEST && __SHELL__ + [Test] + public void TopTabsDontScrollBackToStartWhenSelected() + { + var element1 = RunningApp.WaitForElement("Tab 1", "Shell hasn't loaded")[0].Rect; + RunningApp.WaitForNoElement("Tab 12", "Tab shouldn't be visible"); + + UITest.Queries.AppRect element2 = element1; + + for (int i = 2; i < 20; i++) + { + var results = RunningApp.Query($"Tab {i}"); + + if (results.Length == 0) + break; + + element2 = results[0].Rect; + } + + RunningApp.DragCoordinates(element2.CenterX, element2.CenterY, element1.CenterX, element1.CenterY); + + RunningApp.WaitForNoElement("Tab 1"); + bool testPassed = false; + + // figure out what tabs are visible + for (int i = 20; i > 1; i--) + { + var results = RunningApp.Query($"Tab {i}"); + + if (results.Length > 0) + { + RunningApp.Tap($"Tab {i}"); + RunningApp.WaitForElement($"Tab {i}"); + testPassed = true; + break; + } + } + + RunningApp.WaitForNoElement("Tab 1"); + Assert.IsTrue(testPassed); + } +#endif + + } +} diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10497.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10497.cs new file mode 100644 index 00000000000..6350bec4ca0 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10497.cs @@ -0,0 +1,105 @@ +using System.Collections.Generic; +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.Forms.Core.UITests; +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ +#if UITEST + [Category(UITestCategories.CollectionView)] +#endif + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10497, "[Bug] Controls inside CollectionView might flash scrollbar while they're not scrollable", PlatformAffected.Android)] + public class Issue10497 : TestContentPage + { + public Issue10497() + { + Title = "Issue 10497"; + + var layout = new StackLayout(); + + var instructions = new Label + { + BackgroundColor = Color.Black, + TextColor = Color.White, + Text = "If loading the page you don't see the scrollbar in each CollectionView Item, the test has passed." + }; + + var scrollBarVisibilityPicker = new Picker + { + Title = "VerticalScrollBarVisibility", + ItemsSource = new List + { + "Default", + "Always", + "Never" + }, + SelectedIndex = 0 + }; + + var collectionView = new CollectionView + { + Margin = new Thickness(0, 0, 50, 0) + }; + + collectionView.ItemsSource = new List + { + "Item 1", + "Item 2", + "Item 3", + "Item 4", + "Item 5", + "Lorem ipsum dolor sit amet, consectetur adipiscing elit", + "Item 7", + "Item 8", + "Item 9", + "Item 10" + }; + + collectionView.ItemTemplate = new DataTemplate(() => + { + var label = new Label + { + HeightRequest = 60, + FontSize = 75 + }; + + label.SetBinding(Label.TextProperty, "."); + + return label; + }); + + layout.Children.Add(instructions); + layout.Children.Add(scrollBarVisibilityPicker); + layout.Children.Add(collectionView); + + Content = layout; + + scrollBarVisibilityPicker.SelectedIndexChanged += (sender, args) => + { + switch (scrollBarVisibilityPicker.SelectedIndex) + { + case 0: + collectionView.VerticalScrollBarVisibility = ScrollBarVisibility.Default; + break; + case 1: + collectionView.VerticalScrollBarVisibility = ScrollBarVisibility.Always; + break; + case 2: + collectionView.VerticalScrollBarVisibility = ScrollBarVisibility.Never; + break; + } + }; + } + + protected override void Init() + { + + } + } +} diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10909.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10909.cs new file mode 100644 index 00000000000..120f6f09c98 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10909.cs @@ -0,0 +1,67 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +using Xamarin.Forms.Core.UITests; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ +#if UITEST + [Category(UITestCategories.DatePicker)] +#endif + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10909, "[Bug] UWP DatePicker and TimePicker Focus() function does not open the popup to set the date/time", + PlatformAffected.UWP)] + public class Issue10909 : TestContentPage + { + protected override void Init() + { + Title = "Issue 10909"; + + var layout = new StackLayout(); + + var instructions = new Label + { + Padding = 12, + Text = "If pressing the buttons opens the popup of both DatePicker and TimePicker, the test has passed.", + BackgroundColor = Color.Black, + TextColor = Color.White + }; + + var datePickerFocusButton = new Button + { + Text = "Set focus on DatePicker" + }; + + var datepicker = new DatePicker(); + + var timePickerFocusButton = new Button + { + Text = "Set focus on TimePicker" + }; + + var timePicker = new TimePicker(); + + layout.Children.Add(instructions); + layout.Children.Add(datePickerFocusButton); + layout.Children.Add(datepicker); + layout.Children.Add(timePickerFocusButton); + layout.Children.Add(timePicker); + + Content = layout; + + datePickerFocusButton.Clicked += (sender, args) => + { + datepicker.Focus(); + }; + + timePickerFocusButton.Clicked += (sender, args) => + { + timePicker.Focus(); + }; + } + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10940.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10940.cs new file mode 100644 index 00000000000..d8c1410e4e9 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10940.cs @@ -0,0 +1,89 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System.Collections.Generic; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +using Xamarin.Forms.Core.UITests; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ +#if UITEST + [Category(UITestCategories.SwipeView)] +#endif + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 10940, + "[Android]CustomRenderer object was created twice for single control when add custom control in SwipeView item", + PlatformAffected.Android)] + public class Issue10940 : TestContentPage + { + public Issue10940() + { +#if APP + Device.SetFlags(new List { ExperimentalFlags.SwipeViewExperimental }); +#endif + } + + protected override void Init() + { + Title = "Issue 10940"; + + var layout = new StackLayout(); + + var instructions = new Label + { + Padding = 12, + BackgroundColor = Color.Black, + TextColor = Color.White, + Text = "Swipe to the left and verify that opening the SwipeView the CustomEntry is created only one time." + }; + + var customSwipeView = new CustomSwipeView + { + BackgroundColor = Color.LightGray, + HeightRequest = 200 + }; + + var swipeItemView = new SwipeItemView(); + + var swipeItemViewContent = new Grid + { + BackgroundColor = Color.White, + WidthRequest = 150 + }; + + var customEntry = new CustomEntry + { + VerticalOptions = LayoutOptions.Center + }; + + swipeItemViewContent.Children.Add(customEntry); + + swipeItemView.Content = swipeItemViewContent; + + customSwipeView.RightItems = new SwipeItems + { + swipeItemView + }; + + layout.Children.Add(instructions); + layout.Children.Add(customSwipeView); + + Content = layout; + } + } + + [Preserve(AllMembers = true)] + public class CustomEntry : Entry + { + + } + + [Preserve(AllMembers = true)] + public class CustomSwipeView : SwipeView + { + + } +} \ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5470.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5470.cs index 66f15ff17a7..32eb3affd20 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5470.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue5470.cs @@ -2,6 +2,7 @@ using Xamarin.Forms.Internals; using System; using System.Threading.Tasks; +using System.Threading; #if UITEST using Xamarin.Forms.Core.UITests; @@ -56,9 +57,9 @@ AppLinkEntry GetEntry() #if UITEST && __IOS__ [Test] - public async void Issue5470Test() + public void Issue5470Test() { - await Task.Delay(500); // give it time to crash + Thread.Sleep(500); // give it time to crash RunningApp.WaitForElement (q => q.Marked ("IssuePageLabel")); } #endif diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7856.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7856.cs new file mode 100644 index 00000000000..2e1d1e1ba6a --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7856.cs @@ -0,0 +1,63 @@ +using System; +using Xamarin.Forms.CustomAttributes; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +using Xamarin.Forms.Core.UITests; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Issue(IssueTracker.Github, 7856, + "[Bug] Shell BackButtonBehaviour TextOverride breaks back", + PlatformAffected.iOS)] +#if UITEST + [NUnit.Framework.Category(UITestCategories.Shell)] +#endif + public class Issue7856 : TestShell + { + + const string ContentPageTitle = "Item1"; + const string ButtonId = "ButtonId"; + + protected override void Init() + { + CreateContentPage(ContentPageTitle).Content = + new StackLayout + { + Children = + { + new Button + { + AutomationId = ButtonId, + Text = "Tap to Navigate To the Page With BackButtonBehavior", + Command = new Command(NavToBackButtonBehaviorPage) + } + } + }; + } + + private void NavToBackButtonBehaviorPage() + { + _ = Shell.Current.Navigation.PushAsync(new Issue7856_1()); + } + +#if UITEST && __IOS__ + [Test] + public void BackButtonBehaviorTest() + { + RunningApp.Tap(x => x.Text("Tap to Navigate To the Page With BackButtonBehavior")); + + RunningApp.WaitForElement(x => x.Text("Navigate again")); + + RunningApp.Tap(x => x.Text("Navigate again")); + + RunningApp.WaitForElement(x => x.Text("Test")); + + RunningApp.Tap(x => x.Text("Test")); + + } +#endif + } +} diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7856_1.xaml b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7856_1.xaml new file mode 100644 index 00000000000..0ecc00686d0 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue7856_1.xaml @@ -0,0 +1,9 @@ + + + + +