From 8d9386744df95b8670c47ccac10e647a88ac3db4 Mon Sep 17 00:00:00 2001 From: Kym Phillpotts Date: Mon, 4 Sep 2023 21:09:36 +0200 Subject: [PATCH] Bringing touch-effect up to date with main (#1383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Popup v6 windows (#1086) Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Co-authored-by: Pedro Jesus Co-authored-by: Shaun Lawrence * ♻️ [Housekeeping] Fixed GravatarImageSourceTests.TestDefaultStream (#1335) * [housekeeping] Automated PR to fix formatting errors (#1327) * Fix popup margin on iOS (#1329) * Bump NuGet.Protocol from 6.6.1 to 6.7.0 in /samples (#1330) * Use fully qualified namespace for Color reference in TextToColorGenerator (#1332) * Use fully qualified namespace for Color reference in TextToColorGenerator to prevent collisions This change should prevent "ambiguous reference" error to occur when other packages are included in a MAUI project that provide their own Color objects * added global prefix to be safer --------- Co-authored-by: Pedro Jesus Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> * Code cleanup and preparation for the next release (breaking changes) (#1324) * Code cleanup and preparation for .net 8 * Update CompareConverter.shared.cs * Revert global.json * More CleanUps * Remove redundant TrySetCanceled and rely on speech recognition result * Update Formatting --------- Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> * Fix Gestures on Popup on ios (#1342) * Fix Gestures on Popup on ios * don't query type cast directly * Code for AddLogicalChild (.NET 8) * reduce changes * setting the parent fixes the BindingContext of the view * Revert "setting the parent fixes the BindingContext of the view" This reverts commit 0a64b56ca51948bd0596408a14cfadf60c3dde41. * reduce changes * simplify code * fixing build * assigned Element to contentPage.Parent --------- Co-authored-by: pedrojesus * `global.json`: Change `"rollForward": "latestMajor",` -> `"rollForward": "latestFeature"`. (#1338) Update global.json * Bump Microsoft.NET.Test.Sdk from 17.7.0 to 17.7.1 in /samples (#1348) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.7.0 to 17.7.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.7.0...v17.7.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 632 bug avatar view clipping on windows (#1344) * Resolves issue on Windows where the splash screen icon is not found. * Resolves an issue with the 'Ratings' sample for AvatarView. * Spaces and not tabs * Spaces and not tabs * Changed MauiImage to point to Images folder. * Changed splash for Windows to be Resize=False * Typo in name of MauiImage * Try to prevent locking. * Bump Microsoft.CodeAnalysis from 4.6.0 to 4.7.0 in /samples (#1355) * Bump Microsoft.CodeAnalysis.CSharp.Workspaces from 4.6.0 to 4.7.0 in /samples (#1357) * Bump FluentAssertions from 6.11.0 to 6.12.0 in /samples (#1365) * fix IconTintColorBehavior for Windows (#1370) fix IconTintColorBehavior for windows Co-authored-by: Oleksii * Add `MemoryAnalyzer` roslyn analyzer (#1371) * Add NuGet Package + Update `WarningsAsErrors` * Fix MA0002 * Fix `MauiDrawingView` * Fix `MauiPopup` * Fix Naming * return `null` for nullable references * Use Ternary Operator * `dotnet format` * iOS popup fix with Shell or TabbedPage (#1343) * Fix Issue #1256 Better fix * Fixed Popup on Multiple Level Pages (#822) --------- Co-authored-by: Vladislav Antonyuk <33021114+VladislavAntonyuk@users.noreply.github.com> Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> * [housekeeping] Automated PR to fix formatting errors (#1373) * Bump Microsoft.NET.Test.Sdk from 17.7.1 to 17.7.2 in /samples (#1378) --------- Signed-off-by: dependabot[bot] Co-authored-by: Vladislav Antonyuk <33021114+VladislavAntonyuk@users.noreply.github.com> Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Co-authored-by: Pedro Jesus Co-authored-by: Shaun Lawrence Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: cat0363 <125236133+cat0363@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Wolf <132034537+wolfgang-ironsoftware@users.noreply.github.com> Co-authored-by: Thomas Stocker Co-authored-by: George Leithead Co-authored-by: Sokol2001 <53799292+Sokol2001@users.noreply.github.com> Co-authored-by: Oleksii Co-authored-by: Andrey Onishchenko <100789522+cucumber-sp@users.noreply.github.com> --- CONTRIBUTING.md | 7 +- Directory.Build.props | 8 +- Directory.Build.targets | 8 +- global.json | 2 +- .../CommunityToolkit.Maui.Sample.csproj | 13 +- .../Pages/Essentials/SpeechToTextPage.xaml | 2 +- .../AvatarView/AvatarViewRatingPage.xaml | 18 +- .../Pages/Views/Popup/PopupPositionPage.xaml | 14 +- .../Popup/ShowPopupInOnAppearingPage.xaml.cs | 3 +- .../Resources/Images/splash.svg | 8 + ...yteArrayToImageSourceConverterViewModel.cs | 5 +- .../Essentials/SpeechToTextViewModel.cs | 10 +- .../Views/Popup/PopupAnchorViewModel.cs | 14 - .../Views/Popup/XamlBindingPopupViewModel.cs | 2 +- .../Views/Popups/OpenedEventSimplePopup.xaml | 4 +- .../Popups/OpenedEventSimplePopup.xaml.cs | 4 +- .../Views/Popups/TransparentPopupCSharp.cs | 2 +- .../Views/Popups/XamlBindingPopup.xaml | 7 +- ...ityToolkit.Maui.Analyzers.CodeFixes.csproj | 2 +- ...ityToolkit.Maui.Analyzers.UnitTests.csproj | 10 +- .../CommunityToolkit.Maui.Core.csproj | 15 +- .../FileSaverImplementation.macios.cs | 2 +- .../SpeechToTextImplementation.windows.cs | 6 +- .../Handlers/Popup/PopUpHandler.windows.cs | 50 ++- .../Platform/StatusBar/StatusBar.net.cs | 4 +- .../Views/Alert/AlertView.macios.cs | 20 +- .../PlatformView/MauiDrawingView.android.cs | 22 +- .../PlatformView/MauiDrawingView.macios.cs | 3 +- .../PlatformView/MauiDrawingView.shared.cs | 50 ++- .../PlatformView/MauiDrawingView.tizen.cs | 3 +- .../PlatformView/MauiDrawingView.windows.cs | 3 +- .../Views/Popup/MauiPopup.macios.cs | 33 +- .../Views/Popup/MauiPopup.windows.cs | 288 ------------------ .../Views/Popup/PopupExtensions.macios.cs | 4 + .../Views/Popup/PopupExtensions.windows.cs | 173 ++++++++++- .../Views/RoundedStackView.macios.cs | 79 ----- .../CommunityToolkit.Maui.Maps.csproj | 13 +- ...ui.MediaElement.Analyzers.CodeFixes.csproj | 2 +- .../CommunityToolkit.Maui.MediaElement.csproj | 17 +- .../Views/MauiMediaElement.android.cs | 11 +- .../Views/MauiMediaElement.windows.cs | 16 +- .../Views/MediaManager.android.cs | 7 +- .../Generators/TextColorToGenerator.cs | 3 +- .../Behaviors/StatusBarBehaviorTests.cs | 4 +- .../CommunityToolkit.Maui.UnitTests.csproj | 6 +- .../Converters/IntToBoolConverterTests.cs | 2 +- .../GravatarImageSourceTests.cs | 2 +- .../Layouts/StateContainerTests.cs | 20 +- .../Mocks/MockDispatcherProvider.cs | 2 +- .../Alerts/Toast/Toast.windows.cs | 4 - .../Behaviors/BaseBehavior.shared.cs | 3 +- .../EventToCommandBehavior.shared.cs | 4 +- .../IconTintColorBehavior.windows.cs | 9 +- .../SelectAllTextBehavior.macios.cs | 3 +- .../CommunityToolkit.Maui.csproj | 13 +- .../Converters/CompareConverter.shared.cs | 4 +- .../Popup/Popup.macios.cs | 4 +- .../Popup/Popup.windows.cs | 33 -- .../Views/Popup/Popup.shared.cs | 3 - .../Views/Popup/PopupExtensions.shared.cs | 2 + 60 files changed, 479 insertions(+), 606 deletions(-) create mode 100644 samples/CommunityToolkit.Maui.Sample/Resources/Images/splash.svg delete mode 100644 src/CommunityToolkit.Maui.Core/Views/Popup/MauiPopup.windows.cs delete mode 100644 src/CommunityToolkit.Maui.Core/Views/RoundedStackView.macios.cs delete mode 100644 src/CommunityToolkit.Maui/HandlerImplementation/Popup/Popup.windows.cs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2365f2012..eae3db033 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,13 +36,16 @@ Please see our [Code of Conduct](https://dotnetfoundation.org/code-of-conduct). As should be clear by now: we assume everyone tries to do their best, everyone should be treated with respect and equally. -In the unfortunate event that doesn't happen, please feel free to report it to any of the team members or reach out to [Gerald](maillo:gerald.versluis@microsoft.com) directly. +In the unfortunate event that doesn't happen, please feel free to report it to any of the team members or reach out to [Gerald](mailto:gerald.versluis@microsoft.com) directly. We will take appropriate actions and measures if necessary. ## Prerequisites -You will need to complete a Contribution License Agreement before any pull request can be accepted. Complete the CLA at https://cla.dotnetfoundation.org/. This will also be triggered whenever you open a PR and the link should guide you through it. +1. Install latest stable [.NET SDK](https://dotnet.microsoft.com/en-us/download) +1. Install .NET MAUI workloads (we recommend using Visual Studio installer) + +> You will need to complete a Contribution License Agreement before any pull request can be accepted. Complete the CLA at https://cla.dotnetfoundation.org/. This will also be triggered whenever you open a PR and the link should guide you through it. ## Reporting a bug diff --git a/Directory.Build.props b/Directory.Build.props index 585980c8b..f8fd1d1de 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,7 @@  + net7.0 false latest @@ -26,8 +27,11 @@ CS1592: Badly formed XML in included comments file CS1598: XML parser could not be loaded. The XML documentation file will not be generated. CS1658: Identifier expected; 'true' is a keyword - CS1734: XML comment has a paramref tag, but there is no parameter by that name --> - nullable,CS0419,CS1570,CS1571,CS1572,CS1573,CS1574,CS1580,CS1581,CS1584,CS1589,CS1590,CS1592,CS1598,CS1658,CS1734 + CS1734: XML comment has a paramref tag, but there is no parameter by that name + MA0001: Don't define public events in NSObject subclasses + MA0002: Don't declare members in NSObject subclasses unless they are WeakReference, WeakReference, or Value types + MA0003: Don't subscribe to events inside NSObject subclasses unless it's your event (via this.MyEvent) or inherited from a base type, or the method is static --> + nullable,CS0419,CS1570,CS1571,CS1572,CS1573,CS1574,CS1580,CS1581,CS1584,CS1589,CS1590,CS1592,CS1598,CS1658,CS1734,MA0001,MA0002,MA0003 diff --git a/Directory.Build.targets b/Directory.Build.targets index 46d5afffd..a16476c2f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,24 +1,24 @@  - + - + - + - + diff --git a/global.json b/global.json index 6c8b056ba..ccd059ad5 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { "version": "7.0.200", - "rollForward": "latestMajor", + "rollForward": "latestFeature", "allowPrerelease": false } } diff --git a/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj b/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj index 0dd52648b..549161162 100644 --- a/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj +++ b/samples/CommunityToolkit.Maui.Sample/CommunityToolkit.Maui.Sample.csproj @@ -1,9 +1,9 @@ - + - net7.0-ios;net7.0-android;net7.0-maccatalyst - $(TargetFrameworks);net7.0-windows10.0.19041.0 - $(TargetFrameworks);net7.0-tizen + $(NetVersion)-ios;$(NetVersion)-android;$(NetVersion)-maccatalyst + $(TargetFrameworks);$(NetVersion)-windows10.0.19041.0 + $(TargetFrameworks);$(NetVersion)-tizen Exe true true @@ -42,6 +42,7 @@ + @@ -49,7 +50,7 @@ - + @@ -83,4 +84,4 @@ maccatalyst-arm64;maccatalyst-x64 - + \ No newline at end of file diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/SpeechToTextPage.xaml b/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/SpeechToTextPage.xaml index 1d78bf18a..d864224ce 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/SpeechToTextPage.xaml +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Essentials/SpeechToTextPage.xaml @@ -30,7 +30,7 @@ diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewRatingPage.xaml b/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewRatingPage.xaml index 5429f4211..86086f8e0 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewRatingPage.xaml +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Views/AvatarView/AvatarViewRatingPage.xaml @@ -53,8 +53,6 @@ - - @@ -66,7 +64,7 @@ Grid.Column="0" HeightRequest="48" SemanticProperties.Description="Sample AvatarView idea using a polyline stroke shape to override the corder radius to draw a star." - StrokeShape="Polyline 70,16 76,32 94,32 80,44 84,60 70,50 55,60 60,42 46,32 64,32" + StrokeShape="Polyline 24,0 29,16 48,18 34,30 38,48 24,37 10,48 14,30 0,18 19,16" Style="{StaticResource Rating}" Text="1" WidthRequest="48" /> @@ -74,7 +72,7 @@ Grid.Column="1" HeightRequest="48" SemanticProperties.Description="Sample AvatarView idea using a polyline stroke shape to override the corder radius to draw a star." - StrokeShape="Polyline 70,16 76,32 94,32 80,44 84,60 70,50 55,60 60,42 46,32 64,32" + StrokeShape="Polyline 24,0 29,16 48,18 34,30 38,48 24,37 10,48 14,30 0,18 19,16" Style="{StaticResource Rating}" Text="2" WidthRequest="48" /> @@ -82,7 +80,7 @@ Grid.Column="2" HeightRequest="48" SemanticProperties.Description="Sample AvatarView idea using a polyline stroke shape to override the corder radius to draw a star." - StrokeShape="Polyline 70,16 76,32 94,32 80,44 84,60 70,50 55,60 60,42 46,32 64,32" + StrokeShape="Polyline 24,0 29,16 48,18 34,30 38,48 24,37 10,48 14,30 0,18 19,16" Style="{StaticResource Rating}" Text="3" WidthRequest="48" /> @@ -90,7 +88,7 @@ Grid.Column="3" HeightRequest="48" SemanticProperties.Description="Sample AvatarView idea using a polyline stroke shape to override the corder radius to draw a star." - StrokeShape="Polyline 70,16 76,32 94,32 80,44 84,60 70,50 55,60 60,42 46,32 64,32" + StrokeShape="Polyline 24,0 29,16 48,18 34,30 38,48 24,37 10,48 14,30 0,18 19,16" Style="{StaticResource Rating}" Text="4" WidthRequest="48" /> @@ -98,7 +96,7 @@ Grid.Column="4" HeightRequest="48" SemanticProperties.Description="Sample AvatarView idea using a polyline stroke shape to override the corder radius to draw a star, cliped by parent size." - StrokeShape="Polyline 70,16 76,32 94,32 80,44 84,60 70,50 55,60 60,42 46,32 64,32" + StrokeShape="Polyline 24,0 29,16 48,18 34,30 38,48 24,37 10,48 14,30 0,18 19,16" Style="{StaticResource Rating}" Text="5" WidthRequest="48"> @@ -112,7 +110,7 @@ HeightRequest="48" ImageSource="avatar_icon.png" SemanticProperties.Description="Sample AvatarView idea using a polyline stroke shape to override the corder radius to draw a star." - StrokeShape="Polyline 70,16 76,32 94,32 80,44 84,60 70,50 55,60 60,42 46,32 64,32" + StrokeShape="Polyline 24,0 29,16 48,18 34,30 38,48 24,37 10,48 14,30 0,18 19,16" Style="{StaticResource Rating}" Text="1" WidthRequest="48" /> @@ -122,7 +120,7 @@ HeightRequest="48" ImageSource="https://aka.ms/campus.jpg" SemanticProperties.Description="Sample AvatarView idea using a polyline stroke shape to override the corder radius to draw a star." - StrokeShape="Polyline 70,16 76,32 94,32 80,44 84,60 70,50 55,60 60,42 46,32 64,32" + StrokeShape="Polyline 24,0 29,16 48,18 34,30 38,48 24,37 10,48 14,30 0,18 19,16" Style="{StaticResource Rating}" Text="2" WidthRequest="48" /> @@ -132,7 +130,7 @@ HeightRequest="48" ImageSource="avatar_icon.png" SemanticProperties.Description="Sample AvatarView idea using a polyline stroke shape to override the corder radius to draw a star, cliped by parent size." - StrokeShape="Polyline 70,16 76,32 94,32 80,44 84,60 70,50 55,60 60,42 46,32 64,32" + StrokeShape="Polyline 24,0 29,16 48,18 34,30 38,48 24,37 10,48 14,30 0,18 19,16" Style="{StaticResource Rating}" Text="3" WidthRequest="48"> diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupPositionPage.xaml b/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupPositionPage.xaml index 134d578dc..6f8979d27 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupPositionPage.xaml +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Views/Popup/PopupPositionPage.xaml @@ -13,25 +13,21 @@ - + VerticalOptions="Center">