Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwipeGestureRecognizer #2727

Merged
merged 13 commits into from May 28, 2018

Conversation

Projects
9 participants
@seanyda
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

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);

This comment has been minimized.

Copy link
@samhouts

samhouts May 16, 2018

Member

Maybe a merge error? Causing build to fail.

meant to dismiss

@samhouts

This comment has been minimized.

Copy link
Member

commented May 18, 2018

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

@seanyda

This comment has been minimized.

Copy link
Contributor Author

commented May 23, 2018

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

@rmarinho

This comment has been minimized.

Copy link
Member

commented May 23, 2018

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

@SuEric

This comment has been minimized.

Copy link

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 😅

@rmarinho
Copy link
Member

left a comment

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">

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

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>

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

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">

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

not sure we need to add this

seanyda added some commits May 24, 2018

@rmarinho
Copy link
Member

left a comment

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">

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

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" />

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

this asset is also not needed i think

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

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

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"?>

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

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"?>

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

no changes, don't submit

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

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

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));

This comment has been minimized.

Copy link
@rmarinho

rmarinho May 24, 2018

Member

missing space, not important

seanyda added some commits May 24, 2018

@rmarinho rmarinho merged commit 67f87df into xamarin:master May 28, 2018

10 of 13 checks passed

VSTS: Android API23 Validation Fast Renderers UITests Finished
Details
VSTS: iOS10 Validation UITests Finished
Details
VSTS: iOS11 Validation UITests Finished
Details
VSTS: Android API19 Validation Fast Renderers UITests Finished
Details
VSTS: Android API19 Validation Legacy Renderers UITests Finished
Details
VSTS: Android API23 Validation Legacy Renderers UITests Finished
Details
VSTS: Android API25 Validation Fast Renderers UITests Finished
Details
VSTS: Android API25 Validation Legacy Renderers UITests Finished
Details
VSTS: Xamarin Forms (PR Builds) PR-2727 - (1720088) succeeded
Details
VSTS: Xamarin Forms OSX PR-2727 - (1720096) succeeded
Details
VSTS: Xamarin Forms Windows VS2017 PR-2727 - (1720089) succeeded
Details
VSTS: iOS9 Validation UITests Finished
Details
license/cla All CLA requirements met.
Details

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 referenced this pull request Jul 18, 2018

Closed

SwipeGestureRecognizer #880

4 of 4 tasks complete

@samhouts samhouts modified the milestone: 3.2.0 Sep 12, 2018

@velocitysystems

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2018

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

@agusibrahim

This comment has been minimized.

Copy link

commented Sep 22, 2018

thnx for this update, i love xamarin

@CaLxCyMru

This comment has been minimized.

Copy link

commented Sep 25, 2018

Awesome addition @seanyda! 👍

@remmettaro

This comment has been minimized.

Copy link

commented Sep 26, 2018

We love you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.