From 30a09b0bdb4f30eabfc80465a6f85635d01d7414 Mon Sep 17 00:00:00 2001 From: KarthikRajaKalaimani <92777139+KarthikRajaKalaimani@users.noreply.github.com> Date: Tue, 3 Feb 2026 17:17:20 +0530 Subject: [PATCH 1/2] Fixed PointerGestureRecognizer does not fire off PointerMove event on Android --- .../src/Core/Platform/Android/TapAndPanGestureDetector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs b/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs index 03bb05bc1fbc..f9a1d601a49e 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.Cancel) + MotionEventActions.Up or MotionEventActions.Down or MotionEventActions.Move or MotionEventActions.Cancel) { _pointerGestureHandler.OnTouch(ev); } From 5bf19ab8e7f464d8077e6fc295bde9c4a74aed30 Mon Sep 17 00:00:00 2001 From: KarthikRajaKalaimani <92777139+KarthikRajaKalaimani@users.noreply.github.com> Date: Tue, 3 Feb 2026 18:48:26 +0530 Subject: [PATCH 2/2] Included test cases --- .../TestCases.HostApp/Issues/Issue33690.cs | 91 +++++++++++++++++++ .../Tests/Issues/Issue33690.cs | 41 +++++++++ 2 files changed, 132 insertions(+) create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue33690.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33690.cs diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue33690.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue33690.cs new file mode 100644 index 000000000000..cb732cba4ebd --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue33690.cs @@ -0,0 +1,91 @@ +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 new file mode 100644 index 000000000000..771efa18d592 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33690.cs @@ -0,0 +1,41 @@ +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"); + } +}