[NUI][AT-SPI] Override ContentPage.AccessibilityGetName() (#5146)
authorArtur Świgoń <aswigon@yandex.com>
Mon, 3 Apr 2023 10:19:56 +0000 (12:19 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Apr 2023 10:19:56 +0000 (19:19 +0900)
ContentPage often serves as a default label in scenarios where Navigator is
used, so Screen Reader will ask ContentPage about the accessibility name (text
to read) when a Navigator page is pushed. Therefore, it makes sense to try to
provide the text from ContentPage.AppBar.Title (if it exists). The application
developer can always customize this by setting the AccessibilityName property
or adding an AccessibilityRelation.LabelledBy.

Co-authored-by: Artur Świgoń <a.swigon@samsung.com>
src/Tizen.NUI.Components/Controls/Navigation/ContentPage.cs

index 227770a..1669518 100755 (executable)
@@ -104,6 +104,13 @@ namespace Tizen.NUI.Components
             AccessibilityRole = Role.PageTab;
         }
 
+        /// <inheritdoc/>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override string AccessibilityGetName()
+        {
+            return AppBar?.Title;
+        }
+
         /// <summary>
         /// AppBar of ContentPage.
         /// AppBar is added as a child of ContentPage automatically.