From a4557b74cac852741a4c6b90cef9843ec1ac835b Mon Sep 17 00:00:00 2001 From: Rachel Kang Date: Tue, 11 Jan 2022 04:30:00 -0500 Subject: [PATCH] [Android] Fix a11y set semantic focus (#1782) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add SemanticExtensions SetFocus and Announce * Add Windows Announce implementation * Update based on feedback * Fix SetSemanticFocus for Android * Revert order of usings to clean up diff Co-authored-by: Brandon Minnick <13558917+brminnick@users.noreply.github.com> Co-authored-by: Javier Suárez Co-authored-by: Gerald Versluis --- .../Extensions/Semantic/SemanticExtensions.android.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/Semantic/SemanticExtensions.android.cs b/src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/Semantic/SemanticExtensions.android.cs index 875a58c94..e1e34789f 100644 --- a/src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/Semantic/SemanticExtensions.android.cs +++ b/src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/Semantic/SemanticExtensions.android.cs @@ -17,7 +17,7 @@ static void PlatformSetSemanticFocus(this VisualElement element) if (androidView is not AView view) throw new NullReferenceException("Can't access view"); - view.SendAccessibilityEvent(EventTypes.ViewFocused); + view.SendAccessibilityEvent((EventTypes)(int)WindowsChange.AccessibilityFocused); } static void PlatformAnnounce(string text) @@ -36,4 +36,4 @@ static void PlatformAnnounce(string text) manager.SendAccessibilityEvent(announcement); } } -} \ No newline at end of file +}