[NUI][AT-SPI] Override ContentPage.AccessibilityGetName() (#5141)
authorArtur Świgoń <aswigon@yandex.com>
Mon, 3 Apr 2023 09:43:26 +0000 (11:43 +0200)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Wed, 5 Apr 2023 12:12:53 +0000 (21:12 +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 227770ab8095f2512df5bba8d30ac74b84f656cf..166951802ac9c5e2af84e9eb3ca835fd52d325af 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.