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

Fix for Frame PanGestureRecognizer is not working in Android #25239

Closed
wants to merge 6 commits into from

Conversation

SuthiYuvaraj
Copy link
Contributor

@SuthiYuvaraj SuthiYuvaraj commented Oct 14, 2024

Root Cause

The touch events in the Frame control on the Android platform are not handled correctly. Specifically, in the FrameRenderer, the touch event handler consistently returns true, which suppresses the default behavior and prevents the expected response to touch interactions.

Description of Change

The MotionEventHelper class contains a method called ShouldPassThroughElement(), which is designed to evaluate whether a touch event should be passed through an element. Utilizing this method will ensure correct touch handling, thereby resolving the issue

Issues Fixed

Fixes #16978

Output Video

Before Issue Fix After Issue Fix
Frame.pan.not.working.mp4
Frame.pan.working.mp4

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Oct 14, 2024

/azp run

This comment was marked as outdated.

@SuthiYuvaraj SuthiYuvaraj marked this pull request as ready for review October 16, 2024 09:26
@SuthiYuvaraj SuthiYuvaraj requested a review from a team as a code owner October 16, 2024 09:26

This comment was marked as outdated.

2 similar comments

This comment was marked as outdated.

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@@ -23,7 +23,8 @@ public bool HandleMotionEvent(IViewParent parent, MotionEvent motionEvent)
return false;
}

return true;
// We should consider the InputTransparent for the VisualElement and decides to pass touch to the event
return ShouldPassThroughElement();
Copy link
Contributor

Choose a reason for hiding this comment

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

I want to do more tests locally but ideally...

This implementation should be the same as the one in the Compatibility layer

public bool HandleMotionEvent(IViewParent parent, MotionEvent motionEvent)

In cases like the Frame, the missing part is the NotifyFakeHandling that impact in the behavior of the DispatchTouchEvent method from an y View.

if (result && NotReallyHandled)

@PureWeen PureWeen added this to the .NET 9 Servicing milestone Oct 31, 2024
@dotnet dotnet deleted a comment from azure-pipelines bot Nov 11, 2024
@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
@jfversluis
Copy link
Member

Since Frame is now officially deprecated lets not spend too much time on this. Closing for now.

@jfversluis jfversluis closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-gestures Gesture types community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android 🤖
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

PanGestureRecognizer is not working in Android
5 participants