From 7e282283544cfa48ec314fde1ec9c0d78f8ac07b Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Tue, 16 Feb 2021 09:37:32 +0100 Subject: [PATCH] Merge main into dev (#913) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Android] Fix Long Press blocks CollectionView selection (#764) * https://github.com/xamarin/XamarinCommunityToolkit/issues/760 * Moved helper methods to VisualElementExtensions * Update src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/VisualElementExtension.shared.cs * Update src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/VisualElementExtension.shared.cs Co-authored-by: Javier Suárez Co-authored-by: Gerald Versluis * [Android] Fix SideMenuView + Slider issue (#824) * [Android] Allow using slider inside SideMenu with disabled gestures https://github.com/xamarin/XamarinCommunityToolkit/issues/810 * Refactored gesture default threshold https://github.com/xamarin/XamarinCommunityToolkit/issues/810 * Cleaned code. Added linker safety code * Fixed build Co-authored-by: Javier Suárez * Automated dotnet-format update (#837) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Remove `Device` dependency from command implementation (#825) (#830) * Remove `Device` dependency from command implementation (#804) * Move Xamarin.CommunityToolkit.ObjectModel.Internals classes to `Internals` folder * Add Platform-Specific MainThread Implementations, Update Unit Tests to Acommidate Context Switching * Update BaseCommand.uwp.cs * Add BaseCommand.wpf.cs * Finish BaseCommand.gtk.cs * Update BaseCommand.shared.cs Co-authored-by: Eugen Richter Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> * Automated dotnet-format update (#865) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fixes https://github.com/xamarin/XamarinCommunityToolkit/issues/859 (#864) Co-authored-by: Gerald Versluis * ValidationBehavior: Added IsNotValid property (#836) * Added IsNotValid property to validators * small fix * Updated sample * https://github.com/xamarin/XamarinCommunityToolkit/issues/822 (#877) * Fixes AvatarView - Valid source images dont load for the first time they are created (#849) * https://github.com/xamarin/XamarinCommunityToolkit/issues/805 * Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/AvatarView/AvatarView.shared.cs Co-authored-by: Gerald Versluis * Fixed image loading * Fixed null ref * Fixes crashes Co-authored-by: Gerald Versluis Co-authored-by: Javier Suárez Co-authored-by: Pedro Jesus * Added inline docs (#882) * Update ViewsGalleryViewModel.cs (#888) removed duplicated text "used to" * Document all behaviors and associated (#895) * Housekeeping remove XamlCompilation from code-behind. (#897) * Changed TabView SelectedIndex property to use TwoWay binding mode (#903) * Add inline Docs/Comments to Converters (#907) * Update azure-pipelines.yml Co-authored-by: Andrei Co-authored-by: Javier Suárez Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Eugen Richter Co-authored-by: Eugen Richter Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Co-authored-by: Pedro Jesus Co-authored-by: WillAutioItrax <15933820+WillAutioItrax@users.noreply.github.com> Co-authored-by: Cfun <15718354+Cfun1@users.noreply.github.com> --- azure-pipelines.yml | 13 +- samples/XCT.Sample/Pages/AboutPage.xaml.cs | 1 + .../EmailValidationBehaviorPage.xaml | 20 ++- .../ImpliedOrderGridBehaviorPage.xaml.cs | 2 - .../MaxLengthReachedBehaviorPage.xaml.cs | 2 - ...quiredStringValidationBehaviorPage.xaml.cs | 5 +- .../UserStoppedTypingBehaviorPage.xaml.cs | 5 +- .../DateTimeOffsetConverterPage.xaml.cs | 5 +- .../Pages/Effects/EffectsGalleryPage.xaml.cs | 5 +- .../Effects/IconTintColorEffectPage.xaml.cs | 5 +- .../Effects/RemoveBorderEffectPage.xaml.cs | 9 +- .../Pages/Effects/SafeAreaEffectPage.xaml.cs | 2 - .../Effects/SelectAllTextEffectPage.xaml.cs | 9 +- .../Pages/Effects/TouchEffectPage.xaml.cs | 2 +- .../TouchEffectCollectionViewPage.xaml | 67 +++++++++ .../TouchEffectCollectionViewPage.xaml.cs | 19 +++ .../Pages/Views/SideMenuViewPage.xaml | 27 ++-- .../TestCases/TestCasesGalleryViewModel.cs | 5 + .../ViewModels/Views/ViewsGalleryViewModel.cs | 4 +- .../AsyncCommandTests/AsyncCommand_Tests.cs | 128 ++++++++++++++++- .../AsyncValueCommand_Tests.cs | 22 ++- .../Behaviors/BaseBehavior.shared.cs | 4 + .../EventToCommandBehavior.shared.cs | 27 ++++ .../ImpliedOrderGridBehavior.shared.cs | 6 + .../Behaviors/MaskedBehavior.shared.cs | 15 ++ .../MaxLengthReachedBehavior.shared.cs | 18 +++ .../MaxLengthReachedEventArgs.shared.cs | 10 ++ .../Validators/CharacterType.shared.cs | 24 ++++ .../CharactersValidationBehavior.shared.cs | 24 ++++ .../EmailValidationBehavior.shared.cs | 3 + .../MultiValidationBehavior.shared.cs | 27 +++- .../NumericValidationBehavior.shared.cs | 27 ++++ ...RequiredStringValidationBehavior.shared.cs | 9 ++ .../Validators/TextDecorationFlags.shared.cs | 14 ++ .../TextValidationBehavior.shared.cs | 41 +++++- .../UriValidationBehavior.shared.cs | 9 ++ .../Validators/ValidationBehavior.shared.cs | 71 ++++++++- .../BoolToObjectConverter.shared.cs | 23 ++- .../ByteArrayToImageSourceConverter.shared.cs | 21 ++- .../DateTimeOffsetConverter.shared.cs | 22 +-- .../Converters/DoubleToIntConverter.shared.cs | 20 +-- .../Converters/EqualConverter.shared.cs | 20 ++- .../IndexToArrayItemConverter.shared.cs | 12 +- .../Converters/IntToBoolConverter.shared.cs | 26 ++-- .../InvertedBoolConverter.shared.cs | 26 ++-- .../IsNotNullOrEmptyConverter.shared.cs | 20 ++- .../IsNullOrEmptyConverter.shared.cs | 20 ++- .../ItemSelectedEventArgsConverter.shared.cs | 20 ++- .../ItemTappedEventArgsConverter.shared.cs | 20 ++- .../ListIsNotNullOrEmptyConverter.shared.cs | 20 ++- .../ListIsNullOrEmptyConverter.shared.cs | 20 ++- .../ListToStringConverter.shared.cs | 18 ++- .../Converters/MultiConverter.shared.cs | 8 ++ .../MultiConverterParameter.shared.cs | 8 +- .../Converters/NotEqualConverter.shared.cs | 18 ++- .../StateToBooleanConverter.shared.cs | 22 +++ .../Converters/TextCaseConverter.shared.cs | 18 ++- .../Converters/TextCaseType.shared.cs | 7 +- .../TimeSpanToDoubleConverter.shared.cs | 23 ++- .../VariableMultiValueConverter.shared.cs | 25 ++++ .../Effects/Touch/GestureManager.shared.cs | 30 ++++ .../VisualElementExtension.shared.cs | 24 +++- .../Helpers/MultiBindingCondition.shared.cs | 14 ++ .../BaseAsyncCommand.shared.cs | 2 + .../BaseAsyncValueCommand.shared.cs | 4 +- .../Internals/BaseCommand.android.cs | 30 ++++ .../ObjectModel/Internals/BaseCommand.gtk.cs | 21 +++ .../BaseCommand.ios.watchos.tvos.macos.cs | 13 ++ .../Internals/BaseCommand.netstandard.cs | 21 +++ .../{ => Internals}/BaseCommand.shared.cs | 8 +- .../Internals/BaseCommand.tizen.cs | 19 +++ .../ObjectModel/Internals/BaseCommand.uwp.cs | 45 ++++++ .../ObjectModel/Internals/BaseCommand.wpf.cs | 12 ++ .../Views/AvatarView/AvatarView.shared.cs | 135 ++++++++++++++---- .../Views/SideMenuView/SideMenuView.shared.cs | 112 +++++++++------ .../SideMenuViewRenderer.android.cs | 19 +-- .../SideMenuView/SideMenuViewRenderer.ios.cs | 10 +- .../Views/TabView/TabView.shared.cs | 2 +- .../Xamarin.CommunityToolkit.csproj | 6 + 79 files changed, 1348 insertions(+), 302 deletions(-) create mode 100644 samples/XCT.Sample/Pages/TestCases/TouchEffectCollectionViewPage.xaml create mode 100644 samples/XCT.Sample/Pages/TestCases/TouchEffectCollectionViewPage.xaml.cs rename src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/{ => Internals}/BaseAsyncCommand.shared.cs (98%) rename src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/{ => Internals}/BaseAsyncValueCommand.shared.cs (95%) create mode 100644 src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Internals/BaseCommand.android.cs create mode 100644 src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Internals/BaseCommand.gtk.cs create mode 100644 src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Internals/BaseCommand.ios.watchos.tvos.macos.cs create mode 100644 src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Internals/BaseCommand.netstandard.cs rename src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/{ => Internals}/BaseCommand.shared.cs (89%) create mode 100644 src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Internals/BaseCommand.tizen.cs create mode 100644 src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Internals/BaseCommand.uwp.cs create mode 100644 src/CommunityToolkit/Xamarin.CommunityToolkit/ObjectModel/Internals/BaseCommand.wpf.cs diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b31c75dde..965bd9046 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,8 +4,8 @@ variables: PreviewNumber: $[counter(variables['CurrentSemanticVersionBase'], 1001)] CurrentSemanticVersion: '$(CurrentSemanticVersionBase)-preview$(PreviewNumber)' NugetPackageVersion: '$(CurrentSemanticVersion)' - MONO_VERSION: 6_4_0 - XCODE_VERSION: 11.4 + #MONO_VERSION: 6_4_0 + #XCODE_VERSION: 11.4 NETCORE_VERSION: '3.1.x' NETCORE_TEST_VERSION: '3.1.x' RunPoliCheck: 'false' @@ -153,11 +153,12 @@ jobs: Write-Host ("##vso[task.setvariable variable=NugetPackageVersion;]$tagVersion") displayName: Set NuGet Version to Tag Number condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/') + # 16feb21 jfversluis: let's not pin this anymore and use latest # make sure to select the correct Xamarin and mono - - bash: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh $(MONO_VERSION) - displayName: Switch to the latest Xamarin SDK - - bash: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(XCODE_VERSION).app;sudo xcode-select --switch /Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer - displayName: Switch to the latest Xcode + #- bash: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh $(MONO_VERSION) + # displayName: Switch to the latest Xamarin SDK + #- bash: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(XCODE_VERSION).app;sudo xcode-select --switch /Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer + # displayName: Switch to the latest Xcode # restore, build and pack the packages - task: UseDotNet@2 displayName: 'Use .Net Core sdk' diff --git a/samples/XCT.Sample/Pages/AboutPage.xaml.cs b/samples/XCT.Sample/Pages/AboutPage.xaml.cs index b4973351f..2c1826452 100644 --- a/samples/XCT.Sample/Pages/AboutPage.xaml.cs +++ b/samples/XCT.Sample/Pages/AboutPage.xaml.cs @@ -1,4 +1,5 @@ using System; +using Xamarin.CommunityToolkit.Sample.ViewModels; namespace Xamarin.CommunityToolkit.Sample.Pages { diff --git a/samples/XCT.Sample/Pages/Behaviors/EmailValidationBehaviorPage.xaml b/samples/XCT.Sample/Pages/Behaviors/EmailValidationBehaviorPage.xaml index e9d055e70..f9fef55cd 100644 --- a/samples/XCT.Sample/Pages/Behaviors/EmailValidationBehaviorPage.xaml +++ b/samples/XCT.Sample/Pages/Behaviors/EmailValidationBehaviorPage.xaml @@ -15,11 +15,21 @@ Spacing="50" VerticalOptions="CenterAndExpand">