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

SwipeGestureRecognizer #2727

Merged
merged 13 commits into from May 28, 2018
Merged

SwipeGestureRecognizer #2727

merged 13 commits into from May 28, 2018

Conversation

seanyda
Copy link
Contributor

@seanyda seanyda commented May 15, 2018

Description of Change

Added a SwipeGestureRecognizer to Xamarin.Forms which works on iOS, Android, Windows and Tizen.

API Changes

Xamarin.Forms.Core

  • SwipeEventArgs.cs
  • SwipeGestureRecognizer.cs
  • SwipeDirection.cs
  • ISwipeGestureController.cs

Xamarin.Forms.Platform.iOS

  • EventTracker.cs

Xamarin.Forms.Platform.Android

  • GestureManager.cs
  • InnerGestureListener.cs
  • SwipeGestureHandler.cs

Xamarin.Forms.Platform.UAP

  • VisualElementTracker.cs

Xamarin.Forms.Platform.Tizen

  • GestureDetector.cs
  • SwipeGestureHandler.cs

Testing

  • SwipeGestureGalleryPage.cs
  • SwipeGestureRecognizerTests.cs

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense

Previous PR: #1330

@seanyda seanyda changed the title SwipeGesture SwipeGestureRecognizer May 15, 2018
@seanyda
Copy link
Contributor Author

seanyda commented May 15, 2018

Hi All,

I had to make new PR for rebase. @samhouts @rmarinho @StephaneDelcroix

Thanks.

@samhouts samhouts added this to In Review in v3.6.0 May 16, 2018
@@ -197,13 +210,15 @@ bool StartScrolling(MotionEvent e2)
float totalX = e2.GetX() - _lastX;
float totalY = e2.GetY() - _lastY;

return _scrollDelegate(totalX, totalY, e2.PointerCount);
return _scrollDelegate(totalX, totalY, e2.PointerCount) || || _swipeDelegate(totalX, totalY);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a merge error? Causing build to fail.

samhouts
samhouts previously approved these changes May 18, 2018
@samhouts samhouts dismissed their stale review May 18, 2018 01:30

meant to dismiss

@samhouts
Copy link
Member

New error! Error CS0169: The field 'GestureManager._tapAndPanDetector' is never used

@xamarin-release-manager xamarin-release-manager added the API-change Heads-up to reviewers that this PR may contain an API change label May 21, 2018
@seanyda
Copy link
Contributor Author

seanyda commented May 23, 2018

@samhouts What's making the iOS10 Validation fail? I'll fix it.

@rmarinho
Copy link
Member

@seanyda we can ignore that failure, is not related.

@SuEric
Copy link

SuEric commented May 23, 2018

Amazing work!

Looking forward to have this on my apps! :D

@rmarinho ,
Any plans of releasing this soon? Or for what version will this be released?
I've an upcoming delivery 😅

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have some changes on the csproj I think we can avoid

@@ -43,67 +43,7 @@
<Compile Update="GalleryPages\VisualStateManagerGalleries\OnPlatformExample.xaml.cs">
<DependentUpon>OnPlatformExample.xaml</DependentUpon>
</Compile>
<EmbeddedResource Update="GalleryPages\VisualStateManagerGalleries\ButtonDisabledStatesGallery.xaml">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we dropping these files?

@@ -207,7 +208,7 @@
<Name>Xamarin.Forms.Maps</Name>
</ProjectReference>
<ProjectReference Include="..\Xamarin.Forms.Platform\Xamarin.Forms.Platform.csproj">
<Project>{67f9d3a8-f71e-4428-913f-c37ae82cdb24}</Project>
<Project>{D31A6537-ED9C-4EBD-B231-A8D4FE44126A}</Project>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure we need this

@@ -111,6 +112,15 @@
<Reference Include="Xamarin.Android.Support.v7.MediaRouter">
<HintPath>..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.dll</HintPath>
</Reference>
<Reference Include="Xamarin.GooglePlayServices.Base">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure we need to add this

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry a couple of small changes to make the pr cleaner. Also do you think is possible to add a UITest ? it will make us more confidant that this Works in the future.

Thanks

@@ -250,6 +252,10 @@
<AndroidResource Include="Resources\drawable\cover1.jpg" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PagesGallery\PagesGallery.Droid\PagesGallery.Droid.csproj">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have this reference ? please try to add the changes needed , it's hard because the IDE plays tricks on you

@@ -346,6 +352,9 @@
<ItemGroup>
<AndroidResource Include="Resources\drawable\red_button.xml" />
</ItemGroup>
<ItemGroup>
<AndroidAsset Include="Assets\test.jpg" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this asset is also not needed i think

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no changes here, please try cleanup and not submit this file

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, no changes, don't submit this file.

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no changes, don't submit

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@@ -129,7 +129,8 @@ GestureDetector InitializeTapAndPanDetector()

return new List<GestureElement>();
}),
new PanGestureHandler(() => View, context.FromPixels));
new PanGestureHandler(() => View, context.FromPixels),
new SwipeGestureHandler(() => View, context.FromPixels));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing space, not important

@xamarin-release-manager xamarin-release-manager added the API-change Heads-up to reviewers that this PR may contain an API change label May 25, 2018
@rmarinho rmarinho merged commit 67f87df into xamarin:master May 28, 2018
v3.6.0 automation moved this from In Review to Done May 28, 2018
@samhouts samhouts added this to the 3.2.0 milestone Jun 26, 2018
@samhouts samhouts removed this from Done in v3.6.0 Jun 26, 2018
@samhouts samhouts added this to Done in v3.2.0 Jun 26, 2018
@seanyda seanyda mentioned this pull request Jul 18, 2018
4 tasks
@samhouts samhouts modified the milestone: 3.2.0 Sep 12, 2018
@velocitysystems
Copy link
Contributor

@seanyda Congrats! This finally made it into XF 3.2.0. 👍

@agusibrahim
Copy link

thnx for this update, i love xamarin

@CaLxCyMru
Copy link

Awesome addition @seanyda! 👍

@remmettaro
Copy link

We love you so much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API-change Heads-up to reviewers that this PR may contain an API change t/enhancement ➕
Projects
No open projects
v3.2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

9 participants