Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge main into dev (#913)
Browse files Browse the repository at this point in the history
* [Android] Fix Long Press blocks CollectionView selection  (#764)

* #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 <javiersuarezruiz@hotmail.com>
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>

* [Android] Fix SideMenuView + Slider issue (#824)

* [Android] Allow using slider inside SideMenu with disabled gestures

#810

* Refactored gesture default threshold
#810

* Cleaned code. Added linker safety code

* Fixed build

Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>

* 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 <eugen.richter@amcsgroup.com>
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 #859 (#864)

Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>

* ValidationBehavior: Added IsNotValid property (#836)

* Added IsNotValid property to validators

* small fix

* Updated sample

* #822 (#877)

* Fixes AvatarView - Valid source images dont load for the first time they are created  (#849)

* #805

* Update src/CommunityToolkit/Xamarin.CommunityToolkit/Views/AvatarView/AvatarView.shared.cs

Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>

* Fixed image loading

* Fixed null ref

* Fixes crashes

Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>

* 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 <andrei.misiukevich@gmail.com>
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eugen Richter <github@richter.consulting>
Co-authored-by: Eugen Richter <eugen.richter@amcsgroup.com>
Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com>
Co-authored-by: Pedro Jesus <pedrojesus.cefet@gmail.com>
Co-authored-by: WillAutioItrax <15933820+WillAutioItrax@users.noreply.github.com>
Co-authored-by: Cfun <15718354+Cfun1@users.noreply.github.com>
  • Loading branch information
10 people committed Feb 16, 2021
1 parent 0d55a63 commit 7e28228
Show file tree
Hide file tree
Showing 79 changed files with 1,348 additions and 302 deletions.
13 changes: 7 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions samples/XCT.Sample/Pages/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Xamarin.CommunityToolkit.Sample.ViewModels;

namespace Xamarin.CommunityToolkit.Sample.Pages
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@
Spacing="50"
VerticalOptions="CenterAndExpand">
<Label Text="Text color will change accordingly to the style that is configured when a invalid value (email address) is entered." />
<Entry Placeholder="Email">
<Entry.Behaviors>
<xct:EmailValidationBehavior DecorationFlags="Trim" InvalidStyle="{StaticResource InvalidEntryStyle}"/>
</Entry.Behaviors>
</Entry>
<StackLayout Spacing="3">
<Entry Placeholder="Email">
<Entry.Behaviors>
<xct:EmailValidationBehavior
x:Name="EmailValidator"
DecorationFlags="Trim"
InvalidStyle="{StaticResource InvalidEntryStyle}"/>
</Entry.Behaviors>
</Entry>
<Label Text="Invalid email"
TextColor="Red"
FontSize="10"
IsVisible="{Binding IsNotValid, Source={x:Reference EmailValidator}}"
/>
</StackLayout>
</StackLayout>

</pages:BasePage>
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System;
using System.Linq;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Behaviors
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ImpliedOrderGridBehaviorPage
{
public ImpliedOrderGridBehaviorPage() => InitializeComponent();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Xamarin.CommunityToolkit.Behaviors;
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Behaviors
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MaxLengthReachedBehaviorPage : BasePage
{
public MaxLengthReachedBehaviorPage()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Behaviors
namespace Xamarin.CommunityToolkit.Sample.Pages.Behaviors
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class RequiredStringValidationBehaviorPage : BasePage
{
public RequiredStringValidationBehaviorPage()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Behaviors
namespace Xamarin.CommunityToolkit.Sample.Pages.Behaviors
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class UserStoppedTypingBehaviorPage : BasePage
{
public UserStoppedTypingBehaviorPage() => InitializeComponent();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Converters
namespace Xamarin.CommunityToolkit.Sample.Pages.Converters
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class DateTimeOffsetConverterPage : BasePage
{
public DateTimeOffsetConverterPage()
Expand Down
5 changes: 1 addition & 4 deletions samples/XCT.Sample/Pages/Effects/EffectsGalleryPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class EffectsGalleryPage
{
public EffectsGalleryPage() => InitializeComponent();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class IconTintColorEffectPage : BasePage
{
public IconTintColorEffectPage()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using System;
using System.Collections.Generic;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class RemoveBorderEffectPage
{
public RemoveBorderEffectPage() => InitializeComponent();
Expand Down
2 changes: 0 additions & 2 deletions samples/XCT.Sample/Pages/Effects/SafeAreaEffectPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Xamarin.CommunityToolkit.Effects;
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SafeAreaEffectPage
{
public SafeAreaEffectPage() => InitializeComponent();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using System;
using System.Collections.Generic;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SelectAllTextEffectPage
{
public SelectAllTextEffectPage() => InitializeComponent();
Expand Down
2 changes: 1 addition & 1 deletion samples/XCT.Sample/Pages/Effects/TouchEffectPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Windows.Input;
using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms.Xaml;
using Xamarin.Forms;

namespace Xamarin.CommunityToolkit.Sample.Pages.Effects
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class TouchEffectPage
{
public TouchEffectPage()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8" ?>
<pages:BasePage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
xmlns:pages="clr-namespace:Xamarin.CommunityToolkit.Sample.Pages"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.UseSafeArea="true"
x:Class="Xamarin.CommunityToolkit.Sample.Pages.TestCases.TouchEffectCollectionViewPage"
x:Name="Page">

<CollectionView x:Name="Collection"
SelectionMode="Multiple">
<CollectionView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>One</x:String>
<x:String>Two</x:String>
<x:String>Three</x:String>
<x:String>Four</x:String>
<x:String>Five</x:String>
<x:String>Six</x:String>
</x:Array>
</CollectionView.ItemsSource>
<CollectionView.ItemsLayout>
<GridItemsLayout
Orientation="Vertical"
Span="2"
HorizontalItemSpacing="8"
VerticalItemSpacing="8"/>
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame HeightRequest="120"
CornerRadius="0"
Padding="0"
HasShadow="True"
xct:TouchEffect.LongPressCommand="{Binding LongPressCommand, Source={x:Reference Page}}"
xct:TouchEffect.NativeAnimation="True">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter
TargetName="Label"
Property="Label.TextColor"
Value="Black"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter
TargetName="Label"
Property="Label.TextColor"
Value="Red"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Label x:Name="Label"
Text="{Binding .}"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"/>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>

</pages:BasePage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

using System.Windows.Input;
using Xamarin.Forms;

namespace Xamarin.CommunityToolkit.Sample.Pages.TestCases
{
public partial class TouchEffectCollectionViewPage
{
ICommand longPressCommand;

public TouchEffectCollectionViewPage()
=> InitializeComponent();

public ICommand LongPressCommand => longPressCommand ??= new Command(() =>
{
this.DisplayAlert("Long Press", null, "OK");
});
}
}
27 changes: 15 additions & 12 deletions samples/XCT.Sample/Pages/Views/SideMenuViewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,32 @@

<xct:SideMenuView x:Name="SideMenuView">
<!-- MainView -->
<StackLayout
Orientation="Horizontal"
BackgroundColor="Gold">
<StackLayout BackgroundColor="Gold">
<StackLayout
Orientation="Horizontal">

<Button Style="{StaticResource BaseMenuButtonStyle}"
Clicked="OnLeftButtonClicked" />
<Button Style="{StaticResource BaseMenuButtonStyle}"
Clicked="OnLeftButtonClicked" />

<Button Style="{StaticResource BaseMenuButtonStyle}"
HorizontalOptions="EndAndExpand"
Clicked="OnRightButtonClicked" />
<Button Style="{StaticResource BaseMenuButtonStyle}"
HorizontalOptions="EndAndExpand"
Clicked="OnRightButtonClicked" />

</StackLayout>
<Slider />
</StackLayout>

<!-- LeftMenu -->
<BoxView
BackgroundColor="Orange"
xct:SideMenuView.Position="LeftMenu"
xct:SideMenuView.MenuWidthPercentage=".5" />
xct:SideMenuView.MenuWidthPercentage=".5"
BackgroundColor="Orange"/>

<!-- RightMenu -->
<BoxView
BackgroundColor="LightGreen"
xct:SideMenuView.Position="RightMenu"
xct:SideMenuView.MenuWidthPercentage=".3" />
xct:SideMenuView.MenuWidthPercentage=".3"
BackgroundColor="LightGreen" />

</xct:SideMenuView>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ public class TestCasesGalleryViewModel : BaseGalleryViewModel
"TouchEffect + Button",
"TouchEffect must automatically invoke button'c command execution."),

new SectionModel(
typeof(TouchEffectCollectionViewPage),
"TouchEffect + CollectionView",
"Using TouchEffect's LongPress should allow still use items selection."),

new SectionModel(
typeof(MediaElementSourcePage),
"MediaElement with Source as string",
Expand Down
4 changes: 2 additions & 2 deletions samples/XCT.Sample/ViewModels/Views/ViewsGalleryViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ViewsGalleryViewModel : BaseGalleryViewModel
"The AvatarView represents a user's name by using the initials and a generated background color"),

new SectionModel(typeof(BadgeViewPage), "BadgeView",
"View used to used to notify users notifications, or status of something"),
"View used to notify users notifications, or status of something"),

new SectionModel(typeof(CameraViewPage), "CameraView",
"The CameraView allows you to show a live preview from the camera. You can take pictures, record videos and much more!"),
Expand Down Expand Up @@ -54,4 +54,4 @@ public class ViewsGalleryViewModel : BaseGalleryViewModel
"The popup control renders native popups from the shared code. This page demonstrates a variety of different techniques for displaying native popups.")
};
}
}
}
Loading

0 comments on commit 7e28228

Please sign in to comment.