[NUI][ATSPI] Set AccessibilityHidden for DefaultLinearItem (#3914)
authorkimcinoo <kimcinoo@gmail.com>
Thu, 3 Mar 2022 05:53:29 +0000 (14:53 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 4 Mar 2022 05:31:52 +0000 (14:31 +0900)
The Seperator of DefaultLinearItem would be not necessary to AT-Client.
This patch is removing Seperator accessible nodes from A11Y tree.

And the Label would be not necessary to AT-Client, if the DefaultLinearItem
provides the Label information.
This patch is removing Label accessible nodes as well.

Co-authored-by: Shinwoo Kim <cinoo.kim@samsung.com>
src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs

index 84e5aa9..1b7c77f 100755 (executable)
@@ -150,8 +150,6 @@ namespace Tizen.NUI.Components
                         layoutChanged = true;
                         Add(itemLabel);
                     }
-                    itemLabel.AppendAccessibilityRelation(this, AccessibilityRelationType.ControlledBy);
-                    this.AppendAccessibilityRelation(itemLabel, AccessibilityRelationType.LabelledBy);
                 }
                 return itemLabel;
             }
@@ -305,7 +303,8 @@ namespace Tizen.NUI.Components
                         //need to consider horizontal/vertical!
                         WidthSpecification = LayoutParamPolicies.MatchParent,
                         HeightSpecification = 2,
-                        ExcludeLayouting = true
+                        ExcludeLayouting = true,
+                        AccessibilityHidden = true
                     };
                     layoutChanged = true;
                     Add(itemSeperator);
@@ -361,6 +360,15 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
+        /// Get accessibility name.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected override string AccessibilityGetName()
+        {
+            return Label.Text + ", " + SubLabel.Text;
+        }
+
+        /// <summary>
         /// Creates Item's text part.
         /// </summary>
         /// <return>The created Item's text part.</return>
@@ -370,7 +378,8 @@ namespace Tizen.NUI.Components
             return new TextLabel(style)
             {
                 HorizontalAlignment = HorizontalAlignment.Begin,
-                VerticalAlignment = VerticalAlignment.Center
+                VerticalAlignment = VerticalAlignment.Center,
+                AccessibilityHidden = true
             };
         }