From d4352d9a6004290240db05dad6312c77090d1f06 Mon Sep 17 00:00:00 2001 From: TamilarasanSF4853 Date: Mon, 23 Feb 2026 19:25:31 +0530 Subject: [PATCH] Revert "[Android] Fixed PointerGestureRecognizer not triggering PointerMoved event (#33889)" This reverts commit 4aa6b81c4148fbd48838f3a451f975d0c2cfdc63. --- .../Android/TapAndPanGestureDetector.cs | 2 +- .../TestCases.HostApp/Issues/Issue33690.cs | 91 ------------------- .../Tests/Issues/Issue33690.cs | 41 --------- 3 files changed, 1 insertion(+), 133 deletions(-) delete mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue33690.cs delete mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33690.cs diff --git a/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs b/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs index f9a1d601a49e..03bb05bc1fbc 100644 --- a/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs +++ b/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs @@ -44,7 +44,7 @@ public override bool OnTouchEvent(MotionEvent ev) return true; if (_pointerGestureHandler != null && ev?.Action is - MotionEventActions.Up or MotionEventActions.Down or MotionEventActions.Move or MotionEventActions.Cancel) + MotionEventActions.Up or MotionEventActions.Down or MotionEventActions.Cancel) { _pointerGestureHandler.OnTouch(ev); } diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue33690.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue33690.cs deleted file mode 100644 index cb732cba4ebd..000000000000 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue33690.cs +++ /dev/null @@ -1,91 +0,0 @@ -namespace Maui.Controls.Sample.Issues; - -[Issue(IssueTracker.Github, 33690, "PointerGestureRecognizer does not fire off PointerMove event on Android", PlatformAffected.Android)] -public class Issue33690 : ContentPage -{ - Label pointerPressedLabel; - Label pointerMovedLabel; - Label pointerReleasedLabel; - int pressedCount = 0; - int movedCount = 0; - int releasedCount = 0; - - public Issue33690() - { - InitializeUI(); - } - - private void InitializeUI() - { - var stackLayout = new VerticalStackLayout - { - Spacing = 10, - Padding = 10 - }; - - var instructionLabel = new Label - { - Text = "Tap and drag on the image below. All three event counters should increment.", - AutomationId = "InstructionLabel" - }; - - pointerPressedLabel = new Label - { - Text = $"Pointer Pressed: {pressedCount}", - AutomationId = "PointerPressedLabel" - }; - - pointerMovedLabel = new Label - { - Text = $"Pointer Moved: {movedCount}", - AutomationId = "PointerMovedLabel" - }; - - pointerReleasedLabel = new Label - { - Text = $"Pointer Released: {releasedCount}", - AutomationId = "PointerReleasedLabel" - }; - - var testImage = new Image - { - Source = "dotnet_bot.png", - WidthRequest = 300, - HeightRequest = 300, - BackgroundColor = Colors.LightGray, - AutomationId = "TestImage" - }; - - var pointerGestureRecognizer = new PointerGestureRecognizer(); - pointerGestureRecognizer.PointerPressed += OnPointerPressed; - pointerGestureRecognizer.PointerMoved += OnPointerMoved; - pointerGestureRecognizer.PointerReleased += OnPointerReleased; - testImage.GestureRecognizers.Add(pointerGestureRecognizer); - - stackLayout.Children.Add(instructionLabel); - stackLayout.Children.Add(pointerPressedLabel); - stackLayout.Children.Add(pointerMovedLabel); - stackLayout.Children.Add(pointerReleasedLabel); - stackLayout.Children.Add(testImage); - - Content = stackLayout; - } - - private void OnPointerPressed(object sender, PointerEventArgs e) - { - pressedCount++; - pointerPressedLabel.Text = $"Pointer Pressed: {pressedCount}"; - } - - private void OnPointerMoved(object sender, PointerEventArgs e) - { - movedCount++; - pointerMovedLabel.Text = $"Pointer Moved: {movedCount}"; - } - - private void OnPointerReleased(object sender, PointerEventArgs e) - { - releasedCount++; - pointerReleasedLabel.Text = $"Pointer Released: {releasedCount}"; - } -} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33690.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33690.cs deleted file mode 100644 index 771efa18d592..000000000000 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33690.cs +++ /dev/null @@ -1,41 +0,0 @@ -using NUnit.Framework; -using UITest.Appium; -using UITest.Core; - -namespace Microsoft.Maui.TestCases.Tests.Issues; - -public class Issue33690 : _IssuesUITest -{ - public Issue33690(TestDevice device) : base(device) { } - - public override string Issue => "PointerGestureRecognizer does not fire off PointerMove event on Android"; - - [Test] - [Category(UITestCategories.Gestures)] - public void PointerMovedEventShouldFireOnAndroid() - { - App.WaitForElement("TestImage"); - var pressedLabel = App.FindElement("PointerPressedLabel"); - var movedLabel = App.FindElement("PointerMovedLabel"); - var releasedLabel = App.FindElement("PointerReleasedLabel"); - Assert.That(pressedLabel.GetText(), Is.EqualTo("Pointer Pressed: 0")); - Assert.That(movedLabel.GetText(), Is.EqualTo("Pointer Moved: 0")); - Assert.That(releasedLabel.GetText(), Is.EqualTo("Pointer Released: 0")); - var imageRect = App.WaitForElement("TestImage").GetRect(); - var startX = imageRect.X + (imageRect.Width / 4); - var startY = imageRect.Y + (imageRect.Height / 4); - var endX = imageRect.X + (imageRect.Width * 3 / 4); - var endY = imageRect.Y + (imageRect.Height * 3 / 4); - - App.DragCoordinates(startX, startY, endX, endY); - pressedLabel = App.FindElement("PointerPressedLabel"); - movedLabel = App.FindElement("PointerMovedLabel"); - releasedLabel = App.FindElement("PointerReleasedLabel"); - Assert.That(pressedLabel.GetText(), Does.Not.EqualTo("Pointer Pressed: 0"), - "PointerPressed event should have fired"); - Assert.That(movedLabel.GetText(), Does.Not.EqualTo("Pointer Moved: 0"), - "PointerMoved event should have fired"); - Assert.That(releasedLabel.GetText(), Does.Not.EqualTo("Pointer Released: 0"), - "PointerReleased event should have fired"); - } -}