Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit ba65be1

Browse files
committed
Update VisualElementRenderer.cs
1 parent 0610978 commit ba65be1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Xamarin.Forms.Platform.Android/VisualElementRenderer.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Xamarin.Forms.Platform.Android.FastRenderers;
99
using Android.Runtime;
1010
using Android.Support.V4.View;
11+
using Android.Views.Accessibility;
1112

1213
namespace Xamarin.Forms.Platform.Android
1314
{
@@ -408,7 +409,14 @@ protected virtual void OnRegisterEffect(PlatformEffect effect)
408409
}
409410

410411
protected virtual void SetAutomationId(string id)
411-
=> AutomationPropertiesProvider.SetAutomationId(this, Element, id);
412+
{
413+
var accessibilityManager = Context.GetSystemService(Context.AccessibilityService) as AccessibilityManager;
414+
415+
if (accessibilityManager?.IsTouchExplorationEnabled ?? false)
416+
return;
417+
418+
AutomationPropertiesProvider.SetAutomationId(this, Element, id);
419+
}
412420

413421
protected virtual void SetContentDescription()
414422
=> AutomationPropertiesProvider.SetContentDescription(this, Element, ref _defaultContentDescription, ref _defaultHint);

0 commit comments

Comments
 (0)