Skip to content

[Android] Fix CollectionView selection not triggering when PointerGestureRecognizer is used in ItemTemplate#34627

Open
jpd21122012 wants to merge 12 commits into
dotnet:mainfrom
jpd21122012:fix/34491-Android-CollectionView-ItemSelectionNotTriggeredWhenPointerGestureRecognizer
Open

[Android] Fix CollectionView selection not triggering when PointerGestureRecognizer is used in ItemTemplate#34627
jpd21122012 wants to merge 12 commits into
dotnet:mainfrom
jpd21122012:fix/34491-Android-CollectionView-ItemSelectionNotTriggeredWhenPointerGestureRecognizer

Conversation

@jpd21122012
Copy link
Copy Markdown
Contributor

Description

Fixes #34491

On Android, when a PointerGestureRecognizer is added inside a CollectionView ItemTemplate, tapping an item does not trigger SelectionChanged.

This happens because touch events were being consumed by the gesture pipeline even when only pointer gestures were present, preventing the CollectionView from receiving the tap event.

Root Cause

GesturePlatformManager was consuming touch events regardless of gesture type.
Since PointerGestureRecognizer is intended for hover/move scenarios and not for tap interaction, it should not block touch propagation.

Fix

  • Updated GesturePlatformManager.OnTouchEvent
  • Detect when only PointerGestureRecognizer instances are present
  • Avoid consuming touch events in that case

This allows touch events to propagate correctly to parent controls like CollectionView.

Result

  • PointerGestureRecognizer continues to work as expected (hover events)
  • CollectionView selection works correctly
  • Both behaviors now coexist without conflict

Test

Added UITest (Issue34491) that:

  • Uses a CollectionView with PointerGestureRecognizer inside the ItemTemplate
  • Taps an item
  • Verifies that SelectionChanged is triggered via UI update

The test fails before this fix and passes after.

Affected Platforms

  • Android

Notes

This change is scoped to pointer-only gesture scenarios and does not affect existing gesture handling behavior for tap, pan, or swipe gestures.

…tureRecognizer

Prevent touch events from being consumed when only PointerGestureRecognizer instances are present in a view.

Previously, GesturePlatformManager would consume touch input even in pointer-only scenarios, blocking CollectionView from receiving tap events and triggering SelectionChanged.

This change ensures that touch events are not consumed when only pointer gestures are attached, allowing proper event propagation while preserving pointer (hover) behavior.

Also adds UITest (Issue34491) to validate that CollectionView selection works correctly when PointerGestureRecognizer is used inside ItemTemplate.
Copilot AI review requested due to automatic review settings March 24, 2026 21:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 24, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 34627

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 34627"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes an Android-specific interaction regression where CollectionView item selection doesn’t fire when a PointerGestureRecognizer exists inside an ItemTemplate, by preventing pointer-only gesture handling from consuming touch events that should propagate to parent controls.

Changes:

  • Updated Android GesturePlatformManager.OnTouchEvent to avoid consuming touch events when the view has only PointerGestureRecognizer instances.
  • Added a HostApp reproduction page (Issue34491) using a CollectionView item template with a PointerGestureRecognizer.
  • Added an Android UITest (Issue34491) validating selection still occurs in that scenario.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs Adjusts Android gesture consumption logic to let CollectionView selection taps propagate when only pointer gestures are present.
src/Controls/tests/TestCases.HostApp/Issues/Issue34491.cs Adds a minimal in-app repro using CollectionView + PointerGestureRecognizer in ItemTemplate.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs Adds an Android UI test asserting SelectionChanged updates UI state when tapping an item.

Comment thread src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs Outdated
Comment thread src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs Outdated
…ynchronization

Replace polling with Thread.Sleep by a retry loop synchronized with WaitForElement,
ensuring the test remains deterministic and aligned with UITest patterns.
@MauiBot MauiBot added s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Mar 26, 2026
@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR and removed s/agent-approved AI agent recommends approval - PR fix is correct and optimal s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates labels Apr 3, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 17, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 17, 2026
@dotnet dotnet deleted a comment from MauiBot Apr 22, 2026
@dotnet dotnet deleted a comment from MauiBot May 3, 2026
Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

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

Expert Review — 7 findings

See inline comments for details.

Comment thread src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs Outdated
Comment thread src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs Outdated
Comment thread src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs Outdated
Comment thread src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs Outdated
Comment thread src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs Outdated
Comment thread src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs Outdated
Comment thread src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs Outdated
@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR labels May 3, 2026
@dotnet dotnet deleted a comment from MauiBot May 6, 2026
@kubaflo kubaflo dismissed MauiBot’s stale review May 6, 2026 09:49

Resetting for re-review

MauiBot
MauiBot previously requested changes May 6, 2026
Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

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

🤖 Automated review — alternative fix proposed

The expert-reviewer evaluation compared the PR fix against #3 automatically generated candidates and selected try-fix-3 as the strongest fix.

Why: Try-fix-3 wins: it gates event consumption in TapAndPanGestureDetector on baseHandled, preserving both PointerPressed/Released/Moved delivery and CollectionView selection — addressing the code reviewer's critical finding that the PR severs the touch-based pointer event pipeline. All 4 try-fix candidates passed; try-fix-3 is the simplest (minimal one-line change in TapAndPanGestureDetector) and also adds comprehensive regression test coverage for PointerPressed and mixed Tap+Pointer scenarios. The PR fix failed Gate and introduces a PointerPressed regression invisible to CI.

Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.

Candidate diff (`try-fix-3`)
diff --git a/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs b/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs
index 5aa602ac6d..7415baf40a 100644
--- a/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs
+++ b/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs
@@ -42,18 +42,20 @@ namespace Microsoft.Maui.Controls.Platform
 		{
 			bool baseHandled = base.OnTouchEvent(ev);
 
-			bool pointerHandled = false;
+			bool shouldConsumeForPointer = false;
 			if (_pointerGestureHandler != null && ev?.Action is
 				MotionEventActions.Up or MotionEventActions.Down or MotionEventActions.Move or MotionEventActions.Cancel)
 			{
 				_pointerGestureHandler.OnTouch(ev);
-				pointerHandled = _pointerGestureHandler.HasAnyPointerGestures();
+				// Pointer events are still delivered via OnTouch above; this flag controls consumption only.
+				// For pointer-only views, baseHandled is false so touch can continue to parent click/selection handlers.
+				shouldConsumeForPointer = _pointerGestureHandler.HasAnyPointerGestures() && baseHandled;
 			}
 
 			if (_listener != null && ev?.Action == MotionEventActions.Up)
 				_listener.EndScrolling();
 
-			return baseHandled || pointerHandled;
+			return baseHandled || shouldConsumeForPointer;
 		}
 
 		protected override void Dispose(bool disposing)
diff --git a/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs b/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs
index 60fb1ab760..2aae4347df 100644
--- a/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs
+++ b/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs
@@ -198,8 +198,9 @@ namespace Microsoft.Maui.Controls.Platform
 			// https://github.com/dotnet/maui/commit/2c301d7988a06c3b41c2992bbee557aca04c9388#diff-2d78f02242798d0f2863f679e4dfdee230944be37db5e1a1446bfa4c6c43a5c6R183
 			// If the only CompositeGestureRecognizers is a PointerGestureRecognizer
 			//
-			// Most likely we should just not subscribe to Touch at all if the only gesture is a PGR
-			// But that will be re-evaluated for preview6
+			// Pointer-only views still subscribe here so pointer events continue flowing.
+			// Event-consumption mitigation for CollectionView item selection is handled in
+			// TapAndPanGestureDetector.OnTouchEvent.
 			if (View.GestureRecognizers.Count == 0)
 			{
 				var recognizers = View.GestureController.CompositeGestureRecognizers;
diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue34491.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue34491.cs
index 3d358ca029..05da5567e1 100644
--- a/src/Controls/tests/TestCases.HostApp/Issues/Issue34491.cs
+++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue34491.cs
@@ -5,7 +5,7 @@ public class Issue34491 : ContentPage
 {
 	public Issue34491()
 	{
-		var statusLabel = new Label
+		var pointerOnlySelectionStatusLabel = new Label
 		{
 			Text = "No Selection",
 			AutomationId = "StatusLabel",
@@ -13,7 +13,15 @@ public class Issue34491 : ContentPage
 			FontSize = 18
 		};
 
-		var collectionView = new CollectionView
+		var pointerStatusLabel = new Label
+		{
+			Text = "No Pointer Events",
+			AutomationId = "PointerStatusLabel",
+			Padding = new Thickness(10),
+			FontSize = 16
+		};
+
+		var pointerOnlyCollectionView = new CollectionView
 		{
 			AutomationId = "TestCollectionView",
 			SelectionMode = SelectionMode.Single,
@@ -37,19 +45,79 @@ public class Issue34491 : ContentPage
 				};
 
 				var pointerGesture = new PointerGestureRecognizer();
-				pointerGesture.PointerEntered += (s, e) => { };
-				pointerGesture.PointerExited += (s, e) => { };
+				pointerGesture.PointerPressed += (s, e) => pointerStatusLabel.Text = $"Pointer Pressed: {grid.BindingContext}";
+				pointerGesture.PointerReleased += (s, e) => pointerStatusLabel.Text = $"Pointer Released: {grid.BindingContext}";
+				grid.GestureRecognizers.Add(pointerGesture);
+
+				return grid;
+			})
+		};
+
+		pointerOnlyCollectionView.SelectionChanged += (s, e) =>
+		{
+			if (e.CurrentSelection.Count > 0)
+			{
+				pointerOnlySelectionStatusLabel.Text = $"Selected: {e.CurrentSelection[0]}";
+			}
+		};
+
+		var mixedSelectionStatusLabel = new Label
+		{
+			Text = "No Mixed Selection",
+			AutomationId = "MixedSelectionStatusLabel",
+			Padding = new Thickness(10),
+			FontSize = 18
+		};
+
+		var mixedTapStatusLabel = new Label
+		{
+			Text = "No Mixed Tap",
+			AutomationId = "MixedTapStatusLabel",
+			Padding = new Thickness(10),
+			FontSize = 16
+		};
+
+		var mixedCollectionView = new CollectionView
+		{
+			AutomationId = "MixedTestCollectionView",
+			SelectionMode = SelectionMode.Single,
+			ItemsSource = new List<string> { "Mixed Item 1", "Mixed Item 2", "Mixed Item 3" },
+			ItemTemplate = new DataTemplate(() =>
+			{
+				var label = new Label
+				{
+					Padding = new Thickness(10),
+					FontSize = 16
+				};
+				label.SetBinding(Label.TextProperty, ".");
+				label.SetBinding(Label.AutomationIdProperty, ".");
+
+				var grid = new Grid
+				{
+					BackgroundColor = Colors.LightBlue,
+					Padding = new Thickness(10),
+					HeightRequest = 50,
+					Children = { label }
+				};
+
+				var pointerGesture = new PointerGestureRecognizer();
+				pointerGesture.PointerPressed += (s, e) => pointerStatusLabel.Text = $"Pointer Pressed: {grid.BindingContext}";
+				pointerGesture.PointerReleased += (s, e) => pointerStatusLabel.Text = $"Pointer Released: {grid.BindingContext}";
 				grid.GestureRecognizers.Add(pointerGesture);
 
+				var tapGesture = new TapGestureRecognizer();
+				tapGesture.Tapped += (s, e) => mixedTapStatusLabel.Text = $"Tapped: {grid.BindingContext}";
+				grid.GestureRecognizers.Add(tapGesture);
+
 				return grid;
 			})
 		};
 
-		collectionView.SelectionChanged += (s, e) =>
+		mixedCollectionView.SelectionChanged += (s, e) =>
 		{
 			if (e.CurrentSelection.Count > 0)
 			{
-				statusLabel.Text = $"Selected: {e.CurrentSelection[0]}";
+				mixedSelectionStatusLabel.Text = $"Mixed Selected: {e.CurrentSelection[0]}";
 			}
 		};
 
@@ -57,7 +125,15 @@ public class Issue34491 : ContentPage
 		{
 			Padding = new Thickness(10),
 			Spacing = 10,
-			Children = { statusLabel, collectionView }
+			Children =
+			{
+				pointerOnlySelectionStatusLabel,
+				pointerStatusLabel,
+				pointerOnlyCollectionView,
+				mixedSelectionStatusLabel,
+				mixedTapStatusLabel,
+				mixedCollectionView
+			}
 		};
 	}
 }
diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs
index 03f5578a83..2116b700eb 100644
--- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs
+++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs
@@ -35,5 +35,47 @@ public class Issue34491 : _IssuesUITest
 		Assert.That(finalText, Is.EqualTo("Selected: Item 1"),
 			"SelectionChanged should fire when tapping a CollectionView item that has a PointerGestureRecognizer");
 	}
+
+	[Test]
+	[Category(UITestCategories.CollectionView)]
+	public void PointerPressedAndReleasedStillFire()
+	{
+		App.WaitForElement("PointerStatusLabel");
+
+		var initialText = App.FindElement("PointerStatusLabel").GetText() ?? string.Empty;
+		Assert.That(initialText, Is.EqualTo("No Pointer Events"));
+
+		App.WaitForElement("Item 1");
+		App.Tap("Item 1");
+
+		App.WaitForTextToBePresentInElement("PointerStatusLabel", "Pointer Released: Item 1");
+
+		var finalText = App.FindElement("PointerStatusLabel").GetText() ?? string.Empty;
+		Assert.That(finalText, Is.EqualTo("Pointer Released: Item 1"),
+			"PointerPressed/PointerReleased should still fire for pointer-only item templates.");
+	}
+
+	[Test]
+	[Category(UITestCategories.CollectionView)]
+	public void MixedTapAndPointerGesturesStillAllowSelectionAndTap()
+	{
+		App.WaitForElement("MixedTestCollectionView");
+		App.WaitForElement("MixedSelectionStatusLabel");
+		App.WaitForElement("MixedTapStatusLabel");
+
+		App.WaitForElement("Mixed Item 1");
+		App.Tap("Mixed Item 1");
+
+		App.WaitForTextToBePresentInElement("MixedSelectionStatusLabel", "Mixed Selected: Mixed Item 1");
+		App.WaitForTextToBePresentInElement("MixedTapStatusLabel", "Tapped: Mixed Item 1");
+
+		var mixedSelectionText = App.FindElement("MixedSelectionStatusLabel").GetText() ?? string.Empty;
+		var mixedTapText = App.FindElement("MixedTapStatusLabel").GetText() ?? string.Empty;
+
+		Assert.That(mixedSelectionText, Is.EqualTo("Mixed Selected: Mixed Item 1"),
+			"SelectionChanged should still fire when tap and pointer gestures are both present.");
+		Assert.That(mixedTapText, Is.EqualTo("Tapped: Mixed Item 1"),
+			"TapGestureRecognizer should still fire when pointer gestures are also present.");
+	}
 }
 #endif

…droid

Gate pointer event consumption behind baseHandled in TapAndPanGestureDetector
to avoid prematurely consuming touch events and breaking the Android event pipeline.

This ensures:
- PointerPressed and PointerReleased events continue to fire
- CollectionView item selection works correctly with PointerGestureRecognizer
- Mixed gesture scenarios (Tap + Pointer) behave as expected

Adds regression UI tests covering:
- CollectionView selection with PointerGestureRecognizer
- PointerPressed/PointerReleased events
- Mixed Tap and Pointer gesture scenarios
@jpd21122012
Copy link
Copy Markdown
Contributor Author

🤖 Automated review — alternative fix proposed

The expert-reviewer evaluation compared the PR fix against #3 automatically generated candidates and selected try-fix-3 as the strongest fix.

Why: Try-fix-3 wins: it gates event consumption in TapAndPanGestureDetector on baseHandled, preserving both PointerPressed/Released/Moved delivery and CollectionView selection — addressing the code reviewer's critical finding that the PR severs the touch-based pointer event pipeline. All 4 try-fix candidates passed; try-fix-3 is the simplest (minimal one-line change in TapAndPanGestureDetector) and also adds comprehensive regression test coverage for PointerPressed and mixed Tap+Pointer scenarios. The PR fix failed Gate and introduces a PointerPressed regression invisible to CI.

Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.

Candidate diff (try-fix-3)

Thanks for the detailed analysis.

You’re right — the previous implementation was consuming touch events too aggressively, which broke the pointer event pipeline and prevented proper bubbling to parent handlers (e.g., CollectionView selection).

I’ve updated the implementation in TapAndPanGestureDetector to gate pointer event consumption behind baseHandled. Pointer events are still delivered via OnTouch, but the event is only consumed when the base detector has already handled it. This preserves the expected Android touch flow.

Additionally, I’ve expanded the test coverage to include:

  • PointerPressed / PointerReleased validation
  • Mixed gesture scenarios (Tap + Pointer + Selection)

This ensures both pointer events and CollectionView selection behave correctly without regressions.

Please let me know if you'd like any additional adjustments.

@dotnet dotnet deleted a comment from MauiBot May 6, 2026
@kubaflo kubaflo dismissed MauiBot’s stale review May 6, 2026 20:49

Resetting for re-review

Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

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

🤖 Automated review — alternative fix proposed

The expert-reviewer evaluation compared the PR fix against #3 automatically generated candidates and selected try-fix-3 as the strongest fix.

Why: Try-fix-3 wins: it fixes the root cause directly (return baseHandled from TapAndPanGestureDetector, eliminating unconditional event consumption) AND unifies SetupGestures to subscribe for all recognizer-equipped views via CompositeGestureRecognizers.Count, eliminating the asymmetric Count==0 branch that missed direct PGR additions. Unlike the PR's fix, it preserves touch subscription so PointerPressed/Released still fire for finger touch. All 4 try-fix candidates were Blocked (no device), but try-fix-3 has the strongest design: 0 self-review findings, 2 files, and directly addresses both bugs the code review identified.

Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.

Candidate diff (`try-fix-3`)
diff --git a/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs b/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs
index 5aa602ac6d..c407a91da7 100644
--- a/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs
+++ b/src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs
@@ -42,18 +42,18 @@ namespace Microsoft.Maui.Controls.Platform
 		{
 			bool baseHandled = base.OnTouchEvent(ev);
 
-			bool pointerHandled = false;
 			if (_pointerGestureHandler != null && ev?.Action is
 				MotionEventActions.Up or MotionEventActions.Down or MotionEventActions.Move or MotionEventActions.Cancel)
 			{
 				_pointerGestureHandler.OnTouch(ev);
-				pointerHandled = _pointerGestureHandler.HasAnyPointerGestures();
+				// Pointer gestures do not consume touch events — only return true if the base
+				// gesture detector handled the event (e.g., tap, pan, swipe recognized).
 			}
 
 			if (_listener != null && ev?.Action == MotionEventActions.Up)
 				_listener.EndScrolling();
 
-			return baseHandled || pointerHandled;
+			return baseHandled;
 		}
 
 		protected override void Dispose(bool disposing)
diff --git a/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs b/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs
index 60fb1ab760..08ef6109a0 100644
--- a/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs
+++ b/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs
@@ -192,32 +192,18 @@ namespace Microsoft.Maui.Controls.Platform
 
 			bool shouldAddTouchEvent = false;
 
-			// This change is probably not 100 percent correct.
-			// The main purpose right now is to maintain the behavior of this code
-			// prior to this change
-			// https://github.com/dotnet/maui/commit/2c301d7988a06c3b41c2992bbee557aca04c9388#diff-2d78f02242798d0f2863f679e4dfdee230944be37db5e1a1446bfa4c6c43a5c6R183
-			// If the only CompositeGestureRecognizers is a PointerGestureRecognizer
-			//
-			// Most likely we should just not subscribe to Touch at all if the only gesture is a PGR
-			// But that will be re-evaluated for preview6
-			if (View.GestureRecognizers.Count == 0)
-			{
-				var recognizers = View.GestureController.CompositeGestureRecognizers;
-				foreach (var recognizer in recognizers)
-				{
-					if (recognizer is not PointerGestureRecognizer)
-					{
-						shouldAddTouchEvent = true;
-						break;
-					}
-				}
-			}
-			else
+			// Subscribe to touch if any gesture recognizer (composite or direct) is present.
+			// We subscribe even for PointerGestureRecognizer-only views so PointerPressed/Released
+			// still fire for finger touch (via PointerGestureHandler.OnTouch inside the detector).
+			// TapAndPanGestureDetector.OnTouchEvent returns baseHandled (not consuming for PGR),
+			// so touch events propagate to parent views (e.g., CollectionView item selection).
+			var recognizers = View.GestureController?.CompositeGestureRecognizers;
+			if (recognizers != null && recognizers.Count > 0)
 			{
 				shouldAddTouchEvent = true;
 			}
 
-			// Always unsubscribe first to avoid duplicates
+
 			ClearRecyclerViewTouchListener(platformView);
 			platformView.Touch -= OnPlatformViewTouched;
 			platformView.KeyPress -= OnKeyPress;

@jpd21122012 jpd21122012 requested a review from MauiBot May 11, 2026 15:36
@dotnet dotnet deleted a comment from MauiBot May 11, 2026
@MauiBot MauiBot added s/agent-review-incomplete and removed s/agent-changes-requested AI agent recommends changes - found a better alternative or issues labels May 12, 2026
@dotnet dotnet deleted a comment from MauiBot May 12, 2026
kubaflo pushed a commit that referenced this pull request May 12, 2026
…ADB reconnect

Warm-up failures caused 2 infra failures (#34627, #35154). The 3-minute
timeout was too tight when the emulator needs ADB reconnect after idle.

- Increase warm-up timeout from 3m to 6m
- Add retryCountOnTaskFailure: 2 so warm-up retries on failure
- After ADB restart, wait for sys.boot_completed (up to 90s)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MauiBot
Copy link
Copy Markdown
Collaborator

MauiBot commented May 12, 2026

🤖 AI Summary

👋 @jpd21122012 — new AI review results are available. Please review the latest session below.

📊 Review Session9b46f92 · Fix nullable warning by caching View in SetupGestures · 2026-05-12 22:23 UTC
🚦 Gate — Test Before & After Fix

Gate Result: ❌ FAILED

Platform: ANDROID · Base: main · Merge base: f8cb875e

🩺 Fix does not pass the tests — every test still fails after applying the fix. The PR's change does not resolve the failure(s).

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue34491 Issue34491 ✅ FAIL — 541s ❌ FAIL — 520s
🔴 Without fix — 🖥️ Issue34491: FAIL ✅ · 541s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:06:38.29
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.17]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.51]   Discovered:  Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
   NUnit3TestExecutor discovered 3 of 3 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 05/12/2026 21:34:43 FixtureSetup for Issue34491(Android)
>>>>> 05/12/2026 21:34:46 CollectionViewSelectionWorksWithPointerGestureRecognizer Start
>>>>> 05/12/2026 21:35:04 CollectionViewSelectionWorksWithPointerGestureRecognizer Stop
>>>>> 05/12/2026 21:35:04 Log types: logcat, bugreport, server
  Failed CollectionViewSelectionWorksWithPointerGestureRecognizer [18 s]
  Error Message:
     SelectionChanged should fire when tapping a CollectionView item that has a PointerGestureRecognizer
Assert.That(finalText, Is.EqualTo("Selected: Item 1"))
  Expected string length 16 but was 12. Strings differ at index 0.
  Expected: "Selected: Item 1"
  But was:  "No Selection"
  -----------^

  Stack Trace:
     at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.CollectionViewSelectionWorksWithPointerGestureRecognizer() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 31

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.CollectionViewSelectionWorksWithPointerGestureRecognizer() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 31


>>>>> 05/12/2026 21:35:04 MixedTapAndPointerGesturesStillAllowSelectionAndTap Start
>>>>> 05/12/2026 21:35:20 MixedTapAndPointerGesturesStillAllowSelectionAndTap Stop
>>>>> 05/12/2026 21:35:20 Log types: logcat, bugreport, server
  Failed MixedTapAndPointerGesturesStillAllowSelectionAndTap [16 s]
  Error Message:
     SelectionChanged should still fire when tap and pointer gestures coexist
Assert.That(selectionText, Is.EqualTo("Mixed Selected: Mixed Item 1"))
  Expected string length 28 but was 18. Strings differ at index 0.
  Expected: "Mixed Selected: Mixed Item 1"
  But was:  "No Mixed Selection"
  -----------^

  Stack Trace:
     at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.MixedTapAndPointerGesturesStillAllowSelectionAndTap() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 73

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.MixedTapAndPointerGesturesStillAllowSelectionAndTap() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 73


>>>>> 05/12/2026 21:35:20 PointerPressedAndReleasedStillFire Start
>>>>> 05/12/2026 21:35:20 PointerPressedAndReleasedStillFire Stop
>>>>> 05/12/2026 21:35:21 Log types: logcat, bugreport, server
  Failed PointerPressedAndReleasedStillFire [584 ms]
  Error Message:
     Assert.That(initialText, Is.EqualTo("No Pointer Events"))
  Expected string length 17 but was 30. Strings differ at index 0.
  Expected: "No Pointer Events"
  But was:  "Pointer Released: Mixed Item 1"
  -----------^

  Stack Trace:
     at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.PointerPressedAndReleasedStillFire() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 43

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.PointerPressedAndReleasedStillFire() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 43


NUnit Adapter 4.5.0.0: Test execution complete

Test Run Failed.
Total tests: 3
     Failed: 3
 Total time: 51.9189 Seconds

🟢 With fix — 🖥️ Issue34491: FAIL ❌ · 520s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Controls.TestCases.HostApp.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Maps.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Xaml.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.AspNetCore.Components.WebView.Maui.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Maps.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.HostApp/Debug/net10.0-android/Microsoft.Maui.Controls.Foldable.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:06:35.64
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
Broadcasting: Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS flg=0x400000 }
Broadcast completed: result=0
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0/Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0/Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0/Microsoft.Maui.dll
  Controls.CustomAttributes -> /home/vsts/work/1/s/artifacts/bin/Controls.CustomAttributes/Debug/net10.0/Controls.CustomAttributes.dll
  Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.70-ci+azdo.14079023
  Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0/Microsoft.Maui.Controls.dll
  VisualTestUtils -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils/Debug/netstandard2.0/VisualTestUtils.dll
  UITest.Core -> /home/vsts/work/1/s/artifacts/bin/UITest.Core/Debug/net10.0/UITest.Core.dll
  VisualTestUtils.MagickNet -> /home/vsts/work/1/s/artifacts/bin/VisualTestUtils.MagickNet/Debug/netstandard2.0/VisualTestUtils.MagickNet.dll
  UITest.Appium -> /home/vsts/work/1/s/artifacts/bin/UITest.Appium/Debug/net10.0/UITest.Appium.dll
  UITest.NUnit -> /home/vsts/work/1/s/artifacts/bin/UITest.NUnit/Debug/net10.0/UITest.NUnit.dll
  UITest.Analyzers -> /home/vsts/work/1/s/artifacts/bin/UITest.Analyzers/Debug/netstandard2.0/UITest.Analyzers.dll
  Controls.TestCases.Android.Tests -> /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
/home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.12]   Discovering: Controls.TestCases.Android.Tests
[xUnit.net 00:00:00.36]   Discovered:  Controls.TestCases.Android.Tests
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in /home/vsts/work/1/s/artifacts/bin/Controls.TestCases.Android.Tests/Debug/net10.0/Controls.TestCases.Android.Tests.dll
   NUnit3TestExecutor discovered 3 of 3 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 05/12/2026 21:43:37 FixtureSetup for Issue34491(Android)
>>>>> 05/12/2026 21:43:40 CollectionViewSelectionWorksWithPointerGestureRecognizer Start
>>>>> 05/12/2026 21:43:44 CollectionViewSelectionWorksWithPointerGestureRecognizer Stop
  Passed CollectionViewSelectionWorksWithPointerGestureRecognizer [4 s]
>>>>> 05/12/2026 21:43:44 MixedTapAndPointerGesturesStillAllowSelectionAndTap Start
>>>>> 05/12/2026 21:44:00 MixedTapAndPointerGesturesStillAllowSelectionAndTap Stop
>>>>> 05/12/2026 21:44:00 Log types: logcat, bugreport, server
  Failed MixedTapAndPointerGesturesStillAllowSelectionAndTap [16 s]
  Error Message:
     SelectionChanged should still fire when tap and pointer gestures coexist
Assert.That(selectionText, Is.EqualTo("Mixed Selected: Mixed Item 1"))
  Expected string length 28 but was 18. Strings differ at index 0.
  Expected: "Mixed Selected: Mixed Item 1"
  But was:  "No Mixed Selection"
  -----------^

  Stack Trace:
     at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.MixedTapAndPointerGesturesStillAllowSelectionAndTap() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 73

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.MixedTapAndPointerGesturesStillAllowSelectionAndTap() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 73


>>>>> 05/12/2026 21:44:00 PointerPressedAndReleasedStillFire Start
>>>>> 05/12/2026 21:44:01 PointerPressedAndReleasedStillFire Stop
>>>>> 05/12/2026 21:44:01 Log types: logcat, bugreport, server
  Failed PointerPressedAndReleasedStillFire [630 ms]
  Error Message:
     Assert.That(initialText, Is.EqualTo("No Pointer Events"))
  Expected string length 17 but was 30. Strings differ at index 0.
  Expected: "No Pointer Events"
  But was:  "Pointer Released: Mixed Item 1"
  -----------^

  Stack Trace:
     at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.PointerPressedAndReleasedStillFire() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 43

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.PointerPressedAndReleasedStillFire() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 43


NUnit Adapter 4.5.0.0: Test execution complete

Test Run Failed.
Total tests: 3
     Passed: 1
     Failed: 2
 Total time: 35.8512 Seconds

⚠️ Failure Details

  • Issue34491 FAILED with fix (should pass)
    • Device tests: 2 of 3 failed
📁 Fix files reverted (2 files)
  • src/Controls/src/Core/Platform/Android/TapAndPanGestureDetector.cs
  • src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Android.cs

🧪 UI Tests — CollectionView

Detected UI test categories: CollectionView

Deep UI tests — 593 passed, 28 failed across 1 category on platform-pool agent (replaces in-process counts above).

🧪 UI Test Execution Results (deep, platform pool)

Category Tests Snapshot diffs
CollectionView 593/621 (28 ❌)
CollectionView — 28 failed tests
VerifyScrollToByIndexWithMakeVisiblePositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyScrollToByIndexWithMakeVisiblePositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2137
   at System.RuntimeMet
...
VerifyScrollToByItemWithCenterPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyScrollToByItemWithCenterPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2628
   at System.RuntimeMethodHan
...
VerifyGroupIndexScrollToByIndexWithEndPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupIndexScrollToByIndexWithEndPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3134
   at System.Reflecti
...
VisitAndUpdateItemsSource("Observable Collection","Add/RemoveItemsGrid",19,6)
The app was expected to be running still, investigate as possible crash
TearDown : The app was expected to be running still, investigate as possible crash
at UITest.Appium.NUnit.UITestBase.UITestBaseTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 159
   at UITest.Appium.NUnit.UITestBase.TestTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 45
   at InvokeStub_UITestBase.TestTearDown(Object, Object, IntPtr*)

--TearDown
   at UITest.Appium.NUnit.UITestBase.UITestBaseTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 159
   at UITest.Appium.NUnit.UITestBase.TestTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 45
   at InvokeStub_UITestBase.TestTearDown(Object, Object, IntPtr*)

1)    at UITest.Appium.NUnit.UITestBase.UITestBaseTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 159
   at UITest.Appium.NUnit.UITestBase.TestTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 45
   at InvokeS
...
VerifyRemainingItemsThresholdReachedWithHorizontalList
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyRemainingItemsThresholdReachedWithHorizontalList() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3652
   at System.RuntimeMethodHandle.In
...
VerifyGroupIndexScrollToByIndexWithEndPositionAndHorizontalGrid_Potato
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupIndexScrollToByIndexWithEndPositionAndHorizontalGrid_Potato() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3170
   at System.Reflec
...
VerifyScrollToByIndexWithCenterPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyScrollToByIndexWithCenterPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2295
   at System.RuntimeMethodHa
...
VerifyScrollToByIndexWithEndPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyScrollToByIndexWithEndPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2376
   at System.RuntimeMethodHandl
...
VerifyGroupIndexScrollToByIndexWithCenterPositionAndHorizontalList_Tomato
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupIndexScrollToByIndexWithCenterPositionAndHorizontalList_Tomato() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3026
   at System.Ref
...
VerifyScrollToByItemWithStartPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyScrollToByItemWithStartPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2541
   at System.RuntimeMethodHand
...
MixedTapAndPointerGesturesStillAllowSelectionAndTap
SelectionChanged should still fire when tap and pointer gestures coexist
Assert.That(selectionText, Is.EqualTo("Mixed Selected: Mixed Item 1"))
  Expected string length 28 but was 18. Strings differ at index 0.
  Expected: "Mixed Selected: Mixed Item 1"
  But was:  "No Mixed Selection"
  -----------^
at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.MixedTapAndPointerGesturesStillAllowSelectionAndTap() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 73

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.MixedTapAndPointerGesturesStillAllowSelectionAndTap() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 73
VerifyGroupIndexScrollToByIndexWithStartPositionAndVerticalList_Carrot
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupIndexScrollToByIndexWithStartPositionAndVerticalList_Carrot() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 1838
   at System.Runtim
...
VerifyGroupIndexScrollToByIndexWithMakeVisiblePositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupIndexScrollToByIndexWithMakeVisiblePositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2810
   at System.
...
VerifyScrollToByIndexWithStartPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyScrollToByIndexWithStartPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2214
   at System.RuntimeMethodHan
...
VerifyGroupItemScrollToByItemWithMakeVisiblePositionAndVerticalList_Apricot
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupItemScrollToByItemWithMakeVisiblePositionAndVerticalList_Apricot() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 1943
   at System.R
...
VerifyGroupItemScrollToByIndexWithCenterPositionAndHorizontalList_Tomato
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupItemScrollToByIndexWithCenterPositionAndHorizontalList_Tomato() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3453
   at System.Runt
...
PointerPressedAndReleasedStillFire
Assert.That(initialText, Is.EqualTo("No Pointer Events"))
  Expected string length 17 but was 30. Strings differ at index 0.
  Expected: "No Pointer Events"
  But was:  "Pointer Released: Mixed Item 1"
  -----------^
at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.PointerPressedAndReleasedStillFire() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 43

1)    at Microsoft.Maui.TestCases.Tests.Issues.Issue34491.PointerPressedAndReleasedStillFire() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue34491.cs:line 43
VerifyGroupItemScrollToByIndexWithEndPositionAndHorizontalGrid_Potato
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupItemScrollToByIndexWithEndPositionAndHorizontalGrid_Potato() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3597
   at System.Runtime
...
VerifyGroupItemScrollToByIndexWithEndPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupItemScrollToByIndexWithEndPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3561
   at System.RuntimeMe
...
VerifyGroupIndexScrollToByIndexWithCenterPositionAndVerticalList_Potato
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupIndexScrollToByIndexWithCenterPositionAndVerticalList_Potato() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 1874
   at System.Refle
...
VerifyGroupItemScrollToByItemWithStartPositionAndVerticalList_Carrot
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupItemScrollToByItemWithStartPositionAndVerticalList_Carrot() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 1974
   at System.RuntimeM
...
VerifyGroupItemScrollToByIndexWithMakeVisiblePositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupItemScrollToByIndexWithMakeVisiblePositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3241
   at System.R
...
VerifyScrollToByItemWithMakeVisiblePositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyScrollToByItemWithMakeVisiblePositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2458
   at System.RuntimeMeth
...
VerifyGroupIndexScrollToByIndexWithMakeVisiblePositionAndVerticalList_Apricot
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupIndexScrollToByIndexWithMakeVisiblePositionAndVerticalList_Apricot() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 1802
   at System
...
VerifyGroupItemScrollToByItemWithCenterPositionAndVerticalList_Potato
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupItemScrollToByItemWithCenterPositionAndVerticalList_Potato() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2007
   at System.Runtime
...
VerifyGroupItemScrollToByIndexWithStartPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupItemScrollToByIndexWithStartPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 3345
   at System.Runtime
...
VerifyScrollToByItemWithEndPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyScrollToByItemWithEndPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2715
   at System.RuntimeMethodHandle
...
VerifyGroupIndexScrollToByIndexWithStartPositionAndHorizontalList_Kiwi
System.TimeoutException : Timed out waiting for element...
at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2757
   at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2784
   at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 793
   at Microsoft.Maui.TestCases.Tests.CollectionView_ScrollingFeatureTests.VerifyGroupIndexScrollToByIndexWithStartPositionAndHorizontalList_Kiwi() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/CollectionView_ScrollingFeatureTests.cs:line 2918
   at System.Reflec
...

📎 Download drop-deep-uitests artifact (TRX + snapshot diffs)

kubaflo pushed a commit that referenced this pull request May 19, 2026
…ADB reconnect

Warm-up failures caused 2 infra failures (#34627, #35154). The 3-minute
timeout was too tight when the emulator needs ADB reconnect after idle.

- Increase warm-up timeout from 3m to 6m
- Add retryCountOnTaskFailure: 2 so warm-up retries on failure
- After ADB restart, wait for sys.boot_completed (up to 90s)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
kubaflo pushed a commit that referenced this pull request May 22, 2026
…ADB reconnect

Warm-up failures caused 2 infra failures (#34627, #35154). The 3-minute
timeout was too tight when the emulator needs ADB reconnect after idle.

- Increase warm-up timeout from 3m to 6m
- Add retryCountOnTaskFailure: 2 so warm-up retries on failure
- After ADB restart, wait for sys.boot_completed (up to 90s)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kubaflo
Copy link
Copy Markdown
Contributor

kubaflo commented May 24, 2026

/review -b feature/refactor-copilot-yml

Copy link
Copy Markdown
Collaborator

@MauiBot MauiBot left a comment

Choose a reason for hiding this comment

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

Expert Review — 2 findings

See inline comments for details.

for (int i = 0; i < count; i++)
{
if (recognizer is not PointerGestureRecognizer)
if (recognizers[i] is not PointerGestureRecognizer)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[major] Android gesture handler correctness — Skipping the touch/RecyclerView listener when the effective recognizers are pointer-only removes the only path that delivers Down/Move/Up/Cancel to PointerGestureHandler.OnTouch. SetupHandlerForPointer() only installs the hover listener, while PointerPressed/PointerReleased are raised from TapAndPanGestureDetector.OnTouchEvent; without platformView.Touch/GestureItemTouchListener, pointer-only views will not receive pressed/released touch events. This breaks the pointer semantics the PR is trying to preserve.

App.WaitForElement("Item 1");
App.Tap("Item 1");

App.WaitForTextToBePresentInElement("PointerStatusLabel", "Pointer Released: Item 1");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[moderate] Regression test coverage — This test name says PointerPressedAndReleasedStillFire, but it only verifies the final Pointer Released text. Since App.Tap sends press and release as one gesture and the sample overwrites the same label on release, a regression where PointerPressed is skipped but PointerReleased still fires would pass. Please record separate pressed/released state or an event history/counter so the test actually proves both callbacks ran.

Copy link
Copy Markdown
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

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

Could you please check the ai's suggestions?

@kubaflo
Copy link
Copy Markdown
Contributor

kubaflo commented May 27, 2026

/review -b feature/refactor-copilot-yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Android] CollectionView item selection not triggered when using PointerGestureRecognizer

5 participants